gcore 0.5.0__py3-none-any.whl → 0.7.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.

Files changed (200) hide show
  1. gcore/_client.py +9 -0
  2. gcore/_models.py +24 -3
  3. gcore/_version.py +1 -1
  4. gcore/pagination.py +101 -1
  5. gcore/resources/__init__.py +14 -0
  6. gcore/resources/cloud/__init__.py +42 -0
  7. gcore/resources/cloud/audit_logs.py +480 -0
  8. gcore/resources/cloud/cloud.py +96 -0
  9. gcore/resources/cloud/cost_reports.py +811 -0
  10. gcore/resources/cloud/file_shares/file_shares.py +74 -9
  11. gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +61 -26
  12. gcore/resources/cloud/inference/__init__.py +14 -0
  13. gcore/resources/cloud/inference/api_keys.py +621 -0
  14. gcore/resources/cloud/inference/inference.py +32 -0
  15. gcore/resources/cloud/inference/registry_credentials.py +4 -6
  16. gcore/resources/cloud/load_balancers/pools/members.py +22 -6
  17. gcore/resources/cloud/usage_reports.py +337 -0
  18. gcore/resources/streaming/__init__.py +159 -0
  19. gcore/resources/streaming/ai_tasks.py +1288 -0
  20. gcore/resources/streaming/broadcasts.py +579 -0
  21. gcore/resources/streaming/directories.py +515 -0
  22. gcore/resources/streaming/players.py +577 -0
  23. gcore/resources/streaming/playlists.py +1059 -0
  24. gcore/resources/streaming/quality_sets.py +331 -0
  25. gcore/resources/streaming/restreams.py +484 -0
  26. gcore/resources/streaming/statistics.py +3224 -0
  27. gcore/resources/streaming/streaming.py +390 -0
  28. gcore/resources/streaming/streams/__init__.py +33 -0
  29. gcore/resources/streaming/streams/overlays.py +716 -0
  30. gcore/resources/streaming/streams/streams.py +1592 -0
  31. gcore/resources/streaming/videos/__init__.py +33 -0
  32. gcore/resources/streaming/videos/subtitles.py +623 -0
  33. gcore/resources/streaming/videos/videos.py +1553 -0
  34. gcore/resources/waap/ip_info.py +28 -10
  35. gcore/types/cloud/__init__.py +12 -0
  36. gcore/types/cloud/audit_log_entry.py +254 -0
  37. gcore/types/cloud/audit_log_list_params.py +158 -0
  38. gcore/types/cloud/cost_report_aggregated.py +865 -0
  39. gcore/types/cloud/cost_report_aggregated_monthly.py +865 -0
  40. gcore/types/cloud/cost_report_detailed.py +1343 -0
  41. gcore/types/cloud/cost_report_get_aggregated_monthly_params.py +394 -0
  42. gcore/types/cloud/cost_report_get_aggregated_params.py +409 -0
  43. gcore/types/cloud/cost_report_get_detailed_params.py +435 -0
  44. gcore/types/cloud/file_share.py +37 -3
  45. gcore/types/cloud/file_share_create_params.py +16 -0
  46. gcore/types/cloud/file_share_update_params.py +29 -3
  47. gcore/types/cloud/gpu_baremetal_cluster.py +2 -2
  48. gcore/types/cloud/gpu_baremetal_cluster_create_params.py +9 -0
  49. gcore/types/cloud/inference/__init__.py +5 -0
  50. gcore/types/cloud/inference/api_key_create_params.py +21 -0
  51. gcore/types/cloud/inference/api_key_list_params.py +21 -0
  52. gcore/types/cloud/inference/api_key_update_params.py +16 -0
  53. gcore/types/cloud/inference/inference_api_key.py +24 -0
  54. gcore/types/cloud/inference/inference_api_key_create.py +27 -0
  55. gcore/types/cloud/load_balancer_create_params.py +14 -3
  56. gcore/types/cloud/load_balancers/pool_create_params.py +14 -3
  57. gcore/types/cloud/load_balancers/pool_update_params.py +14 -3
  58. gcore/types/cloud/load_balancers/pools/member_add_params.py +14 -3
  59. gcore/types/cloud/member.py +12 -4
  60. gcore/types/cloud/quota_get_all_response.py +24 -2
  61. gcore/types/cloud/quota_get_by_region_response.py +24 -2
  62. gcore/types/cloud/quotas/request_create_params.py +12 -1
  63. gcore/types/cloud/quotas/request_get_response.py +12 -1
  64. gcore/types/cloud/quotas/request_list_response.py +12 -1
  65. gcore/types/cloud/usage_report.py +1612 -0
  66. gcore/types/cloud/usage_report_get_params.py +432 -0
  67. gcore/types/streaming/__init__.py +143 -0
  68. gcore/types/streaming/ai_contentmoderation_casm.py +39 -0
  69. gcore/types/streaming/ai_contentmoderation_hardnudity.py +54 -0
  70. gcore/types/streaming/ai_contentmoderation_nsfw.py +39 -0
  71. gcore/types/streaming/ai_contentmoderation_softnudity.py +66 -0
  72. gcore/types/streaming/ai_contentmoderation_sport.py +39 -0
  73. gcore/types/streaming/ai_contentmoderation_weapon.py +39 -0
  74. gcore/types/streaming/ai_task.py +205 -0
  75. gcore/types/streaming/ai_task_cancel_response.py +12 -0
  76. gcore/types/streaming/ai_task_create_params.py +168 -0
  77. gcore/types/streaming/ai_task_create_response.py +10 -0
  78. gcore/types/streaming/ai_task_get_ai_settings_params.py +27 -0
  79. gcore/types/streaming/ai_task_get_ai_settings_response.py +12 -0
  80. gcore/types/streaming/ai_task_get_response.py +313 -0
  81. gcore/types/streaming/ai_task_list_params.py +50 -0
  82. gcore/types/streaming/broadcast.py +71 -0
  83. gcore/types/streaming/broadcast_create_params.py +76 -0
  84. gcore/types/streaming/broadcast_list_params.py +12 -0
  85. gcore/types/streaming/broadcast_spectators_count.py +12 -0
  86. gcore/types/streaming/broadcast_update_params.py +76 -0
  87. gcore/types/streaming/clip.py +78 -0
  88. gcore/types/streaming/create_video_param.py +214 -0
  89. gcore/types/streaming/direct_upload_parameters.py +33 -0
  90. gcore/types/streaming/directories_tree.py +19 -0
  91. gcore/types/streaming/directory_base.py +31 -0
  92. gcore/types/streaming/directory_create_params.py +15 -0
  93. gcore/types/streaming/directory_get_response.py +19 -0
  94. gcore/types/streaming/directory_item.py +13 -0
  95. gcore/types/streaming/directory_update_params.py +18 -0
  96. gcore/types/streaming/directory_video.py +13 -0
  97. gcore/types/streaming/ffprobes.py +25 -0
  98. gcore/types/streaming/max_stream_series.py +21 -0
  99. gcore/types/streaming/meet_series.py +23 -0
  100. gcore/types/streaming/player.py +114 -0
  101. gcore/types/streaming/player_create_params.py +18 -0
  102. gcore/types/streaming/player_list_params.py +12 -0
  103. gcore/types/streaming/player_param.py +114 -0
  104. gcore/types/streaming/player_update_params.py +18 -0
  105. gcore/types/streaming/playlist.py +102 -0
  106. gcore/types/streaming/playlist_create.py +12 -0
  107. gcore/types/streaming/playlist_create_params.py +102 -0
  108. gcore/types/streaming/playlist_list_params.py +12 -0
  109. gcore/types/streaming/playlist_list_videos_response.py +10 -0
  110. gcore/types/streaming/playlist_update_params.py +102 -0
  111. gcore/types/streaming/playlist_video.py +215 -0
  112. gcore/types/streaming/popular_videos.py +17 -0
  113. gcore/types/streaming/quality_set_set_default_params.py +23 -0
  114. gcore/types/streaming/quality_sets.py +57 -0
  115. gcore/types/streaming/restream.py +37 -0
  116. gcore/types/streaming/restream_create_params.py +41 -0
  117. gcore/types/streaming/restream_list_params.py +12 -0
  118. gcore/types/streaming/restream_update_params.py +41 -0
  119. gcore/types/streaming/statistic_get_ffprobes_params.py +22 -0
  120. gcore/types/streaming/statistic_get_live_unique_viewers_params.py +26 -0
  121. gcore/types/streaming/statistic_get_live_unique_viewers_response.py +25 -0
  122. gcore/types/streaming/statistic_get_live_watch_time_cdn_params.py +32 -0
  123. gcore/types/streaming/statistic_get_live_watch_time_total_cdn_params.py +30 -0
  124. gcore/types/streaming/statistic_get_max_streams_series_params.py +20 -0
  125. gcore/types/streaming/statistic_get_meet_series_params.py +20 -0
  126. gcore/types/streaming/statistic_get_popular_videos_params.py +15 -0
  127. gcore/types/streaming/statistic_get_storage_series_params.py +20 -0
  128. gcore/types/streaming/statistic_get_stream_series_params.py +20 -0
  129. gcore/types/streaming/statistic_get_unique_viewers_cdn_params.py +27 -0
  130. gcore/types/streaming/statistic_get_unique_viewers_params.py +34 -0
  131. gcore/types/streaming/statistic_get_views_by_browsers_params.py +15 -0
  132. gcore/types/streaming/statistic_get_views_by_country_params.py +15 -0
  133. gcore/types/streaming/statistic_get_views_by_hostname_params.py +15 -0
  134. gcore/types/streaming/statistic_get_views_by_operating_system_params.py +15 -0
  135. gcore/types/streaming/statistic_get_views_by_referer_params.py +15 -0
  136. gcore/types/streaming/statistic_get_views_by_region_params.py +15 -0
  137. gcore/types/streaming/statistic_get_views_heatmap_params.py +21 -0
  138. gcore/types/streaming/statistic_get_views_params.py +34 -0
  139. gcore/types/streaming/statistic_get_vod_storage_volume_params.py +17 -0
  140. gcore/types/streaming/statistic_get_vod_transcoding_duration_params.py +17 -0
  141. gcore/types/streaming/statistic_get_vod_unique_viewers_cdn_params.py +26 -0
  142. gcore/types/streaming/statistic_get_vod_watch_time_cdn_params.py +32 -0
  143. gcore/types/streaming/statistic_get_vod_watch_time_total_cdn_params.py +30 -0
  144. gcore/types/streaming/statistic_get_vod_watch_time_total_cdn_response.py +22 -0
  145. gcore/types/streaming/storage_series.py +23 -0
  146. gcore/types/streaming/stream.py +420 -0
  147. gcore/types/streaming/stream_create_clip_params.py +48 -0
  148. gcore/types/streaming/stream_create_params.py +165 -0
  149. gcore/types/streaming/stream_list_clips_response.py +10 -0
  150. gcore/types/streaming/stream_list_params.py +18 -0
  151. gcore/types/streaming/stream_series.py +21 -0
  152. gcore/types/streaming/stream_start_recording_response.py +76 -0
  153. gcore/types/streaming/stream_update_params.py +169 -0
  154. gcore/types/streaming/streams/__init__.py +11 -0
  155. gcore/types/streaming/streams/overlay.py +43 -0
  156. gcore/types/streaming/streams/overlay_create_params.py +36 -0
  157. gcore/types/streaming/streams/overlay_create_response.py +10 -0
  158. gcore/types/streaming/streams/overlay_list_response.py +10 -0
  159. gcore/types/streaming/streams/overlay_update_multiple_params.py +39 -0
  160. gcore/types/streaming/streams/overlay_update_multiple_response.py +10 -0
  161. gcore/types/streaming/streams/overlay_update_params.py +33 -0
  162. gcore/types/streaming/subtitle.py +12 -0
  163. gcore/types/streaming/subtitle_base.py +18 -0
  164. gcore/types/streaming/subtitle_base_param.py +18 -0
  165. gcore/types/streaming/unique_viewers.py +35 -0
  166. gcore/types/streaming/unique_viewers_cdn.py +17 -0
  167. gcore/types/streaming/video.py +444 -0
  168. gcore/types/streaming/video_create_multiple_params.py +28 -0
  169. gcore/types/streaming/video_create_multiple_response.py +10 -0
  170. gcore/types/streaming/video_create_params.py +13 -0
  171. gcore/types/streaming/video_create_response.py +10 -0
  172. gcore/types/streaming/video_list_names_params.py +13 -0
  173. gcore/types/streaming/video_list_params.py +59 -0
  174. gcore/types/streaming/video_update_params.py +214 -0
  175. gcore/types/streaming/videos/__init__.py +7 -0
  176. gcore/types/streaming/videos/subtitle_create_params.py +17 -0
  177. gcore/types/streaming/videos/subtitle_list_response.py +10 -0
  178. gcore/types/streaming/videos/subtitle_update_params.py +20 -0
  179. gcore/types/streaming/views.py +35 -0
  180. gcore/types/streaming/views_by_browser.py +17 -0
  181. gcore/types/streaming/views_by_country.py +19 -0
  182. gcore/types/streaming/views_by_hostname.py +17 -0
  183. gcore/types/streaming/views_by_operating_system.py +17 -0
  184. gcore/types/streaming/views_by_referer.py +17 -0
  185. gcore/types/streaming/views_by_region.py +19 -0
  186. gcore/types/streaming/views_heatmap.py +19 -0
  187. gcore/types/streaming/vod_statistics_series.py +21 -0
  188. gcore/types/streaming/vod_total_stream_duration_series.py +22 -0
  189. gcore/types/waap/domains/custom_rule_create_params.py +4 -4
  190. gcore/types/waap/domains/custom_rule_update_params.py +4 -4
  191. gcore/types/waap/ip_info_get_blocked_requests_params.py +5 -1
  192. gcore/types/waap/ip_info_get_counts_params.py +2 -1
  193. gcore/types/waap/ip_info_get_top_sessions_params.py +5 -1
  194. gcore/types/waap/ip_info_get_top_urls_params.py +5 -1
  195. gcore/types/waap/ip_info_get_top_user_agents_params.py +5 -1
  196. gcore/types/waap/waap_custom_rule.py +4 -4
  197. {gcore-0.5.0.dist-info → gcore-0.7.0.dist-info}/METADATA +2 -3
  198. {gcore-0.5.0.dist-info → gcore-0.7.0.dist-info}/RECORD +200 -43
  199. {gcore-0.5.0.dist-info → gcore-0.7.0.dist-info}/WHEEL +0 -0
  200. {gcore-0.5.0.dist-info → gcore-0.7.0.dist-info}/licenses/LICENSE +0 -0
