gcore 0.5.0__py3-none-any.whl → 0.6.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.
Potentially problematic release.
This version of gcore might be problematic. Click here for more details.
- gcore/_version.py +1 -1
- gcore/resources/cloud/__init__.py +14 -0
- gcore/resources/cloud/audit_logs.py +480 -0
- gcore/resources/cloud/cloud.py +32 -0
- gcore/resources/cloud/file_shares/file_shares.py +64 -9
- gcore/resources/cloud/inference/__init__.py +14 -0
- gcore/resources/cloud/inference/api_keys.py +621 -0
- gcore/resources/cloud/inference/inference.py +32 -0
- gcore/resources/cloud/load_balancers/pools/members.py +22 -6
- gcore/types/cloud/__init__.py +2 -0
- gcore/types/cloud/audit_log_entry.py +254 -0
- gcore/types/cloud/audit_log_list_params.py +158 -0
- gcore/types/cloud/file_share_update_params.py +29 -3
- gcore/types/cloud/inference/__init__.py +5 -0
- gcore/types/cloud/inference/api_key_create_params.py +21 -0
- gcore/types/cloud/inference/api_key_list_params.py +21 -0
- gcore/types/cloud/inference/api_key_update_params.py +16 -0
- gcore/types/cloud/inference/inference_api_key.py +24 -0
- gcore/types/cloud/inference/inference_api_key_create.py +27 -0
- gcore/types/cloud/load_balancer_create_params.py +14 -3
- gcore/types/cloud/load_balancers/pool_create_params.py +14 -3
- gcore/types/cloud/load_balancers/pool_update_params.py +14 -3
- gcore/types/cloud/load_balancers/pools/member_add_params.py +14 -3
- gcore/types/cloud/member.py +12 -4
- {gcore-0.5.0.dist-info → gcore-0.6.0.dist-info}/METADATA +2 -3
- {gcore-0.5.0.dist-info → gcore-0.6.0.dist-info}/RECORD +28 -19
- {gcore-0.5.0.dist-info → gcore-0.6.0.dist-info}/WHEEL +0 -0
- {gcore-0.5.0.dist-info → gcore-0.6.0.dist-info}/licenses/LICENSE +0 -0
gcore/_version.py
CHANGED
|
@@ -112,6 +112,14 @@ from .ip_ranges import (
|
|
|
112
112
|
IPRangesResourceWithStreamingResponse,
|
|
113
113
|
AsyncIPRangesResourceWithStreamingResponse,
|
|
114
114
|
)
|
|
115
|
+
from .audit_logs import (
|
|
116
|
+
AuditLogsResource,
|
|
117
|
+
AsyncAuditLogsResource,
|
|
118
|
+
AuditLogsResourceWithRawResponse,
|
|
119
|
+
AsyncAuditLogsResourceWithRawResponse,
|
|
120
|
+
AuditLogsResourceWithStreamingResponse,
|
|
121
|
+
AsyncAuditLogsResourceWithStreamingResponse,
|
|
122
|
+
)
|
|
115
123
|
from .registries import (
|
|
116
124
|
RegistriesResource,
|
|
117
125
|
AsyncRegistriesResource,
|
|
@@ -318,6 +326,12 @@ __all__ = [
|
|
|
318
326
|
"AsyncInstancesResourceWithRawResponse",
|
|
319
327
|
"InstancesResourceWithStreamingResponse",
|
|
320
328
|
"AsyncInstancesResourceWithStreamingResponse",
|
|
329
|
+
"AuditLogsResource",
|
|
330
|
+
"AsyncAuditLogsResource",
|
|
331
|
+
"AuditLogsResourceWithRawResponse",
|
|
332
|
+
"AsyncAuditLogsResourceWithRawResponse",
|
|
333
|
+
"AuditLogsResourceWithStreamingResponse",
|
|
334
|
+
"AsyncAuditLogsResourceWithStreamingResponse",
|
|
321
335
|
"CloudResource",
|
|
322
336
|
"AsyncCloudResource",
|
|
323
337
|
"CloudResourceWithRawResponse",
|
|
@@ -0,0 +1,480 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import List, Union, Iterable
|
|
6
|
+
from datetime import datetime
|
|
7
|
+
from typing_extensions import Literal
|
|
8
|
+
|
|
9
|
+
import httpx
|
|
10
|
+
|
|
11
|
+
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
|
12
|
+
from ..._utils import maybe_transform
|
|
13
|
+
from ..._compat import cached_property
|
|
14
|
+
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
15
|
+
from ..._response import (
|
|
16
|
+
to_raw_response_wrapper,
|
|
17
|
+
to_streamed_response_wrapper,
|
|
18
|
+
async_to_raw_response_wrapper,
|
|
19
|
+
async_to_streamed_response_wrapper,
|
|
20
|
+
)
|
|
21
|
+
from ...pagination import SyncOffsetPage, AsyncOffsetPage
|
|
22
|
+
from ...types.cloud import audit_log_list_params
|
|
23
|
+
from ..._base_client import AsyncPaginator, make_request_options
|
|
24
|
+
from ...types.cloud.audit_log_entry import AuditLogEntry
|
|
25
|
+
|
|
26
|
+
__all__ = ["AuditLogsResource", "AsyncAuditLogsResource"]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class AuditLogsResource(SyncAPIResource):
|
|
30
|
+
@cached_property
|
|
31
|
+
def with_raw_response(self) -> AuditLogsResourceWithRawResponse:
|
|
32
|
+
"""
|
|
33
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
34
|
+
the raw response object instead of the parsed content.
|
|
35
|
+
|
|
36
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
37
|
+
"""
|
|
38
|
+
return AuditLogsResourceWithRawResponse(self)
|
|
39
|
+
|
|
40
|
+
@cached_property
|
|
41
|
+
def with_streaming_response(self) -> AuditLogsResourceWithStreamingResponse:
|
|
42
|
+
"""
|
|
43
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
44
|
+
|
|
45
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
46
|
+
"""
|
|
47
|
+
return AuditLogsResourceWithStreamingResponse(self)
|
|
48
|
+
|
|
49
|
+
def list(
|
|
50
|
+
self,
|
|
51
|
+
*,
|
|
52
|
+
action_type: List[
|
|
53
|
+
Literal[
|
|
54
|
+
"activate",
|
|
55
|
+
"attach",
|
|
56
|
+
"change_logging_resources",
|
|
57
|
+
"create",
|
|
58
|
+
"create_access_rule",
|
|
59
|
+
"deactivate",
|
|
60
|
+
"delete",
|
|
61
|
+
"delete_access_rule",
|
|
62
|
+
"delete_metadata",
|
|
63
|
+
"detach",
|
|
64
|
+
"disable_logging",
|
|
65
|
+
"disable_portsecurity",
|
|
66
|
+
"download",
|
|
67
|
+
"enable_logging",
|
|
68
|
+
"enable_portsecurity",
|
|
69
|
+
"failover",
|
|
70
|
+
"put_into_servergroup",
|
|
71
|
+
"reboot",
|
|
72
|
+
"reboot_hard",
|
|
73
|
+
"rebuild",
|
|
74
|
+
"regenerate_credentials",
|
|
75
|
+
"remove_from_servergroup",
|
|
76
|
+
"replace_metadata",
|
|
77
|
+
"resize",
|
|
78
|
+
"resume",
|
|
79
|
+
"retype",
|
|
80
|
+
"revert",
|
|
81
|
+
"scale_down",
|
|
82
|
+
"scale_up",
|
|
83
|
+
"start",
|
|
84
|
+
"stop",
|
|
85
|
+
"suspend",
|
|
86
|
+
"update",
|
|
87
|
+
"update_metadata",
|
|
88
|
+
"upgrade",
|
|
89
|
+
]
|
|
90
|
+
]
|
|
91
|
+
| NotGiven = NOT_GIVEN,
|
|
92
|
+
api_group: List[
|
|
93
|
+
Literal[
|
|
94
|
+
"ai_cluster",
|
|
95
|
+
"backup_service",
|
|
96
|
+
"caas_container",
|
|
97
|
+
"caas_key",
|
|
98
|
+
"caas_pull_secret",
|
|
99
|
+
"dbaas_postgres",
|
|
100
|
+
"ddos_profile",
|
|
101
|
+
"faas_function",
|
|
102
|
+
"faas_key",
|
|
103
|
+
"faas_namespace",
|
|
104
|
+
"file_shares",
|
|
105
|
+
"floating_ip",
|
|
106
|
+
"image",
|
|
107
|
+
"inference_at_the_edge",
|
|
108
|
+
"instance",
|
|
109
|
+
"instance_isolation",
|
|
110
|
+
"k8s_cluster",
|
|
111
|
+
"k8s_cluster_template",
|
|
112
|
+
"k8s_pool",
|
|
113
|
+
"laas",
|
|
114
|
+
"laas_topic",
|
|
115
|
+
"lb_health_monitor",
|
|
116
|
+
"lb_l7policy",
|
|
117
|
+
"lb_l7rule",
|
|
118
|
+
"lblistener",
|
|
119
|
+
"lbpool",
|
|
120
|
+
"lbpool_member",
|
|
121
|
+
"lifecycle_policy",
|
|
122
|
+
"lifecycle_policy_volume_member",
|
|
123
|
+
"loadbalancer",
|
|
124
|
+
"network",
|
|
125
|
+
"port",
|
|
126
|
+
"project",
|
|
127
|
+
"quota_limit_request",
|
|
128
|
+
"registry",
|
|
129
|
+
"reservation",
|
|
130
|
+
"reserved_fixed_ip",
|
|
131
|
+
"role",
|
|
132
|
+
"router",
|
|
133
|
+
"secret",
|
|
134
|
+
"securitygroup",
|
|
135
|
+
"securitygrouprule",
|
|
136
|
+
"servergroup",
|
|
137
|
+
"shared_flavor",
|
|
138
|
+
"shared_image",
|
|
139
|
+
"shared_network",
|
|
140
|
+
"snapshot",
|
|
141
|
+
"snapshot_schedule",
|
|
142
|
+
"ssh_key",
|
|
143
|
+
"subnet",
|
|
144
|
+
"user",
|
|
145
|
+
"vip_ip_addresses",
|
|
146
|
+
"volume",
|
|
147
|
+
]
|
|
148
|
+
]
|
|
149
|
+
| NotGiven = NOT_GIVEN,
|
|
150
|
+
from_timestamp: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
|
151
|
+
limit: int | NotGiven = NOT_GIVEN,
|
|
152
|
+
offset: int | NotGiven = NOT_GIVEN,
|
|
153
|
+
order_by: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
|
|
154
|
+
project_id: Iterable[int] | NotGiven = NOT_GIVEN,
|
|
155
|
+
region_id: Iterable[int] | NotGiven = NOT_GIVEN,
|
|
156
|
+
resource_id: List[str] | NotGiven = NOT_GIVEN,
|
|
157
|
+
search_field: str | NotGiven = NOT_GIVEN,
|
|
158
|
+
sorting: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
|
|
159
|
+
to_timestamp: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
|
160
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
161
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
162
|
+
extra_headers: Headers | None = None,
|
|
163
|
+
extra_query: Query | None = None,
|
|
164
|
+
extra_body: Body | None = None,
|
|
165
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
166
|
+
) -> SyncOffsetPage[AuditLogEntry]:
|
|
167
|
+
"""
|
|
168
|
+
Retrieve user action log for one client or a set of projects
|
|
169
|
+
|
|
170
|
+
Args:
|
|
171
|
+
action_type: User action type. Several options can be specified.
|
|
172
|
+
|
|
173
|
+
api_group: API group that requested action belongs to. Several options can be specified.
|
|
174
|
+
|
|
175
|
+
from_timestamp: ISO formatted datetime string. Starting timestamp from which user actions are
|
|
176
|
+
requested
|
|
177
|
+
|
|
178
|
+
limit: Optional. Limit the number of returned items
|
|
179
|
+
|
|
180
|
+
offset: Optional. Offset value is used to exclude the first set of records from the
|
|
181
|
+
result
|
|
182
|
+
|
|
183
|
+
order_by: Sorting by timestamp. Oldest first, or most recent first
|
|
184
|
+
|
|
185
|
+
project_id: Project ID. Several options can be specified.
|
|
186
|
+
|
|
187
|
+
region_id: Region ID. Several options can be specified.
|
|
188
|
+
|
|
189
|
+
resource_id: Resource ID. Several options can be specified.
|
|
190
|
+
|
|
191
|
+
search_field: Extra search field for common object properties such as name, IP address, or
|
|
192
|
+
other, depending on the `resource_type`
|
|
193
|
+
|
|
194
|
+
sorting: (DEPRECATED Use '`order_by`' instead) Sorting by timestamp. Oldest first, or
|
|
195
|
+
most recent first
|
|
196
|
+
|
|
197
|
+
to_timestamp: ISO formatted datetime string. Ending timestamp until which user actions are
|
|
198
|
+
requested
|
|
199
|
+
|
|
200
|
+
extra_headers: Send extra headers
|
|
201
|
+
|
|
202
|
+
extra_query: Add additional query parameters to the request
|
|
203
|
+
|
|
204
|
+
extra_body: Add additional JSON properties to the request
|
|
205
|
+
|
|
206
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
207
|
+
"""
|
|
208
|
+
return self._get_api_list(
|
|
209
|
+
"/cloud/v1/user_actions",
|
|
210
|
+
page=SyncOffsetPage[AuditLogEntry],
|
|
211
|
+
options=make_request_options(
|
|
212
|
+
extra_headers=extra_headers,
|
|
213
|
+
extra_query=extra_query,
|
|
214
|
+
extra_body=extra_body,
|
|
215
|
+
timeout=timeout,
|
|
216
|
+
query=maybe_transform(
|
|
217
|
+
{
|
|
218
|
+
"action_type": action_type,
|
|
219
|
+
"api_group": api_group,
|
|
220
|
+
"from_timestamp": from_timestamp,
|
|
221
|
+
"limit": limit,
|
|
222
|
+
"offset": offset,
|
|
223
|
+
"order_by": order_by,
|
|
224
|
+
"project_id": project_id,
|
|
225
|
+
"region_id": region_id,
|
|
226
|
+
"resource_id": resource_id,
|
|
227
|
+
"search_field": search_field,
|
|
228
|
+
"sorting": sorting,
|
|
229
|
+
"to_timestamp": to_timestamp,
|
|
230
|
+
},
|
|
231
|
+
audit_log_list_params.AuditLogListParams,
|
|
232
|
+
),
|
|
233
|
+
),
|
|
234
|
+
model=AuditLogEntry,
|
|
235
|
+
)
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
class AsyncAuditLogsResource(AsyncAPIResource):
|
|
239
|
+
@cached_property
|
|
240
|
+
def with_raw_response(self) -> AsyncAuditLogsResourceWithRawResponse:
|
|
241
|
+
"""
|
|
242
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
243
|
+
the raw response object instead of the parsed content.
|
|
244
|
+
|
|
245
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
246
|
+
"""
|
|
247
|
+
return AsyncAuditLogsResourceWithRawResponse(self)
|
|
248
|
+
|
|
249
|
+
@cached_property
|
|
250
|
+
def with_streaming_response(self) -> AsyncAuditLogsResourceWithStreamingResponse:
|
|
251
|
+
"""
|
|
252
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
253
|
+
|
|
254
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
255
|
+
"""
|
|
256
|
+
return AsyncAuditLogsResourceWithStreamingResponse(self)
|
|
257
|
+
|
|
258
|
+
def list(
|
|
259
|
+
self,
|
|
260
|
+
*,
|
|
261
|
+
action_type: List[
|
|
262
|
+
Literal[
|
|
263
|
+
"activate",
|
|
264
|
+
"attach",
|
|
265
|
+
"change_logging_resources",
|
|
266
|
+
"create",
|
|
267
|
+
"create_access_rule",
|
|
268
|
+
"deactivate",
|
|
269
|
+
"delete",
|
|
270
|
+
"delete_access_rule",
|
|
271
|
+
"delete_metadata",
|
|
272
|
+
"detach",
|
|
273
|
+
"disable_logging",
|
|
274
|
+
"disable_portsecurity",
|
|
275
|
+
"download",
|
|
276
|
+
"enable_logging",
|
|
277
|
+
"enable_portsecurity",
|
|
278
|
+
"failover",
|
|
279
|
+
"put_into_servergroup",
|
|
280
|
+
"reboot",
|
|
281
|
+
"reboot_hard",
|
|
282
|
+
"rebuild",
|
|
283
|
+
"regenerate_credentials",
|
|
284
|
+
"remove_from_servergroup",
|
|
285
|
+
"replace_metadata",
|
|
286
|
+
"resize",
|
|
287
|
+
"resume",
|
|
288
|
+
"retype",
|
|
289
|
+
"revert",
|
|
290
|
+
"scale_down",
|
|
291
|
+
"scale_up",
|
|
292
|
+
"start",
|
|
293
|
+
"stop",
|
|
294
|
+
"suspend",
|
|
295
|
+
"update",
|
|
296
|
+
"update_metadata",
|
|
297
|
+
"upgrade",
|
|
298
|
+
]
|
|
299
|
+
]
|
|
300
|
+
| NotGiven = NOT_GIVEN,
|
|
301
|
+
api_group: List[
|
|
302
|
+
Literal[
|
|
303
|
+
"ai_cluster",
|
|
304
|
+
"backup_service",
|
|
305
|
+
"caas_container",
|
|
306
|
+
"caas_key",
|
|
307
|
+
"caas_pull_secret",
|
|
308
|
+
"dbaas_postgres",
|
|
309
|
+
"ddos_profile",
|
|
310
|
+
"faas_function",
|
|
311
|
+
"faas_key",
|
|
312
|
+
"faas_namespace",
|
|
313
|
+
"file_shares",
|
|
314
|
+
"floating_ip",
|
|
315
|
+
"image",
|
|
316
|
+
"inference_at_the_edge",
|
|
317
|
+
"instance",
|
|
318
|
+
"instance_isolation",
|
|
319
|
+
"k8s_cluster",
|
|
320
|
+
"k8s_cluster_template",
|
|
321
|
+
"k8s_pool",
|
|
322
|
+
"laas",
|
|
323
|
+
"laas_topic",
|
|
324
|
+
"lb_health_monitor",
|
|
325
|
+
"lb_l7policy",
|
|
326
|
+
"lb_l7rule",
|
|
327
|
+
"lblistener",
|
|
328
|
+
"lbpool",
|
|
329
|
+
"lbpool_member",
|
|
330
|
+
"lifecycle_policy",
|
|
331
|
+
"lifecycle_policy_volume_member",
|
|
332
|
+
"loadbalancer",
|
|
333
|
+
"network",
|
|
334
|
+
"port",
|
|
335
|
+
"project",
|
|
336
|
+
"quota_limit_request",
|
|
337
|
+
"registry",
|
|
338
|
+
"reservation",
|
|
339
|
+
"reserved_fixed_ip",
|
|
340
|
+
"role",
|
|
341
|
+
"router",
|
|
342
|
+
"secret",
|
|
343
|
+
"securitygroup",
|
|
344
|
+
"securitygrouprule",
|
|
345
|
+
"servergroup",
|
|
346
|
+
"shared_flavor",
|
|
347
|
+
"shared_image",
|
|
348
|
+
"shared_network",
|
|
349
|
+
"snapshot",
|
|
350
|
+
"snapshot_schedule",
|
|
351
|
+
"ssh_key",
|
|
352
|
+
"subnet",
|
|
353
|
+
"user",
|
|
354
|
+
"vip_ip_addresses",
|
|
355
|
+
"volume",
|
|
356
|
+
]
|
|
357
|
+
]
|
|
358
|
+
| NotGiven = NOT_GIVEN,
|
|
359
|
+
from_timestamp: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
|
360
|
+
limit: int | NotGiven = NOT_GIVEN,
|
|
361
|
+
offset: int | NotGiven = NOT_GIVEN,
|
|
362
|
+
order_by: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
|
|
363
|
+
project_id: Iterable[int] | NotGiven = NOT_GIVEN,
|
|
364
|
+
region_id: Iterable[int] | NotGiven = NOT_GIVEN,
|
|
365
|
+
resource_id: List[str] | NotGiven = NOT_GIVEN,
|
|
366
|
+
search_field: str | NotGiven = NOT_GIVEN,
|
|
367
|
+
sorting: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
|
|
368
|
+
to_timestamp: Union[str, datetime] | NotGiven = NOT_GIVEN,
|
|
369
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
370
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
371
|
+
extra_headers: Headers | None = None,
|
|
372
|
+
extra_query: Query | None = None,
|
|
373
|
+
extra_body: Body | None = None,
|
|
374
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
375
|
+
) -> AsyncPaginator[AuditLogEntry, AsyncOffsetPage[AuditLogEntry]]:
|
|
376
|
+
"""
|
|
377
|
+
Retrieve user action log for one client or a set of projects
|
|
378
|
+
|
|
379
|
+
Args:
|
|
380
|
+
action_type: User action type. Several options can be specified.
|
|
381
|
+
|
|
382
|
+
api_group: API group that requested action belongs to. Several options can be specified.
|
|
383
|
+
|
|
384
|
+
from_timestamp: ISO formatted datetime string. Starting timestamp from which user actions are
|
|
385
|
+
requested
|
|
386
|
+
|
|
387
|
+
limit: Optional. Limit the number of returned items
|
|
388
|
+
|
|
389
|
+
offset: Optional. Offset value is used to exclude the first set of records from the
|
|
390
|
+
result
|
|
391
|
+
|
|
392
|
+
order_by: Sorting by timestamp. Oldest first, or most recent first
|
|
393
|
+
|
|
394
|
+
project_id: Project ID. Several options can be specified.
|
|
395
|
+
|
|
396
|
+
region_id: Region ID. Several options can be specified.
|
|
397
|
+
|
|
398
|
+
resource_id: Resource ID. Several options can be specified.
|
|
399
|
+
|
|
400
|
+
search_field: Extra search field for common object properties such as name, IP address, or
|
|
401
|
+
other, depending on the `resource_type`
|
|
402
|
+
|
|
403
|
+
sorting: (DEPRECATED Use '`order_by`' instead) Sorting by timestamp. Oldest first, or
|
|
404
|
+
most recent first
|
|
405
|
+
|
|
406
|
+
to_timestamp: ISO formatted datetime string. Ending timestamp until which user actions are
|
|
407
|
+
requested
|
|
408
|
+
|
|
409
|
+
extra_headers: Send extra headers
|
|
410
|
+
|
|
411
|
+
extra_query: Add additional query parameters to the request
|
|
412
|
+
|
|
413
|
+
extra_body: Add additional JSON properties to the request
|
|
414
|
+
|
|
415
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
416
|
+
"""
|
|
417
|
+
return self._get_api_list(
|
|
418
|
+
"/cloud/v1/user_actions",
|
|
419
|
+
page=AsyncOffsetPage[AuditLogEntry],
|
|
420
|
+
options=make_request_options(
|
|
421
|
+
extra_headers=extra_headers,
|
|
422
|
+
extra_query=extra_query,
|
|
423
|
+
extra_body=extra_body,
|
|
424
|
+
timeout=timeout,
|
|
425
|
+
query=maybe_transform(
|
|
426
|
+
{
|
|
427
|
+
"action_type": action_type,
|
|
428
|
+
"api_group": api_group,
|
|
429
|
+
"from_timestamp": from_timestamp,
|
|
430
|
+
"limit": limit,
|
|
431
|
+
"offset": offset,
|
|
432
|
+
"order_by": order_by,
|
|
433
|
+
"project_id": project_id,
|
|
434
|
+
"region_id": region_id,
|
|
435
|
+
"resource_id": resource_id,
|
|
436
|
+
"search_field": search_field,
|
|
437
|
+
"sorting": sorting,
|
|
438
|
+
"to_timestamp": to_timestamp,
|
|
439
|
+
},
|
|
440
|
+
audit_log_list_params.AuditLogListParams,
|
|
441
|
+
),
|
|
442
|
+
),
|
|
443
|
+
model=AuditLogEntry,
|
|
444
|
+
)
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
class AuditLogsResourceWithRawResponse:
|
|
448
|
+
def __init__(self, audit_logs: AuditLogsResource) -> None:
|
|
449
|
+
self._audit_logs = audit_logs
|
|
450
|
+
|
|
451
|
+
self.list = to_raw_response_wrapper(
|
|
452
|
+
audit_logs.list,
|
|
453
|
+
)
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
class AsyncAuditLogsResourceWithRawResponse:
|
|
457
|
+
def __init__(self, audit_logs: AsyncAuditLogsResource) -> None:
|
|
458
|
+
self._audit_logs = audit_logs
|
|
459
|
+
|
|
460
|
+
self.list = async_to_raw_response_wrapper(
|
|
461
|
+
audit_logs.list,
|
|
462
|
+
)
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
class AuditLogsResourceWithStreamingResponse:
|
|
466
|
+
def __init__(self, audit_logs: AuditLogsResource) -> None:
|
|
467
|
+
self._audit_logs = audit_logs
|
|
468
|
+
|
|
469
|
+
self.list = to_streamed_response_wrapper(
|
|
470
|
+
audit_logs.list,
|
|
471
|
+
)
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
class AsyncAuditLogsResourceWithStreamingResponse:
|
|
475
|
+
def __init__(self, audit_logs: AsyncAuditLogsResource) -> None:
|
|
476
|
+
self._audit_logs = audit_logs
|
|
477
|
+
|
|
478
|
+
self.list = async_to_streamed_response_wrapper(
|
|
479
|
+
audit_logs.list,
|
|
480
|
+
)
|
gcore/resources/cloud/cloud.py
CHANGED
|
@@ -59,6 +59,14 @@ from .ip_ranges import (
|
|
|
59
59
|
IPRangesResourceWithStreamingResponse,
|
|
60
60
|
AsyncIPRangesResourceWithStreamingResponse,
|
|
61
61
|
)
|
|
62
|
+
from .audit_logs import (
|
|
63
|
+
AuditLogsResource,
|
|
64
|
+
AsyncAuditLogsResource,
|
|
65
|
+
AuditLogsResourceWithRawResponse,
|
|
66
|
+
AsyncAuditLogsResourceWithRawResponse,
|
|
67
|
+
AuditLogsResourceWithStreamingResponse,
|
|
68
|
+
AsyncAuditLogsResourceWithStreamingResponse,
|
|
69
|
+
)
|
|
62
70
|
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
63
71
|
from .users.users import (
|
|
64
72
|
UsersResource,
|
|
@@ -273,6 +281,10 @@ class CloudResource(SyncAPIResource):
|
|
|
273
281
|
def instances(self) -> InstancesResource:
|
|
274
282
|
return InstancesResource(self._client)
|
|
275
283
|
|
|
284
|
+
@cached_property
|
|
285
|
+
def audit_logs(self) -> AuditLogsResource:
|
|
286
|
+
return AuditLogsResource(self._client)
|
|
287
|
+
|
|
276
288
|
@cached_property
|
|
277
289
|
def with_raw_response(self) -> CloudResourceWithRawResponse:
|
|
278
290
|
"""
|
|
@@ -382,6 +394,10 @@ class AsyncCloudResource(AsyncAPIResource):
|
|
|
382
394
|
def instances(self) -> AsyncInstancesResource:
|
|
383
395
|
return AsyncInstancesResource(self._client)
|
|
384
396
|
|
|
397
|
+
@cached_property
|
|
398
|
+
def audit_logs(self) -> AsyncAuditLogsResource:
|
|
399
|
+
return AsyncAuditLogsResource(self._client)
|
|
400
|
+
|
|
385
401
|
@cached_property
|
|
386
402
|
def with_raw_response(self) -> AsyncCloudResourceWithRawResponse:
|
|
387
403
|
"""
|
|
@@ -494,6 +510,10 @@ class CloudResourceWithRawResponse:
|
|
|
494
510
|
def instances(self) -> InstancesResourceWithRawResponse:
|
|
495
511
|
return InstancesResourceWithRawResponse(self._cloud.instances)
|
|
496
512
|
|
|
513
|
+
@cached_property
|
|
514
|
+
def audit_logs(self) -> AuditLogsResourceWithRawResponse:
|
|
515
|
+
return AuditLogsResourceWithRawResponse(self._cloud.audit_logs)
|
|
516
|
+
|
|
497
517
|
|
|
498
518
|
class AsyncCloudResourceWithRawResponse:
|
|
499
519
|
def __init__(self, cloud: AsyncCloudResource) -> None:
|
|
@@ -587,6 +607,10 @@ class AsyncCloudResourceWithRawResponse:
|
|
|
587
607
|
def instances(self) -> AsyncInstancesResourceWithRawResponse:
|
|
588
608
|
return AsyncInstancesResourceWithRawResponse(self._cloud.instances)
|
|
589
609
|
|
|
610
|
+
@cached_property
|
|
611
|
+
def audit_logs(self) -> AsyncAuditLogsResourceWithRawResponse:
|
|
612
|
+
return AsyncAuditLogsResourceWithRawResponse(self._cloud.audit_logs)
|
|
613
|
+
|
|
590
614
|
|
|
591
615
|
class CloudResourceWithStreamingResponse:
|
|
592
616
|
def __init__(self, cloud: CloudResource) -> None:
|
|
@@ -680,6 +704,10 @@ class CloudResourceWithStreamingResponse:
|
|
|
680
704
|
def instances(self) -> InstancesResourceWithStreamingResponse:
|
|
681
705
|
return InstancesResourceWithStreamingResponse(self._cloud.instances)
|
|
682
706
|
|
|
707
|
+
@cached_property
|
|
708
|
+
def audit_logs(self) -> AuditLogsResourceWithStreamingResponse:
|
|
709
|
+
return AuditLogsResourceWithStreamingResponse(self._cloud.audit_logs)
|
|
710
|
+
|
|
683
711
|
|
|
684
712
|
class AsyncCloudResourceWithStreamingResponse:
|
|
685
713
|
def __init__(self, cloud: AsyncCloudResource) -> None:
|
|
@@ -772,3 +800,7 @@ class AsyncCloudResourceWithStreamingResponse:
|
|
|
772
800
|
@cached_property
|
|
773
801
|
def instances(self) -> AsyncInstancesResourceWithStreamingResponse:
|
|
774
802
|
return AsyncInstancesResourceWithStreamingResponse(self._cloud.instances)
|
|
803
|
+
|
|
804
|
+
@cached_property
|
|
805
|
+
def audit_logs(self) -> AsyncAuditLogsResourceWithStreamingResponse:
|
|
806
|
+
return AsyncAuditLogsResourceWithStreamingResponse(self._cloud.audit_logs)
|