gcore 0.11.0__py3-none-any.whl → 0.13.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of gcore might be problematic. Click here for more details.
- gcore/_version.py +1 -1
- gcore/resources/cloud/floating_ips.py +177 -1
- gcore/resources/cloud/reserved_fixed_ips/reserved_fixed_ips.py +608 -0
- gcore/resources/cloud/volumes.py +1121 -219
- gcore/resources/dns/zones/zones.py +2 -2
- gcore/resources/storage/storage.py +18 -14
- gcore/resources/waap/ip_info/ip_info.py +5 -5
- gcore/types/cloud/__init__.py +1 -0
- gcore/types/cloud/floating_ip.py +1 -1
- gcore/types/cloud/floating_ip_detailed.py +1 -1
- gcore/types/cloud/floating_ip_update_params.py +41 -0
- gcore/types/storage/storage_update_params.py +4 -4
- gcore/types/waap/__init__.py +2 -1
- gcore/types/waap/ip_info_get_top_urls_response.py +3 -12
- gcore/types/waap/{ip_info_get_ip_info_response.py → waap_ip_info.py} +2 -2
- gcore/types/waap/waap_top_url.py +13 -0
- {gcore-0.11.0.dist-info → gcore-0.13.0.dist-info}/METADATA +1 -1
- {gcore-0.11.0.dist-info → gcore-0.13.0.dist-info}/RECORD +20 -18
- {gcore-0.11.0.dist-info → gcore-0.13.0.dist-info}/WHEEL +0 -0
- {gcore-0.11.0.dist-info → gcore-0.13.0.dist-info}/licenses/LICENSE +0 -0
gcore/_version.py
CHANGED
|
@@ -17,11 +17,17 @@ from ..._response import (
|
|
|
17
17
|
async_to_streamed_response_wrapper,
|
|
18
18
|
)
|
|
19
19
|
from ...pagination import SyncOffsetPage, AsyncOffsetPage
|
|
20
|
-
from ...types.cloud import
|
|
20
|
+
from ...types.cloud import (
|
|
21
|
+
floating_ip_list_params,
|
|
22
|
+
floating_ip_assign_params,
|
|
23
|
+
floating_ip_create_params,
|
|
24
|
+
floating_ip_update_params,
|
|
25
|
+
)
|
|
21
26
|
from ..._base_client import AsyncPaginator, make_request_options
|
|
22
27
|
from ...types.cloud.floating_ip import FloatingIP
|
|
23
28
|
from ...types.cloud.task_id_list import TaskIDList
|
|
24
29
|
from ...types.cloud.floating_ip_detailed import FloatingIPDetailed
|
|
30
|
+
from ...types.cloud.tag_update_map_param import TagUpdateMapParam
|
|
25
31
|
|
|
26
32
|
__all__ = ["FloatingIPsResource", "AsyncFloatingIPsResource"]
|
|
27
33
|
|
|
@@ -109,6 +115,73 @@ class FloatingIPsResource(SyncAPIResource):
|
|
|
109
115
|
cast_to=TaskIDList,
|
|
110
116
|
)
|
|
111
117
|
|
|
118
|
+
def update(
|
|
119
|
+
self,
|
|
120
|
+
floating_ip_id: str,
|
|
121
|
+
*,
|
|
122
|
+
project_id: int | None = None,
|
|
123
|
+
region_id: int | None = None,
|
|
124
|
+
tags: Optional[TagUpdateMapParam] | NotGiven = NOT_GIVEN,
|
|
125
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
126
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
127
|
+
extra_headers: Headers | None = None,
|
|
128
|
+
extra_query: Query | None = None,
|
|
129
|
+
extra_body: Body | None = None,
|
|
130
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
131
|
+
) -> FloatingIP:
|
|
132
|
+
"""
|
|
133
|
+
Update floating IP
|
|
134
|
+
|
|
135
|
+
Args:
|
|
136
|
+
project_id: Project ID
|
|
137
|
+
|
|
138
|
+
region_id: Region ID
|
|
139
|
+
|
|
140
|
+
floating_ip_id: Floating IP ID
|
|
141
|
+
|
|
142
|
+
tags: Update key-value tags using JSON Merge Patch semantics (RFC 7386). Provide
|
|
143
|
+
key-value pairs to add or update tags. Set tag values to `null` to remove tags.
|
|
144
|
+
Unspecified tags remain unchanged. Read-only tags are always preserved and
|
|
145
|
+
cannot be modified. **Examples:**
|
|
146
|
+
|
|
147
|
+
- **Add/update tags:**
|
|
148
|
+
`{'tags': {'environment': 'production', 'team': 'backend'}}` adds new tags or
|
|
149
|
+
updates existing ones.
|
|
150
|
+
- **Delete tags:** `{'tags': {'`old_tag`': null}}` removes specific tags.
|
|
151
|
+
- **Remove all tags:** `{'tags': null}` removes all user-managed tags (read-only
|
|
152
|
+
tags are preserved).
|
|
153
|
+
- **Partial update:** `{'tags': {'environment': 'staging'}}` only updates
|
|
154
|
+
specified tags.
|
|
155
|
+
- **Mixed operations:**
|
|
156
|
+
`{'tags': {'environment': 'production', '`cost_center`': 'engineering', '`deprecated_tag`': null}}`
|
|
157
|
+
adds/updates 'environment' and '`cost_center`' while removing
|
|
158
|
+
'`deprecated_tag`', preserving other existing tags.
|
|
159
|
+
- **Replace all:** first delete existing tags with null values, then add new
|
|
160
|
+
ones in the same request.
|
|
161
|
+
|
|
162
|
+
extra_headers: Send extra headers
|
|
163
|
+
|
|
164
|
+
extra_query: Add additional query parameters to the request
|
|
165
|
+
|
|
166
|
+
extra_body: Add additional JSON properties to the request
|
|
167
|
+
|
|
168
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
169
|
+
"""
|
|
170
|
+
if project_id is None:
|
|
171
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
172
|
+
if region_id is None:
|
|
173
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
174
|
+
if not floating_ip_id:
|
|
175
|
+
raise ValueError(f"Expected a non-empty value for `floating_ip_id` but received {floating_ip_id!r}")
|
|
176
|
+
return self._patch(
|
|
177
|
+
f"/cloud/v1/floatingips/{project_id}/{region_id}/{floating_ip_id}",
|
|
178
|
+
body=maybe_transform({"tags": tags}, floating_ip_update_params.FloatingIPUpdateParams),
|
|
179
|
+
options=make_request_options(
|
|
180
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
181
|
+
),
|
|
182
|
+
cast_to=FloatingIP,
|
|
183
|
+
)
|
|
184
|
+
|
|
112
185
|
def list(
|
|
113
186
|
self,
|
|
114
187
|
*,
|
|
@@ -192,6 +265,12 @@ class FloatingIPsResource(SyncAPIResource):
|
|
|
192
265
|
Delete floating IP
|
|
193
266
|
|
|
194
267
|
Args:
|
|
268
|
+
project_id: Project ID
|
|
269
|
+
|
|
270
|
+
region_id: Region ID
|
|
271
|
+
|
|
272
|
+
floating_ip_id: Floating IP ID
|
|
273
|
+
|
|
195
274
|
extra_headers: Send extra headers
|
|
196
275
|
|
|
197
276
|
extra_query: Add additional query parameters to the request
|
|
@@ -283,6 +362,12 @@ class FloatingIPsResource(SyncAPIResource):
|
|
|
283
362
|
Get floating IP
|
|
284
363
|
|
|
285
364
|
Args:
|
|
365
|
+
project_id: Project ID
|
|
366
|
+
|
|
367
|
+
region_id: Region ID
|
|
368
|
+
|
|
369
|
+
floating_ip_id: Floating IP ID
|
|
370
|
+
|
|
286
371
|
extra_headers: Send extra headers
|
|
287
372
|
|
|
288
373
|
extra_query: Add additional query parameters to the request
|
|
@@ -512,6 +597,73 @@ class AsyncFloatingIPsResource(AsyncAPIResource):
|
|
|
512
597
|
cast_to=TaskIDList,
|
|
513
598
|
)
|
|
514
599
|
|
|
600
|
+
async def update(
|
|
601
|
+
self,
|
|
602
|
+
floating_ip_id: str,
|
|
603
|
+
*,
|
|
604
|
+
project_id: int | None = None,
|
|
605
|
+
region_id: int | None = None,
|
|
606
|
+
tags: Optional[TagUpdateMapParam] | NotGiven = NOT_GIVEN,
|
|
607
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
608
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
609
|
+
extra_headers: Headers | None = None,
|
|
610
|
+
extra_query: Query | None = None,
|
|
611
|
+
extra_body: Body | None = None,
|
|
612
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
|
613
|
+
) -> FloatingIP:
|
|
614
|
+
"""
|
|
615
|
+
Update floating IP
|
|
616
|
+
|
|
617
|
+
Args:
|
|
618
|
+
project_id: Project ID
|
|
619
|
+
|
|
620
|
+
region_id: Region ID
|
|
621
|
+
|
|
622
|
+
floating_ip_id: Floating IP ID
|
|
623
|
+
|
|
624
|
+
tags: Update key-value tags using JSON Merge Patch semantics (RFC 7386). Provide
|
|
625
|
+
key-value pairs to add or update tags. Set tag values to `null` to remove tags.
|
|
626
|
+
Unspecified tags remain unchanged. Read-only tags are always preserved and
|
|
627
|
+
cannot be modified. **Examples:**
|
|
628
|
+
|
|
629
|
+
- **Add/update tags:**
|
|
630
|
+
`{'tags': {'environment': 'production', 'team': 'backend'}}` adds new tags or
|
|
631
|
+
updates existing ones.
|
|
632
|
+
- **Delete tags:** `{'tags': {'`old_tag`': null}}` removes specific tags.
|
|
633
|
+
- **Remove all tags:** `{'tags': null}` removes all user-managed tags (read-only
|
|
634
|
+
tags are preserved).
|
|
635
|
+
- **Partial update:** `{'tags': {'environment': 'staging'}}` only updates
|
|
636
|
+
specified tags.
|
|
637
|
+
- **Mixed operations:**
|
|
638
|
+
`{'tags': {'environment': 'production', '`cost_center`': 'engineering', '`deprecated_tag`': null}}`
|
|
639
|
+
adds/updates 'environment' and '`cost_center`' while removing
|
|
640
|
+
'`deprecated_tag`', preserving other existing tags.
|
|
641
|
+
- **Replace all:** first delete existing tags with null values, then add new
|
|
642
|
+
ones in the same request.
|
|
643
|
+
|
|
644
|
+
extra_headers: Send extra headers
|
|
645
|
+
|
|
646
|
+
extra_query: Add additional query parameters to the request
|
|
647
|
+
|
|
648
|
+
extra_body: Add additional JSON properties to the request
|
|
649
|
+
|
|
650
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
651
|
+
"""
|
|
652
|
+
if project_id is None:
|
|
653
|
+
project_id = self._client._get_cloud_project_id_path_param()
|
|
654
|
+
if region_id is None:
|
|
655
|
+
region_id = self._client._get_cloud_region_id_path_param()
|
|
656
|
+
if not floating_ip_id:
|
|
657
|
+
raise ValueError(f"Expected a non-empty value for `floating_ip_id` but received {floating_ip_id!r}")
|
|
658
|
+
return await self._patch(
|
|
659
|
+
f"/cloud/v1/floatingips/{project_id}/{region_id}/{floating_ip_id}",
|
|
660
|
+
body=await async_maybe_transform({"tags": tags}, floating_ip_update_params.FloatingIPUpdateParams),
|
|
661
|
+
options=make_request_options(
|
|
662
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
663
|
+
),
|
|
664
|
+
cast_to=FloatingIP,
|
|
665
|
+
)
|
|
666
|
+
|
|
515
667
|
def list(
|
|
516
668
|
self,
|
|
517
669
|
*,
|
|
@@ -595,6 +747,12 @@ class AsyncFloatingIPsResource(AsyncAPIResource):
|
|
|
595
747
|
Delete floating IP
|
|
596
748
|
|
|
597
749
|
Args:
|
|
750
|
+
project_id: Project ID
|
|
751
|
+
|
|
752
|
+
region_id: Region ID
|
|
753
|
+
|
|
754
|
+
floating_ip_id: Floating IP ID
|
|
755
|
+
|
|
598
756
|
extra_headers: Send extra headers
|
|
599
757
|
|
|
600
758
|
extra_query: Add additional query parameters to the request
|
|
@@ -686,6 +844,12 @@ class AsyncFloatingIPsResource(AsyncAPIResource):
|
|
|
686
844
|
Get floating IP
|
|
687
845
|
|
|
688
846
|
Args:
|
|
847
|
+
project_id: Project ID
|
|
848
|
+
|
|
849
|
+
region_id: Region ID
|
|
850
|
+
|
|
851
|
+
floating_ip_id: Floating IP ID
|
|
852
|
+
|
|
689
853
|
extra_headers: Send extra headers
|
|
690
854
|
|
|
691
855
|
extra_query: Add additional query parameters to the request
|
|
@@ -839,6 +1003,9 @@ class FloatingIPsResourceWithRawResponse:
|
|
|
839
1003
|
self.create = to_raw_response_wrapper(
|
|
840
1004
|
floating_ips.create,
|
|
841
1005
|
)
|
|
1006
|
+
self.update = to_raw_response_wrapper(
|
|
1007
|
+
floating_ips.update,
|
|
1008
|
+
)
|
|
842
1009
|
self.list = to_raw_response_wrapper(
|
|
843
1010
|
floating_ips.list,
|
|
844
1011
|
)
|
|
@@ -869,6 +1036,9 @@ class AsyncFloatingIPsResourceWithRawResponse:
|
|
|
869
1036
|
self.create = async_to_raw_response_wrapper(
|
|
870
1037
|
floating_ips.create,
|
|
871
1038
|
)
|
|
1039
|
+
self.update = async_to_raw_response_wrapper(
|
|
1040
|
+
floating_ips.update,
|
|
1041
|
+
)
|
|
872
1042
|
self.list = async_to_raw_response_wrapper(
|
|
873
1043
|
floating_ips.list,
|
|
874
1044
|
)
|
|
@@ -899,6 +1069,9 @@ class FloatingIPsResourceWithStreamingResponse:
|
|
|
899
1069
|
self.create = to_streamed_response_wrapper(
|
|
900
1070
|
floating_ips.create,
|
|
901
1071
|
)
|
|
1072
|
+
self.update = to_streamed_response_wrapper(
|
|
1073
|
+
floating_ips.update,
|
|
1074
|
+
)
|
|
902
1075
|
self.list = to_streamed_response_wrapper(
|
|
903
1076
|
floating_ips.list,
|
|
904
1077
|
)
|
|
@@ -929,6 +1102,9 @@ class AsyncFloatingIPsResourceWithStreamingResponse:
|
|
|
929
1102
|
self.create = async_to_streamed_response_wrapper(
|
|
930
1103
|
floating_ips.create,
|
|
931
1104
|
)
|
|
1105
|
+
self.update = async_to_streamed_response_wrapper(
|
|
1106
|
+
floating_ips.update,
|
|
1107
|
+
)
|
|
932
1108
|
self.list = async_to_streamed_response_wrapper(
|
|
933
1109
|
floating_ips.list,
|
|
934
1110
|
)
|