Skip to content

chore: update to the latest swagger API #588

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,20 @@ async with InfluxDBClientAsync(url="http://localhost:8086", token="my-token", or
client_session_kwargs={'trust_env': True}) as client:
pass
```

This release introduces a support for new version of InfluxDB API definitions with following breaking changes:

- `User`, `UserResponse`, `ResourceMember` and `ResourceOwner` classes no longer supports `oauth_id` field
- `Task` class no longer supports `type` field
- `ScriptUpdateRequest` class no longer supports `name` field
- `UsersService.get_flags` operation is moved to `ConfigService`

### Features
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

### API
1. [#588](https://github.com/influxdata/influxdb-client-python/pull/588): Use the latest InfluxDB API definitions for generated APIs

### Bug Fixes
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]
1. [#584](https://github.com/influxdata/influxdb-client-python/pull/584): Parsing empty query result value as `numpy.NaN`
Expand Down
8 changes: 8 additions & 0 deletions influxdb_client/domain/add_resource_member_request_body.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ def __init__(self, id=None, name=None): # noqa: E501,D401,D403
def id(self):
"""Get the id of this AddResourceMemberRequestBody.

The ID of the user to add to the resource.

:return: The id of this AddResourceMemberRequestBody.
:rtype: str
""" # noqa: E501
Expand All @@ -62,6 +64,8 @@ def id(self):
def id(self, id):
"""Set the id of this AddResourceMemberRequestBody.

The ID of the user to add to the resource.

:param id: The id of this AddResourceMemberRequestBody.
:type: str
""" # noqa: E501
Expand All @@ -73,6 +77,8 @@ def id(self, id):
def name(self):
"""Get the name of this AddResourceMemberRequestBody.

The name of the user to add to the resource.

:return: The name of this AddResourceMemberRequestBody.
:rtype: str
""" # noqa: E501
Expand All @@ -82,6 +88,8 @@ def name(self):
def name(self, name):
"""Set the name of this AddResourceMemberRequestBody.

The name of the user to add to the resource.

:param name: The name of this AddResourceMemberRequestBody.
:type: str
""" # noqa: E501
Expand Down
28 changes: 16 additions & 12 deletions influxdb_client/domain/authorization.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def updated_at(self, updated_at):
def org_id(self):
"""Get the org_id of this Authorization.

ID of the organization that the authorization is scoped to.
The organization ID. Specifies the [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) that the authorization is scoped to.

:return: The org_id of this Authorization.
:rtype: str
Expand All @@ -149,7 +149,7 @@ def org_id(self):
def org_id(self, org_id):
"""Set the org_id of this Authorization.

ID of the organization that the authorization is scoped to.
The organization ID. Specifies the [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) that the authorization is scoped to.

:param org_id: The org_id of this Authorization.
:type: str
Expand All @@ -160,7 +160,7 @@ def org_id(self, org_id):
def permissions(self):
"""Get the permissions of this Authorization.

List of permissions for an authorization. An authorization must have at least one permission.
The list of permissions. An authorization must have at least one permission.

:return: The permissions of this Authorization.
:rtype: list[Permission]
Expand All @@ -171,7 +171,7 @@ def permissions(self):
def permissions(self, permissions):
"""Set the permissions of this Authorization.

List of permissions for an authorization. An authorization must have at least one permission.
The list of permissions. An authorization must have at least one permission.

:param permissions: The permissions of this Authorization.
:type: list[Permission]
Expand All @@ -182,6 +182,8 @@ def permissions(self, permissions):
def id(self):
"""Get the id of this Authorization.

The authorization ID.

:return: The id of this Authorization.
:rtype: str
""" # noqa: E501
Expand All @@ -191,6 +193,8 @@ def id(self):
def id(self, id):
"""Set the id of this Authorization.

The authorization ID.

:param id: The id of this Authorization.
:type: str
""" # noqa: E501
Expand All @@ -200,7 +204,7 @@ def id(self, id):
def token(self):
"""Get the token of this Authorization.

Token used to authenticate API requests.
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).

:return: The token of this Authorization.
:rtype: str
Expand All @@ -211,7 +215,7 @@ def token(self):
def token(self, token):
"""Set the token of this Authorization.

Token used to authenticate API requests.
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).

:param token: The token of this Authorization.
:type: str
Expand All @@ -222,7 +226,7 @@ def token(self, token):
def user_id(self):
"""Get the user_id of this Authorization.

ID of the user that created and owns the token.
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.

:return: The user_id of this Authorization.
:rtype: str
Expand All @@ -233,7 +237,7 @@ def user_id(self):
def user_id(self, user_id):
"""Set the user_id of this Authorization.

ID of the user that created and owns the token.
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.

:param user_id: The user_id of this Authorization.
:type: str
Expand All @@ -244,7 +248,7 @@ def user_id(self, user_id):
def user(self):
"""Get the user of this Authorization.

Name of the user that created and owns the token.
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.

:return: The user of this Authorization.
:rtype: str
Expand All @@ -255,7 +259,7 @@ def user(self):
def user(self, user):
"""Set the user of this Authorization.

Name of the user that created and owns the token.
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.

:param user: The user of this Authorization.
:type: str
Expand All @@ -266,7 +270,7 @@ def user(self, user):
def org(self):
"""Get the org of this Authorization.

Name of the organization that the token is scoped to.
The organization name. Specifies the [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) that the token is scoped to.

:return: The org of this Authorization.
:rtype: str
Expand All @@ -277,7 +281,7 @@ def org(self):
def org(self, org):
"""Set the org of this Authorization.

Name of the organization that the token is scoped to.
The organization name. Specifies the [organization](https://docs.influxdata.com/influxdb/latest/reference/glossary/#organization) that the token is scoped to.

:param org: The org of this Authorization.
:type: str
Expand Down
12 changes: 6 additions & 6 deletions influxdb_client/domain/authorization_post_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def __init__(self, org_id=None, user_id=None, permissions=None, status='active',
def org_id(self):
"""Get the org_id of this AuthorizationPostRequest.

ID of org that authorization is scoped to.
An organization ID. Specifies the organization that owns the authorization.

:return: The org_id of this AuthorizationPostRequest.
:rtype: str
Expand All @@ -78,7 +78,7 @@ def org_id(self):
def org_id(self, org_id):
"""Set the org_id of this AuthorizationPostRequest.

ID of org that authorization is scoped to.
An organization ID. Specifies the organization that owns the authorization.

:param org_id: The org_id of this AuthorizationPostRequest.
:type: str
Expand All @@ -89,7 +89,7 @@ def org_id(self, org_id):
def user_id(self):
"""Get the user_id of this AuthorizationPostRequest.

ID of user that authorization is scoped to.
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.

:return: The user_id of this AuthorizationPostRequest.
:rtype: str
Expand All @@ -100,7 +100,7 @@ def user_id(self):
def user_id(self, user_id):
"""Set the user_id of this AuthorizationPostRequest.

ID of user that authorization is scoped to.
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.

:param user_id: The user_id of this AuthorizationPostRequest.
:type: str
Expand All @@ -111,7 +111,7 @@ def user_id(self, user_id):
def permissions(self):
"""Get the permissions of this AuthorizationPostRequest.

List of permissions for an auth. An auth must have at least one Permission.
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.

:return: The permissions of this AuthorizationPostRequest.
:rtype: list[Permission]
Expand All @@ -122,7 +122,7 @@ def permissions(self):
def permissions(self, permissions):
"""Set the permissions of this AuthorizationPostRequest.

List of permissions for an auth. An auth must have at least one Permission.
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.

:param permissions: The permissions of this AuthorizationPostRequest.
:type: list[Permission]
Expand Down
4 changes: 2 additions & 2 deletions influxdb_client/domain/authorization_update_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __init__(self, status='active', description=None): # noqa: E501,D401,D403
def status(self):
"""Get the status of this AuthorizationUpdateRequest.

Status of the token. If `inactive`, requests using the token will be rejected.
Status of the token. If `inactive`, InfluxDB rejects requests that use the token.

:return: The status of this AuthorizationUpdateRequest.
:rtype: str
Expand All @@ -65,7 +65,7 @@ def status(self):
def status(self, status):
"""Set the status of this AuthorizationUpdateRequest.

Status of the token. If `inactive`, requests using the token will be rejected.
Status of the token. If `inactive`, InfluxDB rejects requests that use the token.

:param status: The status of this AuthorizationUpdateRequest.
:type: str
Expand Down
25 changes: 24 additions & 1 deletion influxdb_client/domain/band_view_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class BandViewProperties(ViewProperties):
and the value is json key in definition.
"""
openapi_types = {
'adaptive_zoom_hide': 'bool',
'time_format': 'str',
'type': 'str',
'queries': 'list[DashboardQuery]',
Expand Down Expand Up @@ -63,6 +64,7 @@ class BandViewProperties(ViewProperties):
}

attribute_map = {
'adaptive_zoom_hide': 'adaptiveZoomHide',
'time_format': 'timeFormat',
'type': 'type',
'queries': 'queries',
Expand Down Expand Up @@ -93,10 +95,11 @@ class BandViewProperties(ViewProperties):
'legend_orientation_threshold': 'legendOrientationThreshold'
}

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
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
"""BandViewProperties - a model defined in OpenAPI.""" # noqa: E501
ViewProperties.__init__(self) # noqa: E501

self._adaptive_zoom_hide = None
self._time_format = None
self._type = None
self._queries = None
Expand Down Expand Up @@ -127,6 +130,8 @@ def __init__(self, time_format=None, type=None, queries=None, colors=None, shape
self._legend_orientation_threshold = None
self.discriminator = None

if adaptive_zoom_hide is not None:
self.adaptive_zoom_hide = adaptive_zoom_hide
if time_format is not None:
self.time_format = time_format
self.type = type
Expand Down Expand Up @@ -176,6 +181,24 @@ def __init__(self, time_format=None, type=None, queries=None, colors=None, shape
if legend_orientation_threshold is not None:
self.legend_orientation_threshold = legend_orientation_threshold

@property
def adaptive_zoom_hide(self):
"""Get the adaptive_zoom_hide of this BandViewProperties.

:return: The adaptive_zoom_hide of this BandViewProperties.
:rtype: bool
""" # noqa: E501
return self._adaptive_zoom_hide

@adaptive_zoom_hide.setter
def adaptive_zoom_hide(self, adaptive_zoom_hide):
"""Set the adaptive_zoom_hide of this BandViewProperties.

:param adaptive_zoom_hide: The adaptive_zoom_hide of this BandViewProperties.
:type: bool
""" # noqa: E501
self._adaptive_zoom_hide = adaptive_zoom_hide

@property
def time_format(self):
"""Get the time_format of this BandViewProperties.
Expand Down
4 changes: 2 additions & 2 deletions influxdb_client/domain/bucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def updated_at(self, updated_at):
def retention_rules(self):
"""Get the retention_rules of this Bucket.

Rules to expire or retain data. No rules means data never expires.
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.

:return: The retention_rules of this Bucket.
:rtype: list[BucketRetentionRules]
Expand All @@ -295,7 +295,7 @@ def retention_rules(self):
def retention_rules(self, retention_rules):
"""Set the retention_rules of this Bucket.

Rules to expire or retain data. No rules means data never expires.
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.

:param retention_rules: The retention_rules of this Bucket.
:type: list[BucketRetentionRules]
Expand Down
Loading