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
@@ -251,7 +251,7 @@ class RegistryCredentialsResource(SyncAPIResource):
251
251
  extra_query: Query | None = None,
252
252
  extra_body: Body | None = None,
253
253
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
254
- ) -> None:
254
+ ) -> InferenceRegistryCredentialsCreate:
255
255
  """
256
256
  Replace inference registry credential
257
257
 
@@ -278,7 +278,6 @@ class RegistryCredentialsResource(SyncAPIResource):
278
278
  project_id = self._client._get_cloud_project_id_path_param()
279
279
  if not credential_name:
280
280
  raise ValueError(f"Expected a non-empty value for `credential_name` but received {credential_name!r}")
281
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
282
281
  return self._put(
283
282
  f"/cloud/v3/inference/{project_id}/registry_credentials/{credential_name}",
284
283
  body=maybe_transform(
@@ -292,7 +291,7 @@ class RegistryCredentialsResource(SyncAPIResource):
292
291
  options=make_request_options(
293
292
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
294
293
  ),
295
- cast_to=NoneType,
294
+ cast_to=InferenceRegistryCredentialsCreate,
296
295
  )
297
296
 
298
297
 
@@ -520,7 +519,7 @@ class AsyncRegistryCredentialsResource(AsyncAPIResource):
520
519
  extra_query: Query | None = None,
521
520
  extra_body: Body | None = None,
522
521
  timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
523
- ) -> None:
522
+ ) -> InferenceRegistryCredentialsCreate:
524
523
  """
525
524
  Replace inference registry credential
526
525
 
@@ -547,7 +546,6 @@ class AsyncRegistryCredentialsResource(AsyncAPIResource):
547
546
  project_id = self._client._get_cloud_project_id_path_param()
548
547
  if not credential_name:
549
548
  raise ValueError(f"Expected a non-empty value for `credential_name` but received {credential_name!r}")