@@ -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
+ )
@@ -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,
@@ -68,6 +76,14 @@ from .users.users import (
68
76
  UsersResourceWithStreamingResponse,
69
77
  AsyncUsersResourceWithStreamingResponse,
70
78
  )
79
+ from .cost_reports import (
80
+ CostReportsResource,
81
+ AsyncCostReportsResource,
82
+ CostReportsResourceWithRawResponse,
83
+ AsyncCostReportsResourceWithRawResponse,
84
+ CostReportsResourceWithStreamingResponse,
85
+ AsyncCostReportsResourceWithStreamingResponse,
86
+ )
71
87
  from .floating_ips import (
72
88
  FloatingIPsResource,
73
89
  AsyncFloatingIPsResource,
@@ -84,6 +100,14 @@ from .quotas.quotas import (
84
100
  QuotasResourceWithStreamingResponse,
85
101
  AsyncQuotasResourceWithStreamingResponse,
86
102
  )
103
+ from .usage_reports import (
104
+ UsageReportsResource,
105
+ AsyncUsageReportsResource,
106
+ UsageReportsResourceWithRawResponse,
107
+ AsyncUsageReportsResourceWithRawResponse,
108
+ UsageReportsResourceWithStreamingResponse,
109
+ AsyncUsageReportsResourceWithStreamingResponse,
110
+ )
87
111
  from .placement_groups import (
88
112
  PlacementGroupsResource,
89
113
  AsyncPlacementGroupsResource,
@@ -273,6 +297,18 @@ class CloudResource(SyncAPIResource):
273
297
  def instances(self) -> InstancesResource:
274
298
  return InstancesResource(self._client)
275
299
 
300
+ @cached_property
301
+ def audit_logs(self) -> AuditLogsResource:
302
+ return AuditLogsResource(self._client)
303
+
304
+ @cached_property
305
+ def cost_reports(self) -> CostReportsResource:
306
+ return CostReportsResource(self._client)
307
+
308
+ @cached_property
309
+ def usage_reports(self) -> UsageReportsResource:
310
+ return UsageReportsResource(self._client)
311
+
276
312
  @cached_property
277
313
  def with_raw_response(self) -> CloudResourceWithRawResponse:
278
314
  """
@@ -382,6 +418,18 @@ class AsyncCloudResource(AsyncAPIResource):
382
418
  def instances(self) -> AsyncInstancesResource:
383
419
  return AsyncInstancesResource(self._client)
384
420
 
421
+ @cached_property
422
+ def audit_logs(self) -> AsyncAuditLogsResource:
423
+ return AsyncAuditLogsResource(self._client)
424
+
425
+ @cached_property
426
+ def cost_reports(self) -> AsyncCostReportsResource:
427
+ return AsyncCostReportsResource(self._client)
428
+
429
+ @cached_property
430
+ def usage_reports(self) -> AsyncUsageReportsResource:
431
+ return AsyncUsageReportsResource(self._client)
432
+
385
433
  @cached_property
386
434
  def with_raw_response(self) -> AsyncCloudResourceWithRawResponse:
387
435
  """
@@ -494,6 +542,18 @@ class CloudResourceWithRawResponse:
494
542
  def instances(self) -> InstancesResourceWithRawResponse:
495
543
  return InstancesResourceWithRawResponse(self._cloud.instances)
496
544
 
545
+ @cached_property
546
+ def audit_logs(self) -> AuditLogsResourceWithRawResponse:
547
+ return AuditLogsResourceWithRawResponse(self._cloud.audit_logs)
548
+
549
+ @cached_property
550
+ def cost_reports(self) -> CostReportsResourceWithRawResponse:
551
+ return CostReportsResourceWithRawResponse(self._cloud.cost_reports)
552
+
553
+ @cached_property
554
+ def usage_reports(self) -> UsageReportsResourceWithRawResponse:
555
+ return UsageReportsResourceWithRawResponse(self._cloud.usage_reports)
556
+
497
557
 
498
558
  class AsyncCloudResourceWithRawResponse:
499
559
  def __init__(self, cloud: AsyncCloudResource) -> None:
@@ -587,6 +647,18 @@ class AsyncCloudResourceWithRawResponse:
587
647
  def instances(self) -> AsyncInstancesResourceWithRawResponse:
588
648
  return AsyncInstancesResourceWithRawResponse(self._cloud.instances)
589
649
 
650
+ @cached_property
651
+ def audit_logs(self) -> AsyncAuditLogsResourceWithRawResponse:
652
+ return AsyncAuditLogsResourceWithRawResponse(self._cloud.audit_logs)
653
+
654
+ @cached_property
655
+ def cost_reports(self) -> AsyncCostReportsResourceWithRawResponse:
656
+ return AsyncCostReportsResourceWithRawResponse(self._cloud.cost_reports)
657
+
658
+ @cached_property
659
+ def usage_reports(self) -> AsyncUsageReportsResourceWithRawResponse:
660
+ return AsyncUsageReportsResourceWithRawResponse(self._cloud.usage_reports)
661
+
590
662
 
591
663
  class CloudResourceWithStreamingResponse:
592
664
  def __init__(self, cloud: CloudResource) -> None:
@@ -680,6 +752,18 @@ class CloudResourceWithStreamingResponse:
680
752
  def instances(self) -> InstancesResourceWithStreamingResponse:
681
753
  return InstancesResourceWithStreamingResponse(self._cloud.instances)
682
754
 
755
+ @cached_property
756
+ def audit_logs(self) -> AuditLogsResourceWithStreamingResponse:
757
+ return AuditLogsResourceWithStreamingResponse(self._cloud.audit_logs)
758
+
759
+ @cached_property
760
+ def cost_reports(self) -> CostReportsResourceWithStreamingResponse:
761
+ return CostReportsResourceWithStreamingResponse(self._cloud.cost_reports)
762
+
763
+ @cached_property
764
+ def usage_reports(self) -> UsageReportsResourceWithStreamingResponse:
765
+ return UsageReportsResourceWithStreamingResponse(self._cloud.usage_reports)
766
+
683
767
 
684
768
  class AsyncCloudResourceWithStreamingResponse:
685
769
  def __init__(self, cloud: AsyncCloudResource) -> None:
@@ -772,3 +856,15 @@ class AsyncCloudResourceWithStreamingResponse:
772
856
  @cached_property
773
857
  def instances(self) -> AsyncInstancesResourceWithStreamingResponse:
774
858
  return AsyncInstancesResourceWithStreamingResponse(self._cloud.instances)
859
+
860
+ @cached_property
861
+ def audit_logs(self) -> AsyncAuditLogsResourceWithStreamingResponse:
862
+ return AsyncAuditLogsResourceWithStreamingResponse(self._cloud.audit_logs)
863
+
864
+ @cached_property
865
+ def cost_reports(self) -> AsyncCostReportsResourceWithStreamingResponse:
866
+ return AsyncCostReportsResourceWithStreamingResponse(self._cloud.cost_reports)
867
+
868
+ @cached_property
869
+ def usage_reports(self) -> AsyncUsageReportsResourceWithStreamingResponse:
870
+ return AsyncUsageReportsResourceWithStreamingResponse(self._cloud.usage_reports)