gcore 0.8.0__py3-none-any.whl → 0.9.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.
- gcore/_base_client.py +4 -1
- gcore/_client.py +9 -0
- gcore/_files.py +4 -4
- gcore/_version.py +1 -1
- gcore/resources/__init__.py +14 -0
- gcore/resources/cloud/cost_reports.py +24 -0
- gcore/resources/cloud/quotas/requests.py +7 -15
- gcore/resources/fastedge/binaries.py +81 -1
- gcore/resources/security/__init__.py +75 -0
- gcore/resources/security/bgp_announces.py +308 -0
- gcore/resources/security/events.py +234 -0
- gcore/resources/security/profile_templates.py +143 -0
- gcore/resources/security/profiles.py +661 -0
- gcore/resources/security/security.py +198 -0
- gcore/types/cloud/cost_report_get_aggregated_monthly_params.py +3 -0
- gcore/types/cloud/cost_report_get_aggregated_params.py +3 -0
- gcore/types/cloud/cost_report_get_detailed_params.py +3 -0
- gcore/types/cloud/gpu_baremetal_flavor.py +16 -0
- gcore/types/cloud/quotas/request_list_params.py +2 -2
- gcore/types/cloud/region.py +6 -3
- gcore/types/fastedge/__init__.py +1 -0
- gcore/types/fastedge/binary_create_params.py +11 -0
- gcore/types/security/__init__.py +18 -0
- gcore/types/security/bgp_announce_change_params.py +16 -0
- gcore/types/security/bgp_announce_list_params.py +18 -0
- gcore/types/security/bgp_announce_list_response.py +10 -0
- gcore/types/security/client_announce.py +15 -0
- gcore/types/security/client_profile.py +56 -0
- gcore/types/security/client_profile_template.py +43 -0
- gcore/types/security/client_view.py +29 -0
- gcore/types/security/event_list_params.py +38 -0
- gcore/types/security/profile_create_params.py +24 -0
- gcore/types/security/profile_list_params.py +17 -0
- gcore/types/security/profile_list_response.py +10 -0
- gcore/types/security/profile_recreate_params.py +24 -0
- gcore/types/security/profile_replace_params.py +24 -0
- gcore/types/security/profile_template_list_response.py +10 -0
- {gcore-0.8.0.dist-info → gcore-0.9.0.dist-info}/METADATA +1 -1
- {gcore-0.8.0.dist-info → gcore-0.9.0.dist-info}/RECORD +41 -19
- {gcore-0.8.0.dist-info → gcore-0.9.0.dist-info}/WHEEL +0 -0
- {gcore-0.8.0.dist-info → gcore-0.9.0.dist-info}/licenses/LICENSE +0 -0
gcore/_base_client.py
CHANGED
|
@@ -532,7 +532,10 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
|
|
|
532
532
|
is_body_allowed = options.method.lower() != "get"
|
|
533
533
|
|
|
534
534
|
if is_body_allowed:
|
|
535
|
-
|
|
535
|
+
if isinstance(json_data, bytes):
|
|
536
|
+
kwargs["content"] = json_data
|
|
537
|
+
else:
|
|
538
|
+
kwargs["json"] = json_data if is_given(json_data) else None
|
|
536
539
|
kwargs["files"] = files
|
|
537
540
|
else:
|
|
538
541
|
headers.pop("Content-Type", None)
|
gcore/_client.py
CHANGED
|
@@ -32,6 +32,7 @@ from .resources.iam import iam
|
|
|
32
32
|
from .resources.waap import waap
|
|
33
33
|
from .resources.cloud import cloud
|
|
34
34
|
from .resources.fastedge import fastedge
|
|
35
|
+
from .resources.security import security
|
|
35
36
|
from .resources.streaming import streaming
|
|
36
37
|
|
|
37
38
|
__all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "Gcore", "AsyncGcore", "Client", "AsyncClient"]
|
|
@@ -43,6 +44,7 @@ class Gcore(SyncAPIClient):
|
|
|
43
44
|
iam: iam.IamResource
|
|
44
45
|
fastedge: fastedge.FastedgeResource
|
|
45
46
|
streaming: streaming.StreamingResource
|
|
47
|
+
security: security.SecurityResource
|
|
46
48
|
with_raw_response: GcoreWithRawResponse
|
|
47
49
|
with_streaming_response: GcoreWithStreamedResponse
|
|
48
50
|
|
|
@@ -126,6 +128,7 @@ class Gcore(SyncAPIClient):
|
|
|
126
128
|
self.iam = iam.IamResource(self)
|
|
127
129
|
self.fastedge = fastedge.FastedgeResource(self)
|
|
128
130
|
self.streaming = streaming.StreamingResource(self)
|
|
131
|
+
self.security = security.SecurityResource(self)
|
|
129
132
|
self.with_raw_response = GcoreWithRawResponse(self)
|
|
130
133
|
self.with_streaming_response = GcoreWithStreamedResponse(self)
|
|
131
134
|
|
|
@@ -264,6 +267,7 @@ class AsyncGcore(AsyncAPIClient):
|
|
|
264
267
|
iam: iam.AsyncIamResource
|
|
265
268
|
fastedge: fastedge.AsyncFastedgeResource
|
|
266
269
|
streaming: streaming.AsyncStreamingResource
|
|
270
|
+
security: security.AsyncSecurityResource
|
|
267
271
|
with_raw_response: AsyncGcoreWithRawResponse
|
|
268
272
|
with_streaming_response: AsyncGcoreWithStreamedResponse
|
|
269
273
|
|
|
@@ -347,6 +351,7 @@ class AsyncGcore(AsyncAPIClient):
|
|
|
347
351
|
self.iam = iam.AsyncIamResource(self)
|
|
348
352
|
self.fastedge = fastedge.AsyncFastedgeResource(self)
|
|
349
353
|
self.streaming = streaming.AsyncStreamingResource(self)
|
|
354
|
+
self.security = security.AsyncSecurityResource(self)
|
|
350
355
|
self.with_raw_response = AsyncGcoreWithRawResponse(self)
|
|
351
356
|
self.with_streaming_response = AsyncGcoreWithStreamedResponse(self)
|
|
352
357
|
|
|
@@ -486,6 +491,7 @@ class GcoreWithRawResponse:
|
|
|
486
491
|
self.iam = iam.IamResourceWithRawResponse(client.iam)
|
|
487
492
|
self.fastedge = fastedge.FastedgeResourceWithRawResponse(client.fastedge)
|
|
488
493
|
self.streaming = streaming.StreamingResourceWithRawResponse(client.streaming)
|
|
494
|
+
self.security = security.SecurityResourceWithRawResponse(client.security)
|
|
489
495
|
|
|
490
496
|
|
|
491
497
|
class AsyncGcoreWithRawResponse:
|
|
@@ -495,6 +501,7 @@ class AsyncGcoreWithRawResponse:
|
|
|
495
501
|
self.iam = iam.AsyncIamResourceWithRawResponse(client.iam)
|
|
496
502
|
self.fastedge = fastedge.AsyncFastedgeResourceWithRawResponse(client.fastedge)
|
|
497
503
|
self.streaming = streaming.AsyncStreamingResourceWithRawResponse(client.streaming)
|
|
504
|
+
self.security = security.AsyncSecurityResourceWithRawResponse(client.security)
|
|
498
505
|
|
|
499
506
|
|
|
500
507
|
class GcoreWithStreamedResponse:
|
|
@@ -504,6 +511,7 @@ class GcoreWithStreamedResponse:
|
|
|
504
511
|
self.iam = iam.IamResourceWithStreamingResponse(client.iam)
|
|
505
512
|
self.fastedge = fastedge.FastedgeResourceWithStreamingResponse(client.fastedge)
|
|
506
513
|
self.streaming = streaming.StreamingResourceWithStreamingResponse(client.streaming)
|
|
514
|
+
self.security = security.SecurityResourceWithStreamingResponse(client.security)
|
|
507
515
|
|
|
508
516
|
|
|
509
517
|
class AsyncGcoreWithStreamedResponse:
|
|
@@ -513,6 +521,7 @@ class AsyncGcoreWithStreamedResponse:
|
|
|
513
521
|
self.iam = iam.AsyncIamResourceWithStreamingResponse(client.iam)
|
|
514
522
|
self.fastedge = fastedge.AsyncFastedgeResourceWithStreamingResponse(client.fastedge)
|
|
515
523
|
self.streaming = streaming.AsyncStreamingResourceWithStreamingResponse(client.streaming)
|
|
524
|
+
self.security = security.AsyncSecurityResourceWithStreamingResponse(client.security)
|
|
516
525
|
|
|
517
526
|
|
|
518
527
|
Client = Gcore
|
gcore/_files.py
CHANGED
|
@@ -69,12 +69,12 @@ def _transform_file(file: FileTypes) -> HttpxFileTypes:
|
|
|
69
69
|
return file
|
|
70
70
|
|
|
71
71
|
if is_tuple_t(file):
|
|
72
|
-
return (file[0],
|
|
72
|
+
return (file[0], read_file_content(file[1]), *file[2:])
|
|
73
73
|
|
|
74
74
|
raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple")
|
|
75
75
|
|
|
76
76
|
|
|
77
|
-
def
|
|
77
|
+
def read_file_content(file: FileContent) -> HttpxFileContent:
|
|
78
78
|
if isinstance(file, os.PathLike):
|
|
79
79
|
return pathlib.Path(file).read_bytes()
|
|
80
80
|
return file
|
|
@@ -111,12 +111,12 @@ async def _async_transform_file(file: FileTypes) -> HttpxFileTypes:
|
|
|
111
111
|
return file
|
|
112
112
|
|
|
113
113
|
if is_tuple_t(file):
|
|
114
|
-
return (file[0], await
|
|
114
|
+
return (file[0], await async_read_file_content(file[1]), *file[2:])
|
|
115
115
|
|
|
116
116
|
raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple")
|
|
117
117
|
|
|
118
118
|
|
|
119
|
-
async def
|
|
119
|
+
async def async_read_file_content(file: FileContent) -> HttpxFileContent:
|
|
120
120
|
if isinstance(file, os.PathLike):
|
|
121
121
|
return await anyio.Path(file).read_bytes()
|
|
122
122
|
|
gcore/_version.py
CHANGED
gcore/resources/__init__.py
CHANGED
|
@@ -32,6 +32,14 @@ from .fastedge import (
|
|
|
32
32
|
FastedgeResourceWithStreamingResponse,
|
|
33
33
|
AsyncFastedgeResourceWithStreamingResponse,
|
|
34
34
|
)
|
|
35
|
+
from .security import (
|
|
36
|
+
SecurityResource,
|
|
37
|
+
AsyncSecurityResource,
|
|
38
|
+
SecurityResourceWithRawResponse,
|
|
39
|
+
AsyncSecurityResourceWithRawResponse,
|
|
40
|
+
SecurityResourceWithStreamingResponse,
|
|
41
|
+
AsyncSecurityResourceWithStreamingResponse,
|
|
42
|
+
)
|
|
35
43
|
from .streaming import (
|
|
36
44
|
StreamingResource,
|
|
37
45
|
AsyncStreamingResource,
|
|
@@ -72,4 +80,10 @@ __all__ = [
|
|
|
72
80
|
"AsyncStreamingResourceWithRawResponse",
|
|
73
81
|
"StreamingResourceWithStreamingResponse",
|
|
74
82
|
"AsyncStreamingResourceWithStreamingResponse",
|
|
83
|
+
"SecurityResource",
|
|
84
|
+
"AsyncSecurityResource",
|
|
85
|
+
"SecurityResourceWithRawResponse",
|
|
86
|
+
"AsyncSecurityResourceWithRawResponse",
|
|
87
|
+
"SecurityResourceWithStreamingResponse",
|
|
88
|
+
"AsyncSecurityResourceWithStreamingResponse",
|
|
75
89
|
]
|
|
@@ -60,6 +60,7 @@ class CostReportsResource(SyncAPIResource):
|
|
|
60
60
|
projects: Iterable[int] | NotGiven = NOT_GIVEN,
|
|
61
61
|
regions: Iterable[int] | NotGiven = NOT_GIVEN,
|
|
62
62
|
response_format: Literal["csv_totals", "json"] | NotGiven = NOT_GIVEN,
|
|
63
|
+
rounding: bool | NotGiven = NOT_GIVEN,
|
|
63
64
|
schema_filter: cost_report_get_aggregated_params.SchemaFilter | NotGiven = NOT_GIVEN,
|
|
64
65
|
tags: cost_report_get_aggregated_params.Tags | NotGiven = NOT_GIVEN,
|
|
65
66
|
types: List[
|
|
@@ -128,6 +129,8 @@ class CostReportsResource(SyncAPIResource):
|
|
|
128
129
|
|
|
129
130
|
response_format: Format of the response (csv or json).
|
|
130
131
|
|
|
132
|
+
rounding: Round cost values to 5 decimal places. When false, returns full precision.
|
|
133
|
+
|
|
131
134
|
schema_filter: Extended filter for field filtering.
|
|
132
135
|
|
|
133
136
|
tags: Filter by tags
|
|
@@ -152,6 +155,7 @@ class CostReportsResource(SyncAPIResource):
|
|
|
152
155
|
"projects": projects,
|
|
153
156
|
"regions": regions,
|
|
154
157
|
"response_format": response_format,
|
|
158
|
+
"rounding": rounding,
|
|
155
159
|
"schema_filter": schema_filter,
|
|
156
160
|
"tags": tags,
|
|
157
161
|
"types": types,
|
|
@@ -171,6 +175,7 @@ class CostReportsResource(SyncAPIResource):
|
|
|
171
175
|
time_to: Union[str, datetime],
|
|
172
176
|
regions: Iterable[int] | NotGiven = NOT_GIVEN,
|
|
173
177
|
response_format: Literal["csv_totals", "json"] | NotGiven = NOT_GIVEN,
|
|
178
|
+
rounding: bool | NotGiven = NOT_GIVEN,
|
|
174
179
|
schema_filter: cost_report_get_aggregated_monthly_params.SchemaFilter | NotGiven = NOT_GIVEN,
|
|
175
180
|
tags: cost_report_get_aggregated_monthly_params.Tags | NotGiven = NOT_GIVEN,
|
|
176
181
|
types: List[
|
|
@@ -230,6 +235,8 @@ class CostReportsResource(SyncAPIResource):
|
|
|
230
235
|
|
|
231
236
|
response_format: Format of the response (`csv_totals` or json).
|
|
232
237
|
|
|
238
|
+
rounding: Round cost values to 5 decimal places. When false, returns full precision.
|
|
239
|
+
|
|
233
240
|
schema_filter: Extended filter for field filtering.
|
|
234
241
|
|
|
235
242
|
tags: Filter by tags
|
|
@@ -252,6 +259,7 @@ class CostReportsResource(SyncAPIResource):
|
|
|
252
259
|
"time_to": time_to,
|
|
253
260
|
"regions": regions,
|
|
254
261
|
"response_format": response_format,
|
|
262
|
+
"rounding": rounding,
|
|
255
263
|
"schema_filter": schema_filter,
|
|
256
264
|
"tags": tags,
|
|
257
265
|
"types": types,
|
|
@@ -275,6 +283,7 @@ class CostReportsResource(SyncAPIResource):
|
|
|
275
283
|
projects: Iterable[int] | NotGiven = NOT_GIVEN,
|
|
276
284
|
regions: Iterable[int] | NotGiven = NOT_GIVEN,
|
|
277
285
|
response_format: Literal["csv_records", "json"] | NotGiven = NOT_GIVEN,
|
|
286
|
+
rounding: bool | NotGiven = NOT_GIVEN,
|
|
278
287
|
schema_filter: cost_report_get_detailed_params.SchemaFilter | NotGiven = NOT_GIVEN,
|
|
279
288
|
sorting: Iterable[cost_report_get_detailed_params.Sorting] | NotGiven = NOT_GIVEN,
|
|
280
289
|
tags: cost_report_get_detailed_params.Tags | NotGiven = NOT_GIVEN,
|
|
@@ -349,6 +358,8 @@ class CostReportsResource(SyncAPIResource):
|
|
|
349
358
|
|
|
350
359
|
response_format: Format of the response (csv or json).
|
|
351
360
|
|
|
361
|
+
rounding: Round cost values to 5 decimal places. When false, returns full precision.
|
|
362
|
+
|
|
352
363
|
schema_filter: Extended filter for field filtering.
|
|
353
364
|
|
|
354
365
|
sorting: List of sorting filters (JSON objects) fields: project. directions: asc, desc.
|
|
@@ -377,6 +388,7 @@ class CostReportsResource(SyncAPIResource):
|
|
|
377
388
|
"projects": projects,
|
|
378
389
|
"regions": regions,
|
|
379
390
|
"response_format": response_format,
|
|
391
|
+
"rounding": rounding,
|
|
380
392
|
"schema_filter": schema_filter,
|
|
381
393
|
"sorting": sorting,
|
|
382
394
|
"tags": tags,
|
|
@@ -420,6 +432,7 @@ class AsyncCostReportsResource(AsyncAPIResource):
|
|
|
420
432
|
projects: Iterable[int] | NotGiven = NOT_GIVEN,
|
|
421
433
|
regions: Iterable[int] | NotGiven = NOT_GIVEN,
|
|
422
434
|
response_format: Literal["csv_totals", "json"] | NotGiven = NOT_GIVEN,
|
|
435
|
+
rounding: bool | NotGiven = NOT_GIVEN,
|
|
423
436
|
schema_filter: cost_report_get_aggregated_params.SchemaFilter | NotGiven = NOT_GIVEN,
|
|
424
437
|
tags: cost_report_get_aggregated_params.Tags | NotGiven = NOT_GIVEN,
|
|
425
438
|
types: List[
|
|
@@ -488,6 +501,8 @@ class AsyncCostReportsResource(AsyncAPIResource):
|
|
|
488
501
|
|
|
489
502
|
response_format: Format of the response (csv or json).
|
|
490
503
|
|
|
504
|
+
rounding: Round cost values to 5 decimal places. When false, returns full precision.
|
|
505
|
+
|
|
491
506
|
schema_filter: Extended filter for field filtering.
|
|
492
507
|
|
|
493
508
|
tags: Filter by tags
|
|
@@ -512,6 +527,7 @@ class AsyncCostReportsResource(AsyncAPIResource):
|
|
|
512
527
|
"projects": projects,
|
|
513
528
|
"regions": regions,
|
|
514
529
|
"response_format": response_format,
|
|
530
|
+
"rounding": rounding,
|
|
515
531
|
"schema_filter": schema_filter,
|
|
516
532
|
"tags": tags,
|
|
517
533
|
"types": types,
|
|
@@ -531,6 +547,7 @@ class AsyncCostReportsResource(AsyncAPIResource):
|
|
|
531
547
|
time_to: Union[str, datetime],
|
|
532
548
|
regions: Iterable[int] | NotGiven = NOT_GIVEN,
|
|
533
549
|
response_format: Literal["csv_totals", "json"] | NotGiven = NOT_GIVEN,
|
|
550
|
+
rounding: bool | NotGiven = NOT_GIVEN,
|
|
534
551
|
schema_filter: cost_report_get_aggregated_monthly_params.SchemaFilter | NotGiven = NOT_GIVEN,
|
|
535
552
|
tags: cost_report_get_aggregated_monthly_params.Tags | NotGiven = NOT_GIVEN,
|
|
536
553
|
types: List[
|
|
@@ -590,6 +607,8 @@ class AsyncCostReportsResource(AsyncAPIResource):
|
|
|
590
607
|
|
|
591
608
|
response_format: Format of the response (`csv_totals` or json).
|
|
592
609
|
|
|
610
|
+
rounding: Round cost values to 5 decimal places. When false, returns full precision.
|
|
611
|
+
|
|
593
612
|
schema_filter: Extended filter for field filtering.
|
|
594
613
|
|
|
595
614
|
tags: Filter by tags
|
|
@@ -612,6 +631,7 @@ class AsyncCostReportsResource(AsyncAPIResource):
|
|
|
612
631
|
"time_to": time_to,
|
|
613
632
|
"regions": regions,
|
|
614
633
|
"response_format": response_format,
|
|
634
|
+
"rounding": rounding,
|
|
615
635
|
"schema_filter": schema_filter,
|
|
616
636
|
"tags": tags,
|
|
617
637
|
"types": types,
|
|
@@ -635,6 +655,7 @@ class AsyncCostReportsResource(AsyncAPIResource):
|
|
|
635
655
|
projects: Iterable[int] | NotGiven = NOT_GIVEN,
|
|
636
656
|
regions: Iterable[int] | NotGiven = NOT_GIVEN,
|
|
637
657
|
response_format: Literal["csv_records", "json"] | NotGiven = NOT_GIVEN,
|
|
658
|
+
rounding: bool | NotGiven = NOT_GIVEN,
|
|
638
659
|
schema_filter: cost_report_get_detailed_params.SchemaFilter | NotGiven = NOT_GIVEN,
|
|
639
660
|
sorting: Iterable[cost_report_get_detailed_params.Sorting] | NotGiven = NOT_GIVEN,
|
|
640
661
|
tags: cost_report_get_detailed_params.Tags | NotGiven = NOT_GIVEN,
|
|
@@ -709,6 +730,8 @@ class AsyncCostReportsResource(AsyncAPIResource):
|
|
|
709
730
|
|
|
710
731
|
response_format: Format of the response (csv or json).
|
|
711
732
|
|
|
733
|
+
rounding: Round cost values to 5 decimal places. When false, returns full precision.
|
|
734
|
+
|
|
712
735
|
schema_filter: Extended filter for field filtering.
|
|
713
736
|
|
|
714
737
|
sorting: List of sorting filters (JSON objects) fields: project. directions: asc, desc.
|
|
@@ -737,6 +760,7 @@ class AsyncCostReportsResource(AsyncAPIResource):
|
|
|
737
760
|
"projects": projects,
|
|
738
761
|
"regions": regions,
|
|
739
762
|
"response_format": response_format,
|
|
763
|
+
"rounding": rounding,
|
|
740
764
|
"schema_filter": schema_filter,
|
|
741
765
|
"sorting": sorting,
|
|
742
766
|
"tags": tags,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import List
|
|
5
|
+
from typing import List
|
|
6
6
|
from typing_extensions import Literal
|
|
7
7
|
|
|
8
8
|
import httpx
|
|
@@ -99,7 +99,7 @@ class RequestsResource(SyncAPIResource):
|
|
|
99
99
|
*,
|
|
100
100
|
limit: int | NotGiven = NOT_GIVEN,
|
|
101
101
|
offset: int | NotGiven = NOT_GIVEN,
|
|
102
|
-
status:
|
|
102
|
+
status: List[Literal["done", "in progress", "rejected"]] | NotGiven = NOT_GIVEN,
|
|
103
103
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
104
104
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
105
105
|
extra_headers: Headers | None = None,
|
|
@@ -148,7 +148,7 @@ class RequestsResource(SyncAPIResource):
|
|
|
148
148
|
|
|
149
149
|
def delete(
|
|
150
150
|
self,
|
|
151
|
-
request_id:
|
|
151
|
+
request_id: int,
|
|
152
152
|
*,
|
|
153
153
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
154
154
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -171,8 +171,6 @@ class RequestsResource(SyncAPIResource):
|
|
|
171
171
|
|
|
172
172
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
173
173
|
"""
|
|
174
|
-
if not request_id:
|
|
175
|
-
raise ValueError(f"Expected a non-empty value for `request_id` but received {request_id!r}")
|
|
176
174
|
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
177
175
|
return self._delete(
|
|
178
176
|
f"/cloud/v2/limits_request/{request_id}",
|
|
@@ -184,7 +182,7 @@ class RequestsResource(SyncAPIResource):
|
|
|
184
182
|
|
|
185
183
|
def get(
|
|
186
184
|
self,
|
|
187
|
-
request_id:
|
|
185
|
+
request_id: int,
|
|
188
186
|
*,
|
|
189
187
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
190
188
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -207,8 +205,6 @@ class RequestsResource(SyncAPIResource):
|
|
|
207
205
|
|
|
208
206
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
209
207
|
"""
|
|
210
|
-
if not request_id:
|
|
211
|
-
raise ValueError(f"Expected a non-empty value for `request_id` but received {request_id!r}")
|
|
212
208
|
return self._get(
|
|
213
209
|
f"/cloud/v2/limits_request/{request_id}",
|
|
214
210
|
options=make_request_options(
|
|
@@ -291,7 +287,7 @@ class AsyncRequestsResource(AsyncAPIResource):
|
|
|
291
287
|
*,
|
|
292
288
|
limit: int | NotGiven = NOT_GIVEN,
|
|
293
289
|
offset: int | NotGiven = NOT_GIVEN,
|
|
294
|
-
status:
|
|
290
|
+
status: List[Literal["done", "in progress", "rejected"]] | NotGiven = NOT_GIVEN,
|
|
295
291
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
296
292
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
297
293
|
extra_headers: Headers | None = None,
|
|
@@ -340,7 +336,7 @@ class AsyncRequestsResource(AsyncAPIResource):
|
|
|
340
336
|
|
|
341
337
|
async def delete(
|
|
342
338
|
self,
|
|
343
|
-
request_id:
|
|
339
|
+
request_id: int,
|
|
344
340
|
*,
|
|
345
341
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
346
342
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -363,8 +359,6 @@ class AsyncRequestsResource(AsyncAPIResource):
|
|
|
363
359
|
|
|
364
360
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
365
361
|
"""
|
|
366
|
-
if not request_id:
|
|
367
|
-
raise ValueError(f"Expected a non-empty value for `request_id` but received {request_id!r}")
|
|
368
362
|
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
369
363
|
return await self._delete(
|
|
370
364
|
f"/cloud/v2/limits_request/{request_id}",
|
|
@@ -376,7 +370,7 @@ class AsyncRequestsResource(AsyncAPIResource):
|
|
|
376
370
|
|
|
377
371
|
async def get(
|
|
378
372
|
self,
|
|
379
|
-
request_id:
|
|
373
|
+
request_id: int,
|
|
380
374
|
*,
|
|
381
375
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
382
376
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -399,8 +393,6 @@ class AsyncRequestsResource(AsyncAPIResource):
|
|
|
399
393
|
|
|
400
394
|
timeout: Override the client-level default timeout for this request, in seconds
|
|
401
395
|
"""
|
|
402
|
-
if not request_id:
|
|
403
|
-
raise ValueError(f"Expected a non-empty value for `request_id` but received {request_id!r}")
|
|
404
396
|
return await self._get(
|
|
405
397
|
f"/cloud/v2/limits_request/{request_id}",
|
|
406
398
|
options=make_request_options(
|
|
@@ -4,7 +4,8 @@ from __future__ import annotations
|
|
|
4
4
|
|
|
5
5
|
import httpx
|
|
6
6
|
|
|
7
|
-
from ...
|
|
7
|
+
from ..._files import read_file_content, async_read_file_content
|
|
8
|
+
from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven, FileContent
|
|
8
9
|
from ..._compat import cached_property
|
|
9
10
|
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
10
11
|
from ..._response import (
|
|
@@ -15,6 +16,7 @@ from ..._response import (
|
|
|
15
16
|
)
|
|
16
17
|
from ..._base_client import make_request_options
|
|
17
18
|
from ...types.fastedge.binary import Binary
|
|
19
|
+
from ...types.fastedge.binary_short import BinaryShort
|
|
18
20
|
from ...types.fastedge.binary_list_response import BinaryListResponse
|
|
19
21
|
|
|
20
22
|
__all__ = ["BinariesResource", "AsyncBinariesResource"]
|
|
@@ -40,6 +42,39 @@ class BinariesResource(SyncAPIResource):
|
|
|
40
42
|
"""
|
|
41
43
|
return BinariesResourceWithStreamingResponse(self)
|
|
42
44
|
|
|
45
|
+
def create(
|
|
46
|
+
self,
|
|
47
|
+
body: FileContent,
|
|
48
|
+
*,
|
|
49
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
50
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
51
|
+
extra_headers: Headers | None = None,
|
|
52
|
+
extra_query: Query | None = None,
|
|
53
|
+
extra_body: Body | None = None,
|
|
54
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
55
|
+
) -> BinaryShort:
|
|
56
|
+
"""
|
|
57
|
+
Store compiled WASM binary
|
|
58
|
+
|
|
59
|
+
Args:
|
|
60
|
+
extra_headers: Send extra headers
|
|
61
|
+
|
|
62
|
+
extra_query: Add additional query parameters to the request
|
|
63
|
+
|
|
64
|
+
extra_body: Add additional JSON properties to the request
|
|
65
|
+
|
|
66
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
67
|
+
"""
|
|
68
|
+
extra_headers = {"Content-Type": "application/octet-stream", **(extra_headers or {})}
|
|
69
|
+
return self._post(
|
|
70
|
+
"/fastedge/v1/binaries/raw",
|
|
71
|
+
body=read_file_content(body),
|
|
72
|
+
options=make_request_options(
|
|
73
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
74
|
+
),
|
|
75
|
+
cast_to=BinaryShort,
|
|
76
|
+
)
|
|
77
|
+
|
|
43
78
|
def list(
|
|
44
79
|
self,
|
|
45
80
|
*,
|
|
@@ -143,6 +178,39 @@ class AsyncBinariesResource(AsyncAPIResource):
|
|
|
143
178
|
"""
|
|
144
179
|
return AsyncBinariesResourceWithStreamingResponse(self)
|
|
145
180
|
|
|
181
|
+
async def create(
|
|
182
|
+
self,
|
|
183
|
+
body: FileContent,
|
|
184
|
+
*,
|
|
185
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
186
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
187
|
+
extra_headers: Headers | None = None,
|
|
188
|
+
extra_query: Query | None = None,
|
|
189
|
+
extra_body: Body | None = None,
|
|
190
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
191
|
+
) -> BinaryShort:
|
|
192
|
+
"""
|
|
193
|
+
Store compiled WASM binary
|
|
194
|
+
|
|
195
|
+
Args:
|
|
196
|
+
extra_headers: Send extra headers
|
|
197
|
+
|
|
198
|
+
extra_query: Add additional query parameters to the request
|
|
199
|
+
|
|
200
|
+
extra_body: Add additional JSON properties to the request
|
|
201
|
+
|
|
202
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
203
|
+
"""
|
|
204
|
+
extra_headers = {"Content-Type": "application/octet-stream", **(extra_headers or {})}
|
|
205
|
+
return await self._post(
|
|
206
|
+
"/fastedge/v1/binaries/raw",
|
|
207
|
+
body=await async_read_file_content(body),
|
|
208
|
+
options=make_request_options(
|
|
209
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
210
|
+
),
|
|
211
|
+
cast_to=BinaryShort,
|
|
212
|
+
)
|
|
213
|
+
|
|
146
214
|
async def list(
|
|
147
215
|
self,
|
|
148
216
|
*,
|
|
@@ -230,6 +298,9 @@ class BinariesResourceWithRawResponse:
|
|
|
230
298
|
def __init__(self, binaries: BinariesResource) -> None:
|
|
231
299
|
self._binaries = binaries
|
|
232
300
|
|
|
301
|
+
self.create = to_raw_response_wrapper(
|
|
302
|
+
binaries.create,
|
|
303
|
+
)
|
|
233
304
|
self.list = to_raw_response_wrapper(
|
|
234
305
|
binaries.list,
|
|
235
306
|
)
|
|
@@ -245,6 +316,9 @@ class AsyncBinariesResourceWithRawResponse:
|
|
|
245
316
|
def __init__(self, binaries: AsyncBinariesResource) -> None:
|
|
246
317
|
self._binaries = binaries
|
|
247
318
|
|
|
319
|
+
self.create = async_to_raw_response_wrapper(
|
|
320
|
+
binaries.create,
|
|
321
|
+
)
|
|
248
322
|
self.list = async_to_raw_response_wrapper(
|
|
249
323
|
binaries.list,
|
|
250
324
|
)
|
|
@@ -260,6 +334,9 @@ class BinariesResourceWithStreamingResponse:
|
|
|
260
334
|
def __init__(self, binaries: BinariesResource) -> None:
|
|
261
335
|
self._binaries = binaries
|
|
262
336
|
|
|
337
|
+
self.create = to_streamed_response_wrapper(
|
|
338
|
+
binaries.create,
|
|
339
|
+
)
|
|
263
340
|
self.list = to_streamed_response_wrapper(
|
|
264
341
|
binaries.list,
|
|
265
342
|
)
|
|
@@ -275,6 +352,9 @@ class AsyncBinariesResourceWithStreamingResponse:
|
|
|
275
352
|
def __init__(self, binaries: AsyncBinariesResource) -> None:
|
|
276
353
|
self._binaries = binaries
|
|
277
354
|
|
|
355
|
+
self.create = async_to_streamed_response_wrapper(
|
|
356
|
+
binaries.create,
|
|
357
|
+
)
|
|
278
358
|
self.list = async_to_streamed_response_wrapper(
|
|
279
359
|
binaries.list,
|
|
280
360
|
)
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from .events import (
|
|
4
|
+
EventsResource,
|
|
5
|
+
AsyncEventsResource,
|
|
6
|
+
EventsResourceWithRawResponse,
|
|
7
|
+
AsyncEventsResourceWithRawResponse,
|
|
8
|
+
EventsResourceWithStreamingResponse,
|
|
9
|
+
AsyncEventsResourceWithStreamingResponse,
|
|
10
|
+
)
|
|
11
|
+
from .profiles import (
|
|
12
|
+
ProfilesResource,
|
|
13
|
+
AsyncProfilesResource,
|
|
14
|
+
ProfilesResourceWithRawResponse,
|
|
15
|
+
AsyncProfilesResourceWithRawResponse,
|
|
16
|
+
ProfilesResourceWithStreamingResponse,
|
|
17
|
+
AsyncProfilesResourceWithStreamingResponse,
|
|
18
|
+
)
|
|
19
|
+
from .security import (
|
|
20
|
+
SecurityResource,
|
|
21
|
+
AsyncSecurityResource,
|
|
22
|
+
SecurityResourceWithRawResponse,
|
|
23
|
+
AsyncSecurityResourceWithRawResponse,
|
|
24
|
+
SecurityResourceWithStreamingResponse,
|
|
25
|
+
AsyncSecurityResourceWithStreamingResponse,
|
|
26
|
+
)
|
|
27
|
+
from .bgp_announces import (
|
|
28
|
+
BgpAnnouncesResource,
|
|
29
|
+
AsyncBgpAnnouncesResource,
|
|
30
|
+
BgpAnnouncesResourceWithRawResponse,
|
|
31
|
+
AsyncBgpAnnouncesResourceWithRawResponse,
|
|
32
|
+
BgpAnnouncesResourceWithStreamingResponse,
|
|
33
|
+
AsyncBgpAnnouncesResourceWithStreamingResponse,
|
|
34
|
+
)
|
|
35
|
+
from .profile_templates import (
|
|
36
|
+
ProfileTemplatesResource,
|
|
37
|
+
AsyncProfileTemplatesResource,
|
|
38
|
+
ProfileTemplatesResourceWithRawResponse,
|
|
39
|
+
AsyncProfileTemplatesResourceWithRawResponse,
|
|
40
|
+
ProfileTemplatesResourceWithStreamingResponse,
|
|
41
|
+
AsyncProfileTemplatesResourceWithStreamingResponse,
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
__all__ = [
|
|
45
|
+
"EventsResource",
|
|
46
|
+
"AsyncEventsResource",
|
|
47
|
+
"EventsResourceWithRawResponse",
|
|
48
|
+
"AsyncEventsResourceWithRawResponse",
|
|
49
|
+
"EventsResourceWithStreamingResponse",
|
|
50
|
+
"AsyncEventsResourceWithStreamingResponse",
|
|
51
|
+
"BgpAnnouncesResource",
|
|
52
|
+
"AsyncBgpAnnouncesResource",
|
|
53
|
+
"BgpAnnouncesResourceWithRawResponse",
|
|
54
|
+
"AsyncBgpAnnouncesResourceWithRawResponse",
|
|
55
|
+
"BgpAnnouncesResourceWithStreamingResponse",
|
|
56
|
+
"AsyncBgpAnnouncesResourceWithStreamingResponse",
|
|
57
|
+
"ProfileTemplatesResource",
|
|
58
|
+
"AsyncProfileTemplatesResource",
|
|
59
|
+
"ProfileTemplatesResourceWithRawResponse",
|
|
60
|
+
"AsyncProfileTemplatesResourceWithRawResponse",
|
|
61
|
+
"ProfileTemplatesResourceWithStreamingResponse",
|
|
62
|
+
"AsyncProfileTemplatesResourceWithStreamingResponse",
|
|
63
|
+
"ProfilesResource",
|
|
64
|
+
"AsyncProfilesResource",
|
|
65
|
+
"ProfilesResourceWithRawResponse",
|
|
66
|
+
"AsyncProfilesResourceWithRawResponse",
|
|
67
|
+
"ProfilesResourceWithStreamingResponse",
|
|
68
|
+
"AsyncProfilesResourceWithStreamingResponse",
|
|
69
|
+
"SecurityResource",
|
|
70
|
+
"AsyncSecurityResource",
|
|
71
|
+
"SecurityResourceWithRawResponse",
|
|
72
|
+
"AsyncSecurityResourceWithRawResponse",
|
|
73
|
+
"SecurityResourceWithStreamingResponse",
|
|
74
|
+
"AsyncSecurityResourceWithStreamingResponse",
|
|
75
|
+
]
|