stackit-auditlog 0.1.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.
- stackit/auditlog/__init__.py +81 -0
- stackit/auditlog/api/__init__.py +4 -0
- stackit/auditlog/api/default_api.py +1204 -0
- stackit/auditlog/api_client.py +639 -0
- stackit/auditlog/api_response.py +23 -0
- stackit/auditlog/configuration.py +163 -0
- stackit/auditlog/exceptions.py +217 -0
- stackit/auditlog/models/__init__.py +37 -0
- stackit/auditlog/models/audit_log_entry_context_response.py +95 -0
- stackit/auditlog/models/audit_log_entry_initiator_response.py +84 -0
- stackit/auditlog/models/audit_log_entry_request_response.py +96 -0
- stackit/auditlog/models/audit_log_entry_response.py +239 -0
- stackit/auditlog/models/audit_log_entry_service_account_delegation_info_response.py +102 -0
- stackit/auditlog/models/error_response.py +92 -0
- stackit/auditlog/models/gateway_error_response.py +82 -0
- stackit/auditlog/models/list_audit_log_entries_response.py +104 -0
- stackit/auditlog/models/service_account_delegation_info_principal_response.py +84 -0
- stackit/auditlog/py.typed +0 -0
- stackit/auditlog/rest.py +148 -0
- stackit_auditlog-0.1.0.dist-info/LICENSE.md +201 -0
- stackit_auditlog-0.1.0.dist-info/METADATA +58 -0
- stackit_auditlog-0.1.0.dist-info/NOTICE.txt +2 -0
- stackit_auditlog-0.1.0.dist-info/RECORD +24 -0
- stackit_auditlog-0.1.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,1204 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Audit Log API
|
|
5
|
+
|
|
6
|
+
API Endpoints to retrieve recorded actions and resulting changes in the system. ### Documentation The user documentation with explanations how to use the api can be found [here](https://docs.stackit.cloud/stackit/en/retrieve-audit-log-per-api-request-134415907.html). ### Audit Logging Changes on organizations, folders and projects and respective cloud resources are logged and collected in the audit log. ### API Constraints The audit log API allows to download messages from the last 90 days. The maximum duration that can be queried at once is 24 hours. Requests are rate limited - the current maximum is 60 requests per minute.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 2.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
from datetime import datetime
|
|
15
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
16
|
+
|
|
17
|
+
from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call
|
|
18
|
+
from stackit.core.configuration import Configuration
|
|
19
|
+
from typing_extensions import Annotated
|
|
20
|
+
|
|
21
|
+
from stackit.auditlog.api_client import ApiClient, RequestSerialized
|
|
22
|
+
from stackit.auditlog.api_response import ApiResponse
|
|
23
|
+
from stackit.auditlog.models.list_audit_log_entries_response import (
|
|
24
|
+
ListAuditLogEntriesResponse,
|
|
25
|
+
)
|
|
26
|
+
from stackit.auditlog.rest import RESTResponseType
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class DefaultApi:
|
|
30
|
+
"""NOTE: This class is auto generated by OpenAPI Generator
|
|
31
|
+
Ref: https://openapi-generator.tech
|
|
32
|
+
|
|
33
|
+
Do not edit the class manually.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
def __init__(self, configuration: Configuration = None) -> None:
|
|
37
|
+
if configuration is None:
|
|
38
|
+
configuration = Configuration()
|
|
39
|
+
self.configuration = configuration
|
|
40
|
+
self.api_client = ApiClient(self.configuration)
|
|
41
|
+
|
|
42
|
+
@validate_call
|
|
43
|
+
def list_folder_audit_log_entries(
|
|
44
|
+
self,
|
|
45
|
+
folder_id: Annotated[StrictStr, Field(description="ID of the folder for which entries should be returned.")],
|
|
46
|
+
start_time_range: Annotated[
|
|
47
|
+
datetime,
|
|
48
|
+
Field(
|
|
49
|
+
description="An ISO timestamp to specify the beginning of the time range from which entries should be returned, based on the eventTimeStamp. If not given, defaults to the beginning of time."
|
|
50
|
+
),
|
|
51
|
+
],
|
|
52
|
+
end_time_range: Annotated[
|
|
53
|
+
datetime,
|
|
54
|
+
Field(
|
|
55
|
+
description="An ISO timestamp to specify the end of the time range up until which entries should be returned, based on the eventTimeStamp. If not given, defaults to the time this request was received."
|
|
56
|
+
),
|
|
57
|
+
],
|
|
58
|
+
limit: Annotated[
|
|
59
|
+
Optional[
|
|
60
|
+
Union[
|
|
61
|
+
Annotated[float, Field(le=100, strict=True, ge=1)], Annotated[int, Field(le=100, strict=True, ge=1)]
|
|
62
|
+
]
|
|
63
|
+
],
|
|
64
|
+
Field(
|
|
65
|
+
description="The maximum number of entries to return. If the value exceeds the allowed maximum, the maximum value will be used instead."
|
|
66
|
+
),
|
|
67
|
+
] = None,
|
|
68
|
+
cursor: Annotated[
|
|
69
|
+
Optional[StrictStr],
|
|
70
|
+
Field(
|
|
71
|
+
description="A pagination cursor to load further audit log entries for. May be included in the response of previous calls of the API."
|
|
72
|
+
),
|
|
73
|
+
] = None,
|
|
74
|
+
_request_timeout: Union[
|
|
75
|
+
None,
|
|
76
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
77
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
78
|
+
] = None,
|
|
79
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
80
|
+
_content_type: Optional[StrictStr] = None,
|
|
81
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
82
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
83
|
+
) -> ListAuditLogEntriesResponse:
|
|
84
|
+
"""Folder - Download audit log entries
|
|
85
|
+
|
|
86
|
+
Returns all audit log entries of the folder for the specified period. \\ Period must not be longer than 24 hours within the last 90 days.
|
|
87
|
+
|
|
88
|
+
:param folder_id: ID of the folder for which entries should be returned. (required)
|
|
89
|
+
:type folder_id: str
|
|
90
|
+
:param start_time_range: An ISO timestamp to specify the beginning of the time range from which entries should be returned, based on the eventTimeStamp. If not given, defaults to the beginning of time. (required)
|
|
91
|
+
:type start_time_range: datetime
|
|
92
|
+
:param end_time_range: An ISO timestamp to specify the end of the time range up until which entries should be returned, based on the eventTimeStamp. If not given, defaults to the time this request was received. (required)
|
|
93
|
+
:type end_time_range: datetime
|
|
94
|
+
:param limit: The maximum number of entries to return. If the value exceeds the allowed maximum, the maximum value will be used instead.
|
|
95
|
+
:type limit: float
|
|
96
|
+
:param cursor: A pagination cursor to load further audit log entries for. May be included in the response of previous calls of the API.
|
|
97
|
+
:type cursor: str
|
|
98
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
99
|
+
number provided, it will be total request
|
|
100
|
+
timeout. It can also be a pair (tuple) of
|
|
101
|
+
(connection, read) timeouts.
|
|
102
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
103
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
104
|
+
request; this effectively ignores the
|
|
105
|
+
authentication in the spec for a single request.
|
|
106
|
+
:type _request_auth: dict, optional
|
|
107
|
+
:param _content_type: force content-type for the request.
|
|
108
|
+
:type _content_type: str, Optional
|
|
109
|
+
:param _headers: set to override the headers for a single
|
|
110
|
+
request; this effectively ignores the headers
|
|
111
|
+
in the spec for a single request.
|
|
112
|
+
:type _headers: dict, optional
|
|
113
|
+
:param _host_index: set to override the host_index for a single
|
|
114
|
+
request; this effectively ignores the host_index
|
|
115
|
+
in the spec for a single request.
|
|
116
|
+
:type _host_index: int, optional
|
|
117
|
+
:return: Returns the result object.
|
|
118
|
+
""" # noqa: E501
|
|
119
|
+
|
|
120
|
+
_param = self._list_folder_audit_log_entries_serialize(
|
|
121
|
+
folder_id=folder_id,
|
|
122
|
+
start_time_range=start_time_range,
|
|
123
|
+
end_time_range=end_time_range,
|
|
124
|
+
limit=limit,
|
|
125
|
+
cursor=cursor,
|
|
126
|
+
_request_auth=_request_auth,
|
|
127
|
+
_content_type=_content_type,
|
|
128
|
+
_headers=_headers,
|
|
129
|
+
_host_index=_host_index,
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
133
|
+
"200": "ListAuditLogEntriesResponse",
|
|
134
|
+
"400": "ErrorResponse",
|
|
135
|
+
"401": "ErrorResponse",
|
|
136
|
+
"404": "ErrorResponse",
|
|
137
|
+
"429": "GatewayErrorResponse",
|
|
138
|
+
}
|
|
139
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
140
|
+
response_data.read()
|
|
141
|
+
return self.api_client.response_deserialize(
|
|
142
|
+
response_data=response_data,
|
|
143
|
+
response_types_map=_response_types_map,
|
|
144
|
+
).data
|
|
145
|
+
|
|
146
|
+
@validate_call
|
|
147
|
+
def list_folder_audit_log_entries_with_http_info(
|
|
148
|
+
self,
|
|
149
|
+
folder_id: Annotated[StrictStr, Field(description="ID of the folder for which entries should be returned.")],
|
|
150
|
+
start_time_range: Annotated[
|
|
151
|
+
datetime,
|
|
152
|
+
Field(
|
|
153
|
+
description="An ISO timestamp to specify the beginning of the time range from which entries should be returned, based on the eventTimeStamp. If not given, defaults to the beginning of time."
|
|
154
|
+
),
|
|
155
|
+
],
|
|
156
|
+
end_time_range: Annotated[
|
|
157
|
+
datetime,
|
|
158
|
+
Field(
|
|
159
|
+
description="An ISO timestamp to specify the end of the time range up until which entries should be returned, based on the eventTimeStamp. If not given, defaults to the time this request was received."
|
|
160
|
+
),
|
|
161
|
+
],
|
|
162
|
+
limit: Annotated[
|
|
163
|
+
Optional[
|
|
164
|
+
Union[
|
|
165
|
+
Annotated[float, Field(le=100, strict=True, ge=1)], Annotated[int, Field(le=100, strict=True, ge=1)]
|
|
166
|
+
]
|
|
167
|
+
],
|
|
168
|
+
Field(
|
|
169
|
+
description="The maximum number of entries to return. If the value exceeds the allowed maximum, the maximum value will be used instead."
|
|
170
|
+
),
|
|
171
|
+
] = None,
|
|
172
|
+
cursor: Annotated[
|
|
173
|
+
Optional[StrictStr],
|
|
174
|
+
Field(
|
|
175
|
+
description="A pagination cursor to load further audit log entries for. May be included in the response of previous calls of the API."
|
|
176
|
+
),
|
|
177
|
+
] = None,
|
|
178
|
+
_request_timeout: Union[
|
|
179
|
+
None,
|
|
180
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
181
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
182
|
+
] = None,
|
|
183
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
184
|
+
_content_type: Optional[StrictStr] = None,
|
|
185
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
186
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
187
|
+
) -> ApiResponse[ListAuditLogEntriesResponse]:
|
|
188
|
+
"""Folder - Download audit log entries
|
|
189
|
+
|
|
190
|
+
Returns all audit log entries of the folder for the specified period. \\ Period must not be longer than 24 hours within the last 90 days.
|
|
191
|
+
|
|
192
|
+
:param folder_id: ID of the folder for which entries should be returned. (required)
|
|
193
|
+
:type folder_id: str
|
|
194
|
+
:param start_time_range: An ISO timestamp to specify the beginning of the time range from which entries should be returned, based on the eventTimeStamp. If not given, defaults to the beginning of time. (required)
|
|
195
|
+
:type start_time_range: datetime
|
|
196
|
+
:param end_time_range: An ISO timestamp to specify the end of the time range up until which entries should be returned, based on the eventTimeStamp. If not given, defaults to the time this request was received. (required)
|
|
197
|
+
:type end_time_range: datetime
|
|
198
|
+
:param limit: The maximum number of entries to return. If the value exceeds the allowed maximum, the maximum value will be used instead.
|
|
199
|
+
:type limit: float
|
|
200
|
+
:param cursor: A pagination cursor to load further audit log entries for. May be included in the response of previous calls of the API.
|
|
201
|
+
:type cursor: str
|
|
202
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
203
|
+
number provided, it will be total request
|
|
204
|
+
timeout. It can also be a pair (tuple) of
|
|
205
|
+
(connection, read) timeouts.
|
|
206
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
207
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
208
|
+
request; this effectively ignores the
|
|
209
|
+
authentication in the spec for a single request.
|
|
210
|
+
:type _request_auth: dict, optional
|
|
211
|
+
:param _content_type: force content-type for the request.
|
|
212
|
+
:type _content_type: str, Optional
|
|
213
|
+
:param _headers: set to override the headers for a single
|
|
214
|
+
request; this effectively ignores the headers
|
|
215
|
+
in the spec for a single request.
|
|
216
|
+
:type _headers: dict, optional
|
|
217
|
+
:param _host_index: set to override the host_index for a single
|
|
218
|
+
request; this effectively ignores the host_index
|
|
219
|
+
in the spec for a single request.
|
|
220
|
+
:type _host_index: int, optional
|
|
221
|
+
:return: Returns the result object.
|
|
222
|
+
""" # noqa: E501
|
|
223
|
+
|
|
224
|
+
_param = self._list_folder_audit_log_entries_serialize(
|
|
225
|
+
folder_id=folder_id,
|
|
226
|
+
start_time_range=start_time_range,
|
|
227
|
+
end_time_range=end_time_range,
|
|
228
|
+
limit=limit,
|
|
229
|
+
cursor=cursor,
|
|
230
|
+
_request_auth=_request_auth,
|
|
231
|
+
_content_type=_content_type,
|
|
232
|
+
_headers=_headers,
|
|
233
|
+
_host_index=_host_index,
|
|
234
|
+
)
|
|
235
|
+
|
|
236
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
237
|
+
"200": "ListAuditLogEntriesResponse",
|
|
238
|
+
"400": "ErrorResponse",
|
|
239
|
+
"401": "ErrorResponse",
|
|
240
|
+
"404": "ErrorResponse",
|
|
241
|
+
"429": "GatewayErrorResponse",
|
|
242
|
+
}
|
|
243
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
244
|
+
response_data.read()
|
|
245
|
+
return self.api_client.response_deserialize(
|
|
246
|
+
response_data=response_data,
|
|
247
|
+
response_types_map=_response_types_map,
|
|
248
|
+
)
|
|
249
|
+
|
|
250
|
+
@validate_call
|
|
251
|
+
def list_folder_audit_log_entries_without_preload_content(
|
|
252
|
+
self,
|
|
253
|
+
folder_id: Annotated[StrictStr, Field(description="ID of the folder for which entries should be returned.")],
|
|
254
|
+
start_time_range: Annotated[
|
|
255
|
+
datetime,
|
|
256
|
+
Field(
|
|
257
|
+
description="An ISO timestamp to specify the beginning of the time range from which entries should be returned, based on the eventTimeStamp. If not given, defaults to the beginning of time."
|
|
258
|
+
),
|
|
259
|
+
],
|
|
260
|
+
end_time_range: Annotated[
|
|
261
|
+
datetime,
|
|
262
|
+
Field(
|
|
263
|
+
description="An ISO timestamp to specify the end of the time range up until which entries should be returned, based on the eventTimeStamp. If not given, defaults to the time this request was received."
|
|
264
|
+
),
|
|
265
|
+
],
|
|
266
|
+
limit: Annotated[
|
|
267
|
+
Optional[
|
|
268
|
+
Union[
|
|
269
|
+
Annotated[float, Field(le=100, strict=True, ge=1)], Annotated[int, Field(le=100, strict=True, ge=1)]
|
|
270
|
+
]
|
|
271
|
+
],
|
|
272
|
+
Field(
|
|
273
|
+
description="The maximum number of entries to return. If the value exceeds the allowed maximum, the maximum value will be used instead."
|
|
274
|
+
),
|
|
275
|
+
] = None,
|
|
276
|
+
cursor: Annotated[
|
|
277
|
+
Optional[StrictStr],
|
|
278
|
+
Field(
|
|
279
|
+
description="A pagination cursor to load further audit log entries for. May be included in the response of previous calls of the API."
|
|
280
|
+
),
|
|
281
|
+
] = None,
|
|
282
|
+
_request_timeout: Union[
|
|
283
|
+
None,
|
|
284
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
285
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
286
|
+
] = None,
|
|
287
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
288
|
+
_content_type: Optional[StrictStr] = None,
|
|
289
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
290
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
291
|
+
) -> RESTResponseType:
|
|
292
|
+
"""Folder - Download audit log entries
|
|
293
|
+
|
|
294
|
+
Returns all audit log entries of the folder for the specified period. \\ Period must not be longer than 24 hours within the last 90 days.
|
|
295
|
+
|
|
296
|
+
:param folder_id: ID of the folder for which entries should be returned. (required)
|
|
297
|
+
:type folder_id: str
|
|
298
|
+
:param start_time_range: An ISO timestamp to specify the beginning of the time range from which entries should be returned, based on the eventTimeStamp. If not given, defaults to the beginning of time. (required)
|
|
299
|
+
:type start_time_range: datetime
|
|
300
|
+
:param end_time_range: An ISO timestamp to specify the end of the time range up until which entries should be returned, based on the eventTimeStamp. If not given, defaults to the time this request was received. (required)
|
|
301
|
+
:type end_time_range: datetime
|
|
302
|
+
:param limit: The maximum number of entries to return. If the value exceeds the allowed maximum, the maximum value will be used instead.
|
|
303
|
+
:type limit: float
|
|
304
|
+
:param cursor: A pagination cursor to load further audit log entries for. May be included in the response of previous calls of the API.
|
|
305
|
+
:type cursor: str
|
|
306
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
307
|
+
number provided, it will be total request
|
|
308
|
+
timeout. It can also be a pair (tuple) of
|
|
309
|
+
(connection, read) timeouts.
|
|
310
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
311
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
312
|
+
request; this effectively ignores the
|
|
313
|
+
authentication in the spec for a single request.
|
|
314
|
+
:type _request_auth: dict, optional
|
|
315
|
+
:param _content_type: force content-type for the request.
|
|
316
|
+
:type _content_type: str, Optional
|
|
317
|
+
:param _headers: set to override the headers for a single
|
|
318
|
+
request; this effectively ignores the headers
|
|
319
|
+
in the spec for a single request.
|
|
320
|
+
:type _headers: dict, optional
|
|
321
|
+
:param _host_index: set to override the host_index for a single
|
|
322
|
+
request; this effectively ignores the host_index
|
|
323
|
+
in the spec for a single request.
|
|
324
|
+
:type _host_index: int, optional
|
|
325
|
+
:return: Returns the result object.
|
|
326
|
+
""" # noqa: E501
|
|
327
|
+
|
|
328
|
+
_param = self._list_folder_audit_log_entries_serialize(
|
|
329
|
+
folder_id=folder_id,
|
|
330
|
+
start_time_range=start_time_range,
|
|
331
|
+
end_time_range=end_time_range,
|
|
332
|
+
limit=limit,
|
|
333
|
+
cursor=cursor,
|
|
334
|
+
_request_auth=_request_auth,
|
|
335
|
+
_content_type=_content_type,
|
|
336
|
+
_headers=_headers,
|
|
337
|
+
_host_index=_host_index,
|
|
338
|
+
)
|
|
339
|
+
|
|
340
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
341
|
+
"200": "ListAuditLogEntriesResponse",
|
|
342
|
+
"400": "ErrorResponse",
|
|
343
|
+
"401": "ErrorResponse",
|
|
344
|
+
"404": "ErrorResponse",
|
|
345
|
+
"429": "GatewayErrorResponse",
|
|
346
|
+
}
|
|
347
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
348
|
+
return response_data.response
|
|
349
|
+
|
|
350
|
+
def _list_folder_audit_log_entries_serialize(
|
|
351
|
+
self,
|
|
352
|
+
folder_id,
|
|
353
|
+
start_time_range,
|
|
354
|
+
end_time_range,
|
|
355
|
+
limit,
|
|
356
|
+
cursor,
|
|
357
|
+
_request_auth,
|
|
358
|
+
_content_type,
|
|
359
|
+
_headers,
|
|
360
|
+
_host_index,
|
|
361
|
+
) -> RequestSerialized:
|
|
362
|
+
|
|
363
|
+
_host = None
|
|
364
|
+
|
|
365
|
+
_collection_formats: Dict[str, str] = {}
|
|
366
|
+
|
|
367
|
+
_path_params: Dict[str, str] = {}
|
|
368
|
+
_query_params: List[Tuple[str, str]] = []
|
|
369
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
370
|
+
_form_params: List[Tuple[str, str]] = []
|
|
371
|
+
_files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
|
|
372
|
+
_body_params: Optional[bytes] = None
|
|
373
|
+
|
|
374
|
+
# process the path parameters
|
|
375
|
+
if folder_id is not None:
|
|
376
|
+
_path_params["folderId"] = folder_id
|
|
377
|
+
# process the query parameters
|
|
378
|
+
if start_time_range is not None:
|
|
379
|
+
if isinstance(start_time_range, datetime):
|
|
380
|
+
_query_params.append(
|
|
381
|
+
("start-time-range", start_time_range.strftime(self.api_client.configuration.datetime_format))
|
|
382
|
+
)
|
|
383
|
+
else:
|
|
384
|
+
_query_params.append(("start-time-range", start_time_range))
|
|
385
|
+
|
|
386
|
+
if end_time_range is not None:
|
|
387
|
+
if isinstance(end_time_range, datetime):
|
|
388
|
+
_query_params.append(
|
|
389
|
+
("end-time-range", end_time_range.strftime(self.api_client.configuration.datetime_format))
|
|
390
|
+
)
|
|
391
|
+
else:
|
|
392
|
+
_query_params.append(("end-time-range", end_time_range))
|
|
393
|
+
|
|
394
|
+
if limit is not None:
|
|
395
|
+
|
|
396
|
+
_query_params.append(("limit", limit))
|
|
397
|
+
|
|
398
|
+
if cursor is not None:
|
|
399
|
+
|
|
400
|
+
_query_params.append(("cursor", cursor))
|
|
401
|
+
|
|
402
|
+
# process the header parameters
|
|
403
|
+
# process the form parameters
|
|
404
|
+
# process the body parameter
|
|
405
|
+
|
|
406
|
+
# set the HTTP header `Accept`
|
|
407
|
+
if "Accept" not in _header_params:
|
|
408
|
+
_header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
|
|
409
|
+
|
|
410
|
+
# authentication setting
|
|
411
|
+
_auth_settings: List[str] = []
|
|
412
|
+
|
|
413
|
+
return self.api_client.param_serialize(
|
|
414
|
+
method="GET",
|
|
415
|
+
resource_path="/v2/folders/{folderId}",
|
|
416
|
+
path_params=_path_params,
|
|
417
|
+
query_params=_query_params,
|
|
418
|
+
header_params=_header_params,
|
|
419
|
+
body=_body_params,
|
|
420
|
+
post_params=_form_params,
|
|
421
|
+
files=_files,
|
|
422
|
+
auth_settings=_auth_settings,
|
|
423
|
+
collection_formats=_collection_formats,
|
|
424
|
+
_host=_host,
|
|
425
|
+
_request_auth=_request_auth,
|
|
426
|
+
)
|
|
427
|
+
|
|
428
|
+
@validate_call
|
|
429
|
+
def list_organization_audit_log_entries(
|
|
430
|
+
self,
|
|
431
|
+
organization_id: Annotated[
|
|
432
|
+
StrictStr, Field(description="ID of the organization for which entries should be returned.")
|
|
433
|
+
],
|
|
434
|
+
start_time_range: Annotated[
|
|
435
|
+
datetime,
|
|
436
|
+
Field(
|
|
437
|
+
description="An ISO timestamp to specify the beginning of the time range from which entries should be returned, based on the eventTimeStamp. If not given, defaults to the beginning of time."
|
|
438
|
+
),
|
|
439
|
+
],
|
|
440
|
+
end_time_range: Annotated[
|
|
441
|
+
datetime,
|
|
442
|
+
Field(
|
|
443
|
+
description="An ISO timestamp to specify the end of the time range up until which entries should be returned, based on the eventTimeStamp. If not given, defaults to the time this request was received."
|
|
444
|
+
),
|
|
445
|
+
],
|
|
446
|
+
limit: Annotated[
|
|
447
|
+
Optional[
|
|
448
|
+
Union[
|
|
449
|
+
Annotated[float, Field(le=100, strict=True, ge=1)], Annotated[int, Field(le=100, strict=True, ge=1)]
|
|
450
|
+
]
|
|
451
|
+
],
|
|
452
|
+
Field(
|
|
453
|
+
description="The maximum number of entries to return. If the value exceeds the allowed maximum, the maximum value will be used instead."
|
|
454
|
+
),
|
|
455
|
+
] = None,
|
|
456
|
+
cursor: Annotated[
|
|
457
|
+
Optional[StrictStr],
|
|
458
|
+
Field(
|
|
459
|
+
description="A pagination cursor to load further audit log entries for. May be included in the response of previous calls of the API."
|
|
460
|
+
),
|
|
461
|
+
] = None,
|
|
462
|
+
_request_timeout: Union[
|
|
463
|
+
None,
|
|
464
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
465
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
466
|
+
] = None,
|
|
467
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
468
|
+
_content_type: Optional[StrictStr] = None,
|
|
469
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
470
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
471
|
+
) -> ListAuditLogEntriesResponse:
|
|
472
|
+
"""Organization - Download audit log entries
|
|
473
|
+
|
|
474
|
+
Returns all audit log entries of the organization for the specified period. \\ Period must not be longer than 24 hours within the last 90 days.
|
|
475
|
+
|
|
476
|
+
:param organization_id: ID of the organization for which entries should be returned. (required)
|
|
477
|
+
:type organization_id: str
|
|
478
|
+
:param start_time_range: An ISO timestamp to specify the beginning of the time range from which entries should be returned, based on the eventTimeStamp. If not given, defaults to the beginning of time. (required)
|
|
479
|
+
:type start_time_range: datetime
|
|
480
|
+
:param end_time_range: An ISO timestamp to specify the end of the time range up until which entries should be returned, based on the eventTimeStamp. If not given, defaults to the time this request was received. (required)
|
|
481
|
+
:type end_time_range: datetime
|
|
482
|
+
:param limit: The maximum number of entries to return. If the value exceeds the allowed maximum, the maximum value will be used instead.
|
|
483
|
+
:type limit: float
|
|
484
|
+
:param cursor: A pagination cursor to load further audit log entries for. May be included in the response of previous calls of the API.
|
|
485
|
+
:type cursor: str
|
|
486
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
487
|
+
number provided, it will be total request
|
|
488
|
+
timeout. It can also be a pair (tuple) of
|
|
489
|
+
(connection, read) timeouts.
|
|
490
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
491
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
492
|
+
request; this effectively ignores the
|
|
493
|
+
authentication in the spec for a single request.
|
|
494
|
+
:type _request_auth: dict, optional
|
|
495
|
+
:param _content_type: force content-type for the request.
|
|
496
|
+
:type _content_type: str, Optional
|
|
497
|
+
:param _headers: set to override the headers for a single
|
|
498
|
+
request; this effectively ignores the headers
|
|
499
|
+
in the spec for a single request.
|
|
500
|
+
:type _headers: dict, optional
|
|
501
|
+
:param _host_index: set to override the host_index for a single
|
|
502
|
+
request; this effectively ignores the host_index
|
|
503
|
+
in the spec for a single request.
|
|
504
|
+
:type _host_index: int, optional
|
|
505
|
+
:return: Returns the result object.
|
|
506
|
+
""" # noqa: E501
|
|
507
|
+
|
|
508
|
+
_param = self._list_organization_audit_log_entries_serialize(
|
|
509
|
+
organization_id=organization_id,
|
|
510
|
+
start_time_range=start_time_range,
|
|
511
|
+
end_time_range=end_time_range,
|
|
512
|
+
limit=limit,
|
|
513
|
+
cursor=cursor,
|
|
514
|
+
_request_auth=_request_auth,
|
|
515
|
+
_content_type=_content_type,
|
|
516
|
+
_headers=_headers,
|
|
517
|
+
_host_index=_host_index,
|
|
518
|
+
)
|
|
519
|
+
|
|
520
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
521
|
+
"200": "ListAuditLogEntriesResponse",
|
|
522
|
+
"400": "ErrorResponse",
|
|
523
|
+
"401": "ErrorResponse",
|
|
524
|
+
"404": "ErrorResponse",
|
|
525
|
+
"429": "GatewayErrorResponse",
|
|
526
|
+
}
|
|
527
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
528
|
+
response_data.read()
|
|
529
|
+
return self.api_client.response_deserialize(
|
|
530
|
+
response_data=response_data,
|
|
531
|
+
response_types_map=_response_types_map,
|
|
532
|
+
).data
|
|
533
|
+
|
|
534
|
+
@validate_call
|
|
535
|
+
def list_organization_audit_log_entries_with_http_info(
|
|
536
|
+
self,
|
|
537
|
+
organization_id: Annotated[
|
|
538
|
+
StrictStr, Field(description="ID of the organization for which entries should be returned.")
|
|
539
|
+
],
|
|
540
|
+
start_time_range: Annotated[
|
|
541
|
+
datetime,
|
|
542
|
+
Field(
|
|
543
|
+
description="An ISO timestamp to specify the beginning of the time range from which entries should be returned, based on the eventTimeStamp. If not given, defaults to the beginning of time."
|
|
544
|
+
),
|
|
545
|
+
],
|
|
546
|
+
end_time_range: Annotated[
|
|
547
|
+
datetime,
|
|
548
|
+
Field(
|
|
549
|
+
description="An ISO timestamp to specify the end of the time range up until which entries should be returned, based on the eventTimeStamp. If not given, defaults to the time this request was received."
|
|
550
|
+
),
|
|
551
|
+
],
|
|
552
|
+
limit: Annotated[
|
|
553
|
+
Optional[
|
|
554
|
+
Union[
|
|
555
|
+
Annotated[float, Field(le=100, strict=True, ge=1)], Annotated[int, Field(le=100, strict=True, ge=1)]
|
|
556
|
+
]
|
|
557
|
+
],
|
|
558
|
+
Field(
|
|
559
|
+
description="The maximum number of entries to return. If the value exceeds the allowed maximum, the maximum value will be used instead."
|
|
560
|
+
),
|
|
561
|
+
] = None,
|
|
562
|
+
cursor: Annotated[
|
|
563
|
+
Optional[StrictStr],
|
|
564
|
+
Field(
|
|
565
|
+
description="A pagination cursor to load further audit log entries for. May be included in the response of previous calls of the API."
|
|
566
|
+
),
|
|
567
|
+
] = None,
|
|
568
|
+
_request_timeout: Union[
|
|
569
|
+
None,
|
|
570
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
571
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
572
|
+
] = None,
|
|
573
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
574
|
+
_content_type: Optional[StrictStr] = None,
|
|
575
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
576
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
577
|
+
) -> ApiResponse[ListAuditLogEntriesResponse]:
|
|
578
|
+
"""Organization - Download audit log entries
|
|
579
|
+
|
|
580
|
+
Returns all audit log entries of the organization for the specified period. \\ Period must not be longer than 24 hours within the last 90 days.
|
|
581
|
+
|
|
582
|
+
:param organization_id: ID of the organization for which entries should be returned. (required)
|
|
583
|
+
:type organization_id: str
|
|
584
|
+
:param start_time_range: An ISO timestamp to specify the beginning of the time range from which entries should be returned, based on the eventTimeStamp. If not given, defaults to the beginning of time. (required)
|
|
585
|
+
:type start_time_range: datetime
|
|
586
|
+
:param end_time_range: An ISO timestamp to specify the end of the time range up until which entries should be returned, based on the eventTimeStamp. If not given, defaults to the time this request was received. (required)
|
|
587
|
+
:type end_time_range: datetime
|
|
588
|
+
:param limit: The maximum number of entries to return. If the value exceeds the allowed maximum, the maximum value will be used instead.
|
|
589
|
+
:type limit: float
|
|
590
|
+
:param cursor: A pagination cursor to load further audit log entries for. May be included in the response of previous calls of the API.
|
|
591
|
+
:type cursor: str
|
|
592
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
593
|
+
number provided, it will be total request
|
|
594
|
+
timeout. It can also be a pair (tuple) of
|
|
595
|
+
(connection, read) timeouts.
|
|
596
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
597
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
598
|
+
request; this effectively ignores the
|
|
599
|
+
authentication in the spec for a single request.
|
|
600
|
+
:type _request_auth: dict, optional
|
|
601
|
+
:param _content_type: force content-type for the request.
|
|
602
|
+
:type _content_type: str, Optional
|
|
603
|
+
:param _headers: set to override the headers for a single
|
|
604
|
+
request; this effectively ignores the headers
|
|
605
|
+
in the spec for a single request.
|
|
606
|
+
:type _headers: dict, optional
|
|
607
|
+
:param _host_index: set to override the host_index for a single
|
|
608
|
+
request; this effectively ignores the host_index
|
|
609
|
+
in the spec for a single request.
|
|
610
|
+
:type _host_index: int, optional
|
|
611
|
+
:return: Returns the result object.
|
|
612
|
+
""" # noqa: E501
|
|
613
|
+
|
|
614
|
+
_param = self._list_organization_audit_log_entries_serialize(
|
|
615
|
+
organization_id=organization_id,
|
|
616
|
+
start_time_range=start_time_range,
|
|
617
|
+
end_time_range=end_time_range,
|
|
618
|
+
limit=limit,
|
|
619
|
+
cursor=cursor,
|
|
620
|
+
_request_auth=_request_auth,
|
|
621
|
+
_content_type=_content_type,
|
|
622
|
+
_headers=_headers,
|
|
623
|
+
_host_index=_host_index,
|
|
624
|
+
)
|
|
625
|
+
|
|
626
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
627
|
+
"200": "ListAuditLogEntriesResponse",
|
|
628
|
+
"400": "ErrorResponse",
|
|
629
|
+
"401": "ErrorResponse",
|
|
630
|
+
"404": "ErrorResponse",
|
|
631
|
+
"429": "GatewayErrorResponse",
|
|
632
|
+
}
|
|
633
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
634
|
+
response_data.read()
|
|
635
|
+
return self.api_client.response_deserialize(
|
|
636
|
+
response_data=response_data,
|
|
637
|
+
response_types_map=_response_types_map,
|
|
638
|
+
)
|
|
639
|
+
|
|
640
|
+
@validate_call
|
|
641
|
+
def list_organization_audit_log_entries_without_preload_content(
|
|
642
|
+
self,
|
|
643
|
+
organization_id: Annotated[
|
|
644
|
+
StrictStr, Field(description="ID of the organization for which entries should be returned.")
|
|
645
|
+
],
|
|
646
|
+
start_time_range: Annotated[
|
|
647
|
+
datetime,
|
|
648
|
+
Field(
|
|
649
|
+
description="An ISO timestamp to specify the beginning of the time range from which entries should be returned, based on the eventTimeStamp. If not given, defaults to the beginning of time."
|
|
650
|
+
),
|
|
651
|
+
],
|
|
652
|
+
end_time_range: Annotated[
|
|
653
|
+
datetime,
|
|
654
|
+
Field(
|
|
655
|
+
description="An ISO timestamp to specify the end of the time range up until which entries should be returned, based on the eventTimeStamp. If not given, defaults to the time this request was received."
|
|
656
|
+
),
|
|
657
|
+
],
|
|
658
|
+
limit: Annotated[
|
|
659
|
+
Optional[
|
|
660
|
+
Union[
|
|
661
|
+
Annotated[float, Field(le=100, strict=True, ge=1)], Annotated[int, Field(le=100, strict=True, ge=1)]
|
|
662
|
+
]
|
|
663
|
+
],
|
|
664
|
+
Field(
|
|
665
|
+
description="The maximum number of entries to return. If the value exceeds the allowed maximum, the maximum value will be used instead."
|
|
666
|
+
),
|
|
667
|
+
] = None,
|
|
668
|
+
cursor: Annotated[
|
|
669
|
+
Optional[StrictStr],
|
|
670
|
+
Field(
|
|
671
|
+
description="A pagination cursor to load further audit log entries for. May be included in the response of previous calls of the API."
|
|
672
|
+
),
|
|
673
|
+
] = None,
|
|
674
|
+
_request_timeout: Union[
|
|
675
|
+
None,
|
|
676
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
677
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
678
|
+
] = None,
|
|
679
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
680
|
+
_content_type: Optional[StrictStr] = None,
|
|
681
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
682
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
683
|
+
) -> RESTResponseType:
|
|
684
|
+
"""Organization - Download audit log entries
|
|
685
|
+
|
|
686
|
+
Returns all audit log entries of the organization for the specified period. \\ Period must not be longer than 24 hours within the last 90 days.
|
|
687
|
+
|
|
688
|
+
:param organization_id: ID of the organization for which entries should be returned. (required)
|
|
689
|
+
:type organization_id: str
|
|
690
|
+
:param start_time_range: An ISO timestamp to specify the beginning of the time range from which entries should be returned, based on the eventTimeStamp. If not given, defaults to the beginning of time. (required)
|
|
691
|
+
:type start_time_range: datetime
|
|
692
|
+
:param end_time_range: An ISO timestamp to specify the end of the time range up until which entries should be returned, based on the eventTimeStamp. If not given, defaults to the time this request was received. (required)
|
|
693
|
+
:type end_time_range: datetime
|
|
694
|
+
:param limit: The maximum number of entries to return. If the value exceeds the allowed maximum, the maximum value will be used instead.
|
|
695
|
+
:type limit: float
|
|
696
|
+
:param cursor: A pagination cursor to load further audit log entries for. May be included in the response of previous calls of the API.
|
|
697
|
+
:type cursor: str
|
|
698
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
699
|
+
number provided, it will be total request
|
|
700
|
+
timeout. It can also be a pair (tuple) of
|
|
701
|
+
(connection, read) timeouts.
|
|
702
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
703
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
704
|
+
request; this effectively ignores the
|
|
705
|
+
authentication in the spec for a single request.
|
|
706
|
+
:type _request_auth: dict, optional
|
|
707
|
+
:param _content_type: force content-type for the request.
|
|
708
|
+
:type _content_type: str, Optional
|
|
709
|
+
:param _headers: set to override the headers for a single
|
|
710
|
+
request; this effectively ignores the headers
|
|
711
|
+
in the spec for a single request.
|
|
712
|
+
:type _headers: dict, optional
|
|
713
|
+
:param _host_index: set to override the host_index for a single
|
|
714
|
+
request; this effectively ignores the host_index
|
|
715
|
+
in the spec for a single request.
|
|
716
|
+
:type _host_index: int, optional
|
|
717
|
+
:return: Returns the result object.
|
|
718
|
+
""" # noqa: E501
|
|
719
|
+
|
|
720
|
+
_param = self._list_organization_audit_log_entries_serialize(
|
|
721
|
+
organization_id=organization_id,
|
|
722
|
+
start_time_range=start_time_range,
|
|
723
|
+
end_time_range=end_time_range,
|
|
724
|
+
limit=limit,
|
|
725
|
+
cursor=cursor,
|
|
726
|
+
_request_auth=_request_auth,
|
|
727
|
+
_content_type=_content_type,
|
|
728
|
+
_headers=_headers,
|
|
729
|
+
_host_index=_host_index,
|
|
730
|
+
)
|
|
731
|
+
|
|
732
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
733
|
+
"200": "ListAuditLogEntriesResponse",
|
|
734
|
+
"400": "ErrorResponse",
|
|
735
|
+
"401": "ErrorResponse",
|
|
736
|
+
"404": "ErrorResponse",
|
|
737
|
+
"429": "GatewayErrorResponse",
|
|
738
|
+
}
|
|
739
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
740
|
+
return response_data.response
|
|
741
|
+
|
|
742
|
+
def _list_organization_audit_log_entries_serialize(
|
|
743
|
+
self,
|
|
744
|
+
organization_id,
|
|
745
|
+
start_time_range,
|
|
746
|
+
end_time_range,
|
|
747
|
+
limit,
|
|
748
|
+
cursor,
|
|
749
|
+
_request_auth,
|
|
750
|
+
_content_type,
|
|
751
|
+
_headers,
|
|
752
|
+
_host_index,
|
|
753
|
+
) -> RequestSerialized:
|
|
754
|
+
|
|
755
|
+
_host = None
|
|
756
|
+
|
|
757
|
+
_collection_formats: Dict[str, str] = {}
|
|
758
|
+
|
|
759
|
+
_path_params: Dict[str, str] = {}
|
|
760
|
+
_query_params: List[Tuple[str, str]] = []
|
|
761
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
762
|
+
_form_params: List[Tuple[str, str]] = []
|
|
763
|
+
_files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
|
|
764
|
+
_body_params: Optional[bytes] = None
|
|
765
|
+
|
|
766
|
+
# process the path parameters
|
|
767
|
+
if organization_id is not None:
|
|
768
|
+
_path_params["organizationId"] = organization_id
|
|
769
|
+
# process the query parameters
|
|
770
|
+
if start_time_range is not None:
|
|
771
|
+
if isinstance(start_time_range, datetime):
|
|
772
|
+
_query_params.append(
|
|
773
|
+
("start-time-range", start_time_range.strftime(self.api_client.configuration.datetime_format))
|
|
774
|
+
)
|
|
775
|
+
else:
|
|
776
|
+
_query_params.append(("start-time-range", start_time_range))
|
|
777
|
+
|
|
778
|
+
if end_time_range is not None:
|
|
779
|
+
if isinstance(end_time_range, datetime):
|
|
780
|
+
_query_params.append(
|
|
781
|
+
("end-time-range", end_time_range.strftime(self.api_client.configuration.datetime_format))
|
|
782
|
+
)
|
|
783
|
+
else:
|
|
784
|
+
_query_params.append(("end-time-range", end_time_range))
|
|
785
|
+
|
|
786
|
+
if limit is not None:
|
|
787
|
+
|
|
788
|
+
_query_params.append(("limit", limit))
|
|
789
|
+
|
|
790
|
+
if cursor is not None:
|
|
791
|
+
|
|
792
|
+
_query_params.append(("cursor", cursor))
|
|
793
|
+
|
|
794
|
+
# process the header parameters
|
|
795
|
+
# process the form parameters
|
|
796
|
+
# process the body parameter
|
|
797
|
+
|
|
798
|
+
# set the HTTP header `Accept`
|
|
799
|
+
if "Accept" not in _header_params:
|
|
800
|
+
_header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
|
|
801
|
+
|
|
802
|
+
# authentication setting
|
|
803
|
+
_auth_settings: List[str] = []
|
|
804
|
+
|
|
805
|
+
return self.api_client.param_serialize(
|
|
806
|
+
method="GET",
|
|
807
|
+
resource_path="/v2/organizations/{organizationId}",
|
|
808
|
+
path_params=_path_params,
|
|
809
|
+
query_params=_query_params,
|
|
810
|
+
header_params=_header_params,
|
|
811
|
+
body=_body_params,
|
|
812
|
+
post_params=_form_params,
|
|
813
|
+
files=_files,
|
|
814
|
+
auth_settings=_auth_settings,
|
|
815
|
+
collection_formats=_collection_formats,
|
|
816
|
+
_host=_host,
|
|
817
|
+
_request_auth=_request_auth,
|
|
818
|
+
)
|
|
819
|
+
|
|
820
|
+
@validate_call
|
|
821
|
+
def list_project_audit_log_entries(
|
|
822
|
+
self,
|
|
823
|
+
project_id: Annotated[StrictStr, Field(description="ID of the project for which entries should be returned.")],
|
|
824
|
+
start_time_range: Annotated[
|
|
825
|
+
datetime,
|
|
826
|
+
Field(
|
|
827
|
+
description="An ISO timestamp to specify the beginning of the time range from which entries should be returned, based on the eventTimeStamp. If not given, defaults to the beginning of time."
|
|
828
|
+
),
|
|
829
|
+
],
|
|
830
|
+
end_time_range: Annotated[
|
|
831
|
+
datetime,
|
|
832
|
+
Field(
|
|
833
|
+
description="An ISO timestamp to specify the end of the time range up until which entries should be returned, based on the eventTimeStamp. If not given, defaults to the time this request was received."
|
|
834
|
+
),
|
|
835
|
+
],
|
|
836
|
+
limit: Annotated[
|
|
837
|
+
Optional[
|
|
838
|
+
Union[
|
|
839
|
+
Annotated[float, Field(le=100, strict=True, ge=1)], Annotated[int, Field(le=100, strict=True, ge=1)]
|
|
840
|
+
]
|
|
841
|
+
],
|
|
842
|
+
Field(
|
|
843
|
+
description="The maximum number of entries to return. If the value exceeds the allowed maximum, the maximum value will be used instead."
|
|
844
|
+
),
|
|
845
|
+
] = None,
|
|
846
|
+
cursor: Annotated[
|
|
847
|
+
Optional[StrictStr],
|
|
848
|
+
Field(
|
|
849
|
+
description="A pagination cursor to load further audit log entries for. May be included in the response of previous calls of the API."
|
|
850
|
+
),
|
|
851
|
+
] = None,
|
|
852
|
+
_request_timeout: Union[
|
|
853
|
+
None,
|
|
854
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
855
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
856
|
+
] = None,
|
|
857
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
858
|
+
_content_type: Optional[StrictStr] = None,
|
|
859
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
860
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
861
|
+
) -> ListAuditLogEntriesResponse:
|
|
862
|
+
"""Project - Download audit log entries
|
|
863
|
+
|
|
864
|
+
Returns all audit log entries of the project for the specified period. \\ Period must not be longer than 24 hours within the last 90 days.
|
|
865
|
+
|
|
866
|
+
:param project_id: ID of the project for which entries should be returned. (required)
|
|
867
|
+
:type project_id: str
|
|
868
|
+
:param start_time_range: An ISO timestamp to specify the beginning of the time range from which entries should be returned, based on the eventTimeStamp. If not given, defaults to the beginning of time. (required)
|
|
869
|
+
:type start_time_range: datetime
|
|
870
|
+
:param end_time_range: An ISO timestamp to specify the end of the time range up until which entries should be returned, based on the eventTimeStamp. If not given, defaults to the time this request was received. (required)
|
|
871
|
+
:type end_time_range: datetime
|
|
872
|
+
:param limit: The maximum number of entries to return. If the value exceeds the allowed maximum, the maximum value will be used instead.
|
|
873
|
+
:type limit: float
|
|
874
|
+
:param cursor: A pagination cursor to load further audit log entries for. May be included in the response of previous calls of the API.
|
|
875
|
+
:type cursor: str
|
|
876
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
877
|
+
number provided, it will be total request
|
|
878
|
+
timeout. It can also be a pair (tuple) of
|
|
879
|
+
(connection, read) timeouts.
|
|
880
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
881
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
882
|
+
request; this effectively ignores the
|
|
883
|
+
authentication in the spec for a single request.
|
|
884
|
+
:type _request_auth: dict, optional
|
|
885
|
+
:param _content_type: force content-type for the request.
|
|
886
|
+
:type _content_type: str, Optional
|
|
887
|
+
:param _headers: set to override the headers for a single
|
|
888
|
+
request; this effectively ignores the headers
|
|
889
|
+
in the spec for a single request.
|
|
890
|
+
:type _headers: dict, optional
|
|
891
|
+
:param _host_index: set to override the host_index for a single
|
|
892
|
+
request; this effectively ignores the host_index
|
|
893
|
+
in the spec for a single request.
|
|
894
|
+
:type _host_index: int, optional
|
|
895
|
+
:return: Returns the result object.
|
|
896
|
+
""" # noqa: E501
|
|
897
|
+
|
|
898
|
+
_param = self._list_project_audit_log_entries_serialize(
|
|
899
|
+
project_id=project_id,
|
|
900
|
+
start_time_range=start_time_range,
|
|
901
|
+
end_time_range=end_time_range,
|
|
902
|
+
limit=limit,
|
|
903
|
+
cursor=cursor,
|
|
904
|
+
_request_auth=_request_auth,
|
|
905
|
+
_content_type=_content_type,
|
|
906
|
+
_headers=_headers,
|
|
907
|
+
_host_index=_host_index,
|
|
908
|
+
)
|
|
909
|
+
|
|
910
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
911
|
+
"200": "ListAuditLogEntriesResponse",
|
|
912
|
+
"400": "ErrorResponse",
|
|
913
|
+
"401": "ErrorResponse",
|
|
914
|
+
"404": "ErrorResponse",
|
|
915
|
+
"429": "GatewayErrorResponse",
|
|
916
|
+
}
|
|
917
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
918
|
+
response_data.read()
|
|
919
|
+
return self.api_client.response_deserialize(
|
|
920
|
+
response_data=response_data,
|
|
921
|
+
response_types_map=_response_types_map,
|
|
922
|
+
).data
|
|
923
|
+
|
|
924
|
+
@validate_call
|
|
925
|
+
def list_project_audit_log_entries_with_http_info(
|
|
926
|
+
self,
|
|
927
|
+
project_id: Annotated[StrictStr, Field(description="ID of the project for which entries should be returned.")],
|
|
928
|
+
start_time_range: Annotated[
|
|
929
|
+
datetime,
|
|
930
|
+
Field(
|
|
931
|
+
description="An ISO timestamp to specify the beginning of the time range from which entries should be returned, based on the eventTimeStamp. If not given, defaults to the beginning of time."
|
|
932
|
+
),
|
|
933
|
+
],
|
|
934
|
+
end_time_range: Annotated[
|
|
935
|
+
datetime,
|
|
936
|
+
Field(
|
|
937
|
+
description="An ISO timestamp to specify the end of the time range up until which entries should be returned, based on the eventTimeStamp. If not given, defaults to the time this request was received."
|
|
938
|
+
),
|
|
939
|
+
],
|
|
940
|
+
limit: Annotated[
|
|
941
|
+
Optional[
|
|
942
|
+
Union[
|
|
943
|
+
Annotated[float, Field(le=100, strict=True, ge=1)], Annotated[int, Field(le=100, strict=True, ge=1)]
|
|
944
|
+
]
|
|
945
|
+
],
|
|
946
|
+
Field(
|
|
947
|
+
description="The maximum number of entries to return. If the value exceeds the allowed maximum, the maximum value will be used instead."
|
|
948
|
+
),
|
|
949
|
+
] = None,
|
|
950
|
+
cursor: Annotated[
|
|
951
|
+
Optional[StrictStr],
|
|
952
|
+
Field(
|
|
953
|
+
description="A pagination cursor to load further audit log entries for. May be included in the response of previous calls of the API."
|
|
954
|
+
),
|
|
955
|
+
] = None,
|
|
956
|
+
_request_timeout: Union[
|
|
957
|
+
None,
|
|
958
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
959
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
960
|
+
] = None,
|
|
961
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
962
|
+
_content_type: Optional[StrictStr] = None,
|
|
963
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
964
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
965
|
+
) -> ApiResponse[ListAuditLogEntriesResponse]:
|
|
966
|
+
"""Project - Download audit log entries
|
|
967
|
+
|
|
968
|
+
Returns all audit log entries of the project for the specified period. \\ Period must not be longer than 24 hours within the last 90 days.
|
|
969
|
+
|
|
970
|
+
:param project_id: ID of the project for which entries should be returned. (required)
|
|
971
|
+
:type project_id: str
|
|
972
|
+
:param start_time_range: An ISO timestamp to specify the beginning of the time range from which entries should be returned, based on the eventTimeStamp. If not given, defaults to the beginning of time. (required)
|
|
973
|
+
:type start_time_range: datetime
|
|
974
|
+
:param end_time_range: An ISO timestamp to specify the end of the time range up until which entries should be returned, based on the eventTimeStamp. If not given, defaults to the time this request was received. (required)
|
|
975
|
+
:type end_time_range: datetime
|
|
976
|
+
:param limit: The maximum number of entries to return. If the value exceeds the allowed maximum, the maximum value will be used instead.
|
|
977
|
+
:type limit: float
|
|
978
|
+
:param cursor: A pagination cursor to load further audit log entries for. May be included in the response of previous calls of the API.
|
|
979
|
+
:type cursor: str
|
|
980
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
981
|
+
number provided, it will be total request
|
|
982
|
+
timeout. It can also be a pair (tuple) of
|
|
983
|
+
(connection, read) timeouts.
|
|
984
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
985
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
986
|
+
request; this effectively ignores the
|
|
987
|
+
authentication in the spec for a single request.
|
|
988
|
+
:type _request_auth: dict, optional
|
|
989
|
+
:param _content_type: force content-type for the request.
|
|
990
|
+
:type _content_type: str, Optional
|
|
991
|
+
:param _headers: set to override the headers for a single
|
|
992
|
+
request; this effectively ignores the headers
|
|
993
|
+
in the spec for a single request.
|
|
994
|
+
:type _headers: dict, optional
|
|
995
|
+
:param _host_index: set to override the host_index for a single
|
|
996
|
+
request; this effectively ignores the host_index
|
|
997
|
+
in the spec for a single request.
|
|
998
|
+
:type _host_index: int, optional
|
|
999
|
+
:return: Returns the result object.
|
|
1000
|
+
""" # noqa: E501
|
|
1001
|
+
|
|
1002
|
+
_param = self._list_project_audit_log_entries_serialize(
|
|
1003
|
+
project_id=project_id,
|
|
1004
|
+
start_time_range=start_time_range,
|
|
1005
|
+
end_time_range=end_time_range,
|
|
1006
|
+
limit=limit,
|
|
1007
|
+
cursor=cursor,
|
|
1008
|
+
_request_auth=_request_auth,
|
|
1009
|
+
_content_type=_content_type,
|
|
1010
|
+
_headers=_headers,
|
|
1011
|
+
_host_index=_host_index,
|
|
1012
|
+
)
|
|
1013
|
+
|
|
1014
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1015
|
+
"200": "ListAuditLogEntriesResponse",
|
|
1016
|
+
"400": "ErrorResponse",
|
|
1017
|
+
"401": "ErrorResponse",
|
|
1018
|
+
"404": "ErrorResponse",
|
|
1019
|
+
"429": "GatewayErrorResponse",
|
|
1020
|
+
}
|
|
1021
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
1022
|
+
response_data.read()
|
|
1023
|
+
return self.api_client.response_deserialize(
|
|
1024
|
+
response_data=response_data,
|
|
1025
|
+
response_types_map=_response_types_map,
|
|
1026
|
+
)
|
|
1027
|
+
|
|
1028
|
+
@validate_call
|
|
1029
|
+
def list_project_audit_log_entries_without_preload_content(
|
|
1030
|
+
self,
|
|
1031
|
+
project_id: Annotated[StrictStr, Field(description="ID of the project for which entries should be returned.")],
|
|
1032
|
+
start_time_range: Annotated[
|
|
1033
|
+
datetime,
|
|
1034
|
+
Field(
|
|
1035
|
+
description="An ISO timestamp to specify the beginning of the time range from which entries should be returned, based on the eventTimeStamp. If not given, defaults to the beginning of time."
|
|
1036
|
+
),
|
|
1037
|
+
],
|
|
1038
|
+
end_time_range: Annotated[
|
|
1039
|
+
datetime,
|
|
1040
|
+
Field(
|
|
1041
|
+
description="An ISO timestamp to specify the end of the time range up until which entries should be returned, based on the eventTimeStamp. If not given, defaults to the time this request was received."
|
|
1042
|
+
),
|
|
1043
|
+
],
|
|
1044
|
+
limit: Annotated[
|
|
1045
|
+
Optional[
|
|
1046
|
+
Union[
|
|
1047
|
+
Annotated[float, Field(le=100, strict=True, ge=1)], Annotated[int, Field(le=100, strict=True, ge=1)]
|
|
1048
|
+
]
|
|
1049
|
+
],
|
|
1050
|
+
Field(
|
|
1051
|
+
description="The maximum number of entries to return. If the value exceeds the allowed maximum, the maximum value will be used instead."
|
|
1052
|
+
),
|
|
1053
|
+
] = None,
|
|
1054
|
+
cursor: Annotated[
|
|
1055
|
+
Optional[StrictStr],
|
|
1056
|
+
Field(
|
|
1057
|
+
description="A pagination cursor to load further audit log entries for. May be included in the response of previous calls of the API."
|
|
1058
|
+
),
|
|
1059
|
+
] = None,
|
|
1060
|
+
_request_timeout: Union[
|
|
1061
|
+
None,
|
|
1062
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1063
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
1064
|
+
] = None,
|
|
1065
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1066
|
+
_content_type: Optional[StrictStr] = None,
|
|
1067
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1068
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1069
|
+
) -> RESTResponseType:
|
|
1070
|
+
"""Project - Download audit log entries
|
|
1071
|
+
|
|
1072
|
+
Returns all audit log entries of the project for the specified period. \\ Period must not be longer than 24 hours within the last 90 days.
|
|
1073
|
+
|
|
1074
|
+
:param project_id: ID of the project for which entries should be returned. (required)
|
|
1075
|
+
:type project_id: str
|
|
1076
|
+
:param start_time_range: An ISO timestamp to specify the beginning of the time range from which entries should be returned, based on the eventTimeStamp. If not given, defaults to the beginning of time. (required)
|
|
1077
|
+
:type start_time_range: datetime
|
|
1078
|
+
:param end_time_range: An ISO timestamp to specify the end of the time range up until which entries should be returned, based on the eventTimeStamp. If not given, defaults to the time this request was received. (required)
|
|
1079
|
+
:type end_time_range: datetime
|
|
1080
|
+
:param limit: The maximum number of entries to return. If the value exceeds the allowed maximum, the maximum value will be used instead.
|
|
1081
|
+
:type limit: float
|
|
1082
|
+
:param cursor: A pagination cursor to load further audit log entries for. May be included in the response of previous calls of the API.
|
|
1083
|
+
:type cursor: str
|
|
1084
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1085
|
+
number provided, it will be total request
|
|
1086
|
+
timeout. It can also be a pair (tuple) of
|
|
1087
|
+
(connection, read) timeouts.
|
|
1088
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1089
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1090
|
+
request; this effectively ignores the
|
|
1091
|
+
authentication in the spec for a single request.
|
|
1092
|
+
:type _request_auth: dict, optional
|
|
1093
|
+
:param _content_type: force content-type for the request.
|
|
1094
|
+
:type _content_type: str, Optional
|
|
1095
|
+
:param _headers: set to override the headers for a single
|
|
1096
|
+
request; this effectively ignores the headers
|
|
1097
|
+
in the spec for a single request.
|
|
1098
|
+
:type _headers: dict, optional
|
|
1099
|
+
:param _host_index: set to override the host_index for a single
|
|
1100
|
+
request; this effectively ignores the host_index
|
|
1101
|
+
in the spec for a single request.
|
|
1102
|
+
:type _host_index: int, optional
|
|
1103
|
+
:return: Returns the result object.
|
|
1104
|
+
""" # noqa: E501
|
|
1105
|
+
|
|
1106
|
+
_param = self._list_project_audit_log_entries_serialize(
|
|
1107
|
+
project_id=project_id,
|
|
1108
|
+
start_time_range=start_time_range,
|
|
1109
|
+
end_time_range=end_time_range,
|
|
1110
|
+
limit=limit,
|
|
1111
|
+
cursor=cursor,
|
|
1112
|
+
_request_auth=_request_auth,
|
|
1113
|
+
_content_type=_content_type,
|
|
1114
|
+
_headers=_headers,
|
|
1115
|
+
_host_index=_host_index,
|
|
1116
|
+
)
|
|
1117
|
+
|
|
1118
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1119
|
+
"200": "ListAuditLogEntriesResponse",
|
|
1120
|
+
"400": "ErrorResponse",
|
|
1121
|
+
"401": "ErrorResponse",
|
|
1122
|
+
"404": "ErrorResponse",
|
|
1123
|
+
"429": "GatewayErrorResponse",
|
|
1124
|
+
}
|
|
1125
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
1126
|
+
return response_data.response
|
|
1127
|
+
|
|
1128
|
+
def _list_project_audit_log_entries_serialize(
|
|
1129
|
+
self,
|
|
1130
|
+
project_id,
|
|
1131
|
+
start_time_range,
|
|
1132
|
+
end_time_range,
|
|
1133
|
+
limit,
|
|
1134
|
+
cursor,
|
|
1135
|
+
_request_auth,
|
|
1136
|
+
_content_type,
|
|
1137
|
+
_headers,
|
|
1138
|
+
_host_index,
|
|
1139
|
+
) -> RequestSerialized:
|
|
1140
|
+
|
|
1141
|
+
_host = None
|
|
1142
|
+
|
|
1143
|
+
_collection_formats: Dict[str, str] = {}
|
|
1144
|
+
|
|
1145
|
+
_path_params: Dict[str, str] = {}
|
|
1146
|
+
_query_params: List[Tuple[str, str]] = []
|
|
1147
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
1148
|
+
_form_params: List[Tuple[str, str]] = []
|
|
1149
|
+
_files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
|
|
1150
|
+
_body_params: Optional[bytes] = None
|
|
1151
|
+
|
|
1152
|
+
# process the path parameters
|
|
1153
|
+
if project_id is not None:
|
|
1154
|
+
_path_params["projectId"] = project_id
|
|
1155
|
+
# process the query parameters
|
|
1156
|
+
if start_time_range is not None:
|
|
1157
|
+
if isinstance(start_time_range, datetime):
|
|
1158
|
+
_query_params.append(
|
|
1159
|
+
("start-time-range", start_time_range.strftime(self.api_client.configuration.datetime_format))
|
|
1160
|
+
)
|
|
1161
|
+
else:
|
|
1162
|
+
_query_params.append(("start-time-range", start_time_range))
|
|
1163
|
+
|
|
1164
|
+
if end_time_range is not None:
|
|
1165
|
+
if isinstance(end_time_range, datetime):
|
|
1166
|
+
_query_params.append(
|
|
1167
|
+
("end-time-range", end_time_range.strftime(self.api_client.configuration.datetime_format))
|
|
1168
|
+
)
|
|
1169
|
+
else:
|
|
1170
|
+
_query_params.append(("end-time-range", end_time_range))
|
|
1171
|
+
|
|
1172
|
+
if limit is not None:
|
|
1173
|
+
|
|
1174
|
+
_query_params.append(("limit", limit))
|
|
1175
|
+
|
|
1176
|
+
if cursor is not None:
|
|
1177
|
+
|
|
1178
|
+
_query_params.append(("cursor", cursor))
|
|
1179
|
+
|
|
1180
|
+
# process the header parameters
|
|
1181
|
+
# process the form parameters
|
|
1182
|
+
# process the body parameter
|
|
1183
|
+
|
|
1184
|
+
# set the HTTP header `Accept`
|
|
1185
|
+
if "Accept" not in _header_params:
|
|
1186
|
+
_header_params["Accept"] = self.api_client.select_header_accept(["application/json"])
|
|
1187
|
+
|
|
1188
|
+
# authentication setting
|
|
1189
|
+
_auth_settings: List[str] = []
|
|
1190
|
+
|
|
1191
|
+
return self.api_client.param_serialize(
|
|
1192
|
+
method="GET",
|
|
1193
|
+
resource_path="/v2/projects/{projectId}",
|
|
1194
|
+
path_params=_path_params,
|
|
1195
|
+
query_params=_query_params,
|
|
1196
|
+
header_params=_header_params,
|
|
1197
|
+
body=_body_params,
|
|
1198
|
+
post_params=_form_params,
|
|
1199
|
+
files=_files,
|
|
1200
|
+
auth_settings=_auth_settings,
|
|
1201
|
+
collection_formats=_collection_formats,
|
|
1202
|
+
_host=_host,
|
|
1203
|
+
_request_auth=_request_auth,
|
|
1204
|
+
)
|