550
- extra_headers = {"Accept": "*/*", **(extra_headers or {})}
551
549
  return await self._put(
552
550
  f"/cloud/v3/inference/{project_id}/registry_credentials/{credential_name}",
553
551
  body=await async_maybe_transform(
@@ -561,7 +559,7 @@ class AsyncRegistryCredentialsResource(AsyncAPIResource):
561
559
  options=make_request_options(
562
560
  extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
563
561
  ),
564
- cast_to=NoneType,
562
+ cast_to=InferenceRegistryCredentialsCreate,
565
563
  )
566
564
 
567
565
 
@@ -51,7 +51,8 @@ class MembersResource(SyncAPIResource):
51
51
  region_id: int | None = None,
52
52
  address: str,
53
53
  protocol_port: int,
54
- admin_state_up: Optional[bool] | NotGiven = NOT_GIVEN,
54
+ admin_state_up: bool | NotGiven = NOT_GIVEN,
55
+ backup: bool | NotGiven = NOT_GIVEN,
55
56
  instance_id: Optional[str] | NotGiven = NOT_GIVEN,
56
57
  monitor_address: Optional[str] | NotGiven = NOT_GIVEN,
57
58
  monitor_port: Optional[int] | NotGiven = NOT_GIVEN,
@@ -82,6 +83,11 @@ class MembersResource(SyncAPIResource):
82
83
  and operational. When set to false, the resource is disabled and will not
83
84
  process traffic. When null is passed, the value is skipped and defaults to true.
84
85
 
86
+ backup: Set to true if the member is a backup member, to which traffic will be sent
87
+ exclusively when all non-backup members will be unreachable. It allows to
88
+ realize ACTIVE-BACKUP load balancing without thinking about VRRP and VIP
89
+ configuration. Default is false.
90
+
85
91
  instance_id: Either `subnet_id` or `instance_id` should be provided
86
92
 
87
93
  monitor_address: An alternate IP address used for health monitoring of a backend member. Default
@@ -90,9 +96,10 @@ class MembersResource(SyncAPIResource):
90
96
  monitor_port: An alternate protocol port used for health monitoring of a backend member.
91
97
  Default is null which monitors the member `protocol_port`.
92
98
 
93
- subnet_id: Either `subnet_id` or `instance_id` should be provided
99
+ subnet_id: `subnet_id` in which `address` is present. Either `subnet_id` or `instance_id`
100
+ should be provided
94
101
 
95
- weight: Member weight. Valid values: 0 to 256, defaults to 1
102
+ weight: Member weight. Valid values are 0 < `weight` <= 256, defaults to 1.
96
103
 
97
104
  extra_headers: Send extra headers
98
105
 
@@ -115,6 +122,7 @@ class MembersResource(SyncAPIResource):
115
122
  "address": address,
116
123
  "protocol_port": protocol_port,
117
124
  "admin_state_up": admin_state_up,
125
+ "backup": backup,
118
126
  "instance_id": instance_id,
119
127
  "monitor_address": monitor_address,
120
128
  "monitor_port": monitor_port,
@@ -208,7 +216,8 @@ class AsyncMembersResource(AsyncAPIResource):
208
216
  region_id: int | None = None,
209
217
  address: str,
210
218
  protocol_port: int,
211
- admin_state_up: Optional[bool] | NotGiven = NOT_GIVEN,
219
+ admin_state_up: bool | NotGiven = NOT_GIVEN,
220
+ backup: bool | NotGiven = NOT_GIVEN,
212
221
  instance_id: Optional[str] | NotGiven = NOT_GIVEN,
213
222
  monitor_address: Optional[str] | NotGiven = NOT_GIVEN,
214
223
  monitor_port: Optional[int] | NotGiven = NOT_GIVEN,
@@ -239,6 +248,11 @@ class AsyncMembersResource(AsyncAPIResource):
239
248
  and operational. When set to false, the resource is disabled and will not
240
249
  process traffic. When null is passed, the value is skipped and defaults to true.
241
250
 
251
+ backup: Set to true if the member is a backup member, to which traffic will be sent
252
+ exclusively when all non-backup members will be unreachable. It allows to
253
+ realize ACTIVE-BACKUP load balancing without thinking about VRRP and VIP
254
+ configuration. Default is false.
255
+
242
256
  instance_id: Either `subnet_id` or `instance_id` should be provided
243
257
 
244
258
  monitor_address: An alternate IP address used for health monitoring of a backend member. Default
@@ -247,9 +261,10 @@ class AsyncMembersResource(AsyncAPIResource):
247
261
  monitor_port: An alternate protocol port used for health monitoring of a backend member.
248
262
  Default is null which monitors the member `protocol_port`.
249
263
 
250
- subnet_id: Either `subnet_id` or `instance_id` should be provided
264
+ subnet_id: `subnet_id` in which `address` is present. Either `subnet_id` or `instance_id`
265
+ should be provided
251
266
 
252
- weight: Member weight. Valid values: 0 to 256, defaults to 1
267
+ weight: Member weight. Valid values are 0 < `weight` <= 256, defaults to 1.
253
268
 
254
269
  extra_headers: Send extra headers
255
270
 
@@ -272,6 +287,7 @@ class AsyncMembersResource(AsyncAPIResource):
272
287
  "address": address,
273
288
  "protocol_port": protocol_port,
274
289
  "admin_state_up": admin_state_up,
290
+ "backup": backup,
275
291
  "instance_id": instance_id,
276
292
  "monitor_address": monitor_address,
277
293
  "monitor_port": monitor_port,
@@ -0,0 +1,337 @@
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, Optional
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, async_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 ...types.cloud import usage_report_get_params
22
+ from ..._base_client import make_request_options
23
+ from ...types.cloud.usage_report import UsageReport
24
+
25
+ __all__ = ["UsageReportsResource", "AsyncUsageReportsResource"]
26
+
27
+
28
+ class UsageReportsResource(SyncAPIResource):
29
+ @cached_property
30
+ def with_raw_response(self) -> UsageReportsResourceWithRawResponse:
31
+ """
32
+ This property can be used as a prefix for any HTTP method call to return
33
+ the raw response object instead of the parsed content.
34
+
35
+ For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
36
+ """
37
+ return UsageReportsResourceWithRawResponse(self)
38
+
39
+ @cached_property
40
+ def with_streaming_response(self) -> UsageReportsResourceWithStreamingResponse:
41
+ """
42
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
43
+
44
+ For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
45
+ """
46
+ return UsageReportsResourceWithStreamingResponse(self)
47
+
48
+ def get(
49
+ self,
50
+ *,
51
+ time_from: Union[str, datetime],
52
+ time_to: Union[str, datetime],
53
+ enable_last_day: bool | NotGiven = NOT_GIVEN,
54
+ limit: int | NotGiven = NOT_GIVEN,
55
+ offset: int | NotGiven = NOT_GIVEN,
56
+ projects: Optional[Iterable[int]] | NotGiven = NOT_GIVEN,
57
+ regions: Iterable[int] | NotGiven = NOT_GIVEN,
58
+ schema_filter: usage_report_get_params.SchemaFilter | NotGiven = NOT_GIVEN,
59
+ sorting: Iterable[usage_report_get_params.Sorting] | NotGiven = NOT_GIVEN,
60
+ tags: usage_report_get_params.Tags | NotGiven = NOT_GIVEN,
61
+ types: List[
62
+ Literal[
63
+ "ai_cluster",
64
+ "ai_virtual_cluster",
65
+ "backup",
66
+ "baremetal",
67
+ "basic_vm",
68
+ "containers",
69
+ "dbaas_postgresql_connection_pooler",
70
+ "dbaas_postgresql_cpu",
71
+ "dbaas_postgresql_memory",
72
+ "dbaas_postgresql_public_network",
73
+ "dbaas_postgresql_volume",
74
+ "egress_traffic",
75
+ "external_ip",
76
+ "file_share",
77
+ "floatingip",
78
+ "functions",
79
+ "functions_calls",
80
+ "functions_traffic",
81
+ "image",
82
+ "inference",
83
+ "instance",
84
+ "load_balancer",
85
+ "log_index",
86
+ "snapshot",
87
+ "volume",
88
+ ]
89
+ ]
90
+ | NotGiven = NOT_GIVEN,
91
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
92
+ # The extra values given here take precedence over values defined on the client or passed to this method.
93
+ extra_headers: Headers | None = None,
94
+ extra_query: Query | None = None,
95
+ extra_body: Body | None = None,
96
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
97
+ ) -> UsageReport:
98
+ """Receiving data from the past hour might lead to incomplete statistics.
99
+
100
+ For the
101
+ most accurate data, we recommend accessing the statistics after at least one
102
+ hour. Typically, updates are available within a 24-hour period, although the
103
+ frequency can vary. Maintenance periods or other exceptions may cause delays,
104
+ potentially extending beyond 24 hours until the servers are back online and the
105
+ missing data is filled in.
106
+
107
+ Args:
108
+ time_from: The start date of the report period (ISO 8601). The report starts from the
109
+ beginning of this day.
110
+
111
+ time_to: The end date of the report period (ISO 8601). The report ends just before the
112
+ beginning of this day.
113
+
114
+ enable_last_day: Expenses for the last specified day are taken into account. As the default,
115
+ False.
116
+
117
+ limit: The response resources limit. Defaults to 10.
118
+
119
+ offset: The response resources offset.
120
+
121
+ projects: List of project IDs
122
+
123
+ regions: List of region IDs.
124
+
125
+ schema_filter: Extended filter for field filtering.
126
+
127
+ sorting: List of sorting filters (JSON objects) fields: project. directions: asc, desc.
128
+
129
+ tags: Filter by tags
130
+
131
+ types: List of resource types to be filtered in the report.
132
+
133
+ extra_headers: Send extra headers
134
+
135
+ extra_query: Add additional query parameters to the request
136
+
137
+ extra_body: Add additional JSON properties to the request
138
+
139
+ timeout: Override the client-level default timeout for this request, in seconds
140
+ """
141
+ return self._post(
142
+ "/cloud/v1/usage_report",
143
+ body=maybe_transform(
144
+ {
145
+ "time_from": time_from,
146
+ "time_to": time_to,
147
+ "enable_last_day": enable_last_day,
148
+ "limit": limit,
149
+ "offset": offset,
150
+ "projects": projects,
151
+ "regions": regions,
152
+ "schema_filter": schema_filter,
153
+ "sorting": sorting,
154
+ "tags": tags,
155
+ "types": types,
156
+ },
157
+ usage_report_get_params.UsageReportGetParams,
158
+ ),
159
+ options=make_request_options(
160
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
161
+ ),
162
+ cast_to=UsageReport,
163
+ )
164
+
165
+
166
+ class AsyncUsageReportsResource(AsyncAPIResource):
167
+ @cached_property
168
+ def with_raw_response(self) -> AsyncUsageReportsResourceWithRawResponse:
169
+ """
170
+ This property can be used as a prefix for any HTTP method call to return
171
+ the raw response object instead of the parsed content.
172
+
173
+ For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
174
+ """
175
+ return AsyncUsageReportsResourceWithRawResponse(self)
176
+
177
+ @cached_property
178
+ def with_streaming_response(self) -> AsyncUsageReportsResourceWithStreamingResponse:
179
+ """
180
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
181
+
182
+ For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
183
+ """
184
+ return AsyncUsageReportsResourceWithStreamingResponse(self)
185
+
186
+ async def get(
187
+ self,
188
+ *,
189
+ time_from: Union[str, datetime],
190
+ time_to: Union[str, datetime],
191
+ enable_last_day: bool | NotGiven = NOT_GIVEN,
192
+ limit: int | NotGiven = NOT_GIVEN,
193
+ offset: int | NotGiven = NOT_GIVEN,
194
+ projects: Optional[Iterable[int]] | NotGiven = NOT_GIVEN,
195
+ regions: Iterable[int] | NotGiven = NOT_GIVEN,
196
+ schema_filter: usage_report_get_params.SchemaFilter | NotGiven = NOT_GIVEN,
197
+ sorting: Iterable[usage_report_get_params.Sorting] | NotGiven = NOT_GIVEN,
198
+ tags: usage_report_get_params.Tags | NotGiven = NOT_GIVEN,
199
+ types: List[
200
+ Literal[
201
+ "ai_cluster",
202
+ "ai_virtual_cluster",
203
+ "backup",
204
+ "baremetal",
205
+ "basic_vm",
206
+ "containers",
207
+ "dbaas_postgresql_connection_pooler",
208
+ "dbaas_postgresql_cpu",
209
+ "dbaas_postgresql_memory",
210
+ "dbaas_postgresql_public_network",
211
+ "dbaas_postgresql_volume",
212
+ "egress_traffic",
213
+ "external_ip",
214
+ "file_share",
215
+ "floatingip",
216
+ "functions",
217
+ "functions_calls",
218
+ "functions_traffic",
219
+ "image",
220
+ "inference",
221
+ "instance",
222
+ "load_balancer",
223
+ "log_index",
224
+ "snapshot",
225
+ "volume",
226
+ ]
227
+ ]
228
+ | NotGiven = NOT_GIVEN,
229
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
230
+ # The extra values given here take precedence over values defined on the client or passed to this method.
231
+ extra_headers: Headers | None = None,
232
+ extra_query: Query | None = None,
233
+ extra_body: Body | None = None,
234
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
235
+ ) -> UsageReport:
236
+ """Receiving data from the past hour might lead to incomplete statistics.
237
+
238
+ For the
239
+ most accurate data, we recommend accessing the statistics after at least one
240
+ hour. Typically, updates are available within a 24-hour period, although the
241
+ frequency can vary. Maintenance periods or other exceptions may cause delays,
242
+ potentially extending beyond 24 hours until the servers are back online and the
243
+ missing data is filled in.
244
+
245
+ Args:
246
+ time_from: The start date of the report period (ISO 8601). The report starts from the
247
+ beginning of this day.
248
+
249
+ time_to: The end date of the report period (ISO 8601). The report ends just before the
250
+ beginning of this day.
251
+
252
+ enable_last_day: Expenses for the last specified day are taken into account. As the default,
253
+ False.
254
+
255
+ limit: The response resources limit. Defaults to 10.
256
+
257
+ offset: The response resources offset.
258
+
259
+ projects: List of project IDs
260
+
261
+ regions: List of region IDs.
262
+
263
+ schema_filter: Extended filter for field filtering.
264
+
265
+ sorting: List of sorting filters (JSON objects) fields: project. directions: asc, desc.
266
+
267
+ tags: Filter by tags
268
+
269
+ types: List of resource types to be filtered in the report.
270
+
271
+ extra_headers: Send extra headers
272
+
273
+ extra_query: Add additional query parameters to the request
274
+
275
+ extra_body: Add additional JSON properties to the request
276
+
277
+ timeout: Override the client-level default timeout for this request, in seconds
278
+ """
279
+ return await self._post(
280
+ "/cloud/v1/usage_report",
281
+ body=await async_maybe_transform(
282
+ {
283
+ "time_from": time_from,
284
+ "time_to": time_to,
285
+ "enable_last_day": enable_last_day,
286
+ "limit": limit,
287
+ "offset": offset,
288
+ "projects": projects,
289
+ "regions": regions,
290
+ "schema_filter": schema_filter,
291
+ "sorting": sorting,
292
+ "tags": tags,
293
+ "types": types,
294
+ },
295
+ usage_report_get_params.UsageReportGetParams,
296
+ ),
297
+ options=make_request_options(
298
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
299
+ ),
300
+ cast_to=UsageReport,
301
+ )
302
+
303
+
304
+ class UsageReportsResourceWithRawResponse:
305
+ def __init__(self, usage_reports: UsageReportsResource) -> None:
306
+ self._usage_reports = usage_reports
307
+
308
+ self.get = to_raw_response_wrapper(
309
+ usage_reports.get,
310
+ )
311
+
312
+
313
+ class AsyncUsageReportsResourceWithRawResponse:
314
+ def __init__(self, usage_reports: AsyncUsageReportsResource) -> None:
315
+ self._usage_reports = usage_reports
316
+
317
+ self.get = async_to_raw_response_wrapper(
318
+ usage_reports.get,
319
+ )
320
+
321
+
322
+ class UsageReportsResourceWithStreamingResponse:
323
+ def __init__(self, usage_reports: UsageReportsResource) -> None:
324
+ self._usage_reports = usage_reports
325
+
326
+ self.get = to_streamed_response_wrapper(
327
+ usage_reports.get,
328
+ )
329
+
330
+
331
+ class AsyncUsageReportsResourceWithStreamingResponse:
332
+ def __init__(self, usage_reports: AsyncUsageReportsResource) -> None:
333
+ self._usage_reports = usage_reports
334
+
335
+ self.get = async_to_streamed_response_wrapper(
336
+ usage_reports.get,
337
+ )
@@ -0,0 +1,159 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from .videos import (
4
+ VideosResource,
5
+ AsyncVideosResource,
6
+ VideosResourceWithRawResponse,
7
+ AsyncVideosResourceWithRawResponse,
8
+ VideosResourceWithStreamingResponse,
9
+ AsyncVideosResourceWithStreamingResponse,
10
+ )
11
+ from .players import (
12
+ PlayersResource,
13
+ AsyncPlayersResource,
14
+ PlayersResourceWithRawResponse,
15
+ AsyncPlayersResourceWithRawResponse,
16
+ PlayersResourceWithStreamingResponse,
17
+ AsyncPlayersResourceWithStreamingResponse,
18
+ )
19
+ from .streams import (
20
+ StreamsResource,
21
+ AsyncStreamsResource,
22
+ StreamsResourceWithRawResponse,
23
+ AsyncStreamsResourceWithRawResponse,
24
+ StreamsResourceWithStreamingResponse,
25
+ AsyncStreamsResourceWithStreamingResponse,
26
+ )
27
+ from .ai_tasks import (
28
+ AITasksResource,
29
+ AsyncAITasksResource,
30
+ AITasksResourceWithRawResponse,
31
+ AsyncAITasksResourceWithRawResponse,
32
+ AITasksResourceWithStreamingResponse,
33
+ AsyncAITasksResourceWithStreamingResponse,
34
+ )
35
+ from .playlists import (
36
+ PlaylistsResource,
37
+ AsyncPlaylistsResource,
38
+ PlaylistsResourceWithRawResponse,
39
+ AsyncPlaylistsResourceWithRawResponse,
40
+ PlaylistsResourceWithStreamingResponse,
41
+ AsyncPlaylistsResourceWithStreamingResponse,
42
+ )
43
+ from .restreams import (
44
+ RestreamsResource,
45
+ AsyncRestreamsResource,
46
+ RestreamsResourceWithRawResponse,
47
+ AsyncRestreamsResourceWithRawResponse,
48
+ RestreamsResourceWithStreamingResponse,
49
+ AsyncRestreamsResourceWithStreamingResponse,
50
+ )
51
+ from .streaming import (
52
+ StreamingResource,
53
+ AsyncStreamingResource,
54
+ StreamingResourceWithRawResponse,
55
+ AsyncStreamingResourceWithRawResponse,
56
+ StreamingResourceWithStreamingResponse,
57
+ AsyncStreamingResourceWithStreamingResponse,
58
+ )
59
+ from .broadcasts import (
60
+ BroadcastsResource,
61
+ AsyncBroadcastsResource,
62
+ BroadcastsResourceWithRawResponse,
63
+ AsyncBroadcastsResourceWithRawResponse,
64
+ BroadcastsResourceWithStreamingResponse,
65
+ AsyncBroadcastsResourceWithStreamingResponse,
66
+ )
67
+ from .statistics import (
68
+ StatisticsResource,
69
+ AsyncStatisticsResource,
70
+ StatisticsResourceWithRawResponse,
71
+ AsyncStatisticsResourceWithRawResponse,
72
+ StatisticsResourceWithStreamingResponse,
73
+ AsyncStatisticsResourceWithStreamingResponse,
74
+ )
75
+ from .directories import (
76
+ DirectoriesResource,
77
+ AsyncDirectoriesResource,
78
+ DirectoriesResourceWithRawResponse,
79
+ AsyncDirectoriesResourceWithRawResponse,
80
+ DirectoriesResourceWithStreamingResponse,
81
+ AsyncDirectoriesResourceWithStreamingResponse,
82
+ )
83
+ from .quality_sets import (
84
+ QualitySetsResource,
85
+ AsyncQualitySetsResource,
86
+ QualitySetsResourceWithRawResponse,
87
+ AsyncQualitySetsResourceWithRawResponse,
88
+ QualitySetsResourceWithStreamingResponse,
89
+ AsyncQualitySetsResourceWithStreamingResponse,
90
+ )
91
+
92
+ __all__ = [
93
+ "AITasksResource",
94
+ "AsyncAITasksResource",
95
+ "AITasksResourceWithRawResponse",
96
+ "AsyncAITasksResourceWithRawResponse",
97
+ "AITasksResourceWithStreamingResponse",
98
+ "AsyncAITasksResourceWithStreamingResponse",
99
+ "BroadcastsResource",
100
+ "AsyncBroadcastsResource",
101
+ "BroadcastsResourceWithRawResponse",
102
+ "AsyncBroadcastsResourceWithRawResponse",
103
+ "BroadcastsResourceWithStreamingResponse",
104
+ "AsyncBroadcastsResourceWithStreamingResponse",
105
+ "DirectoriesResource",
106
+ "AsyncDirectoriesResource",
107
+ "DirectoriesResourceWithRawResponse",
108
+ "AsyncDirectoriesResourceWithRawResponse",
109
+ "DirectoriesResourceWithStreamingResponse",
110
+ "AsyncDirectoriesResourceWithStreamingResponse",
111
+ "PlayersResource",
112
+ "AsyncPlayersResource",
113
+ "PlayersResourceWithRawResponse",
114
+ "AsyncPlayersResourceWithRawResponse",
115
+ "PlayersResourceWithStreamingResponse",
116
+ "AsyncPlayersResourceWithStreamingResponse",
117
+ "QualitySetsResource",
118
+ "AsyncQualitySetsResource",
119
+ "QualitySetsResourceWithRawResponse",
120
+ "AsyncQualitySetsResourceWithRawResponse",
121
+ "QualitySetsResourceWithStreamingResponse",
122
+ "AsyncQualitySetsResourceWithStreamingResponse",
123
+ "PlaylistsResource",
124
+ "AsyncPlaylistsResource",
125
+ "PlaylistsResourceWithRawResponse",
126
+ "AsyncPlaylistsResourceWithRawResponse",
127
+ "PlaylistsResourceWithStreamingResponse",
128
+ "AsyncPlaylistsResourceWithStreamingResponse",
129
+ "VideosResource",
130
+ "AsyncVideosResource",
131
+ "VideosResourceWithRawResponse",
132
+ "AsyncVideosResourceWithRawResponse",
133
+ "VideosResourceWithStreamingResponse",
134
+ "AsyncVideosResourceWithStreamingResponse",
135
+ "StreamsResource",
136
+ "AsyncStreamsResource",
137
+ "StreamsResourceWithRawResponse",
138
+ "AsyncStreamsResourceWithRawResponse",
139
+ "StreamsResourceWithStreamingResponse",
140
+ "AsyncStreamsResourceWithStreamingResponse",
141
+ "RestreamsResource",
142
+ "AsyncRestreamsResource",
143
+ "RestreamsResourceWithRawResponse",
144
+ "AsyncRestreamsResourceWithRawResponse",
145
+ "RestreamsResourceWithStreamingResponse",
146
+ "AsyncRestreamsResourceWithStreamingResponse",
147
+ "StatisticsResource",
148
+ "AsyncStatisticsResource",
149
+ "StatisticsResourceWithRawResponse",
150
+ "AsyncStatisticsResourceWithRawResponse",
151
+ "StatisticsResourceWithStreamingResponse",
152
+ "AsyncStatisticsResourceWithStreamingResponse",
153
+ "StreamingResource",
154
+ "AsyncStreamingResource",
155
+ "StreamingResourceWithRawResponse",
156
+ "AsyncStreamingResourceWithRawResponse",
157
+ "StreamingResourceWithStreamingResponse",
158
+ "AsyncStreamingResourceWithStreamingResponse",
159
+ ]