gcore 0.13.0__py3-none-any.whl → 0.15.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/__init__.py +3 -1
- gcore/_base_client.py +9 -9
- gcore/_client.py +25 -10
- gcore/_models.py +10 -4
- gcore/_qs.py +7 -7
- gcore/_types.py +18 -11
- gcore/_utils/_transform.py +2 -2
- gcore/_utils/_utils.py +4 -4
- gcore/_version.py +1 -1
- gcore/pagination.py +137 -0
- gcore/resources/__init__.py +14 -0
- gcore/resources/cdn/__init__.py +201 -0
- gcore/resources/cdn/audit_log.py +406 -0
- gcore/resources/cdn/cdn.py +957 -0
- gcore/resources/cdn/certificates.py +1062 -0
- gcore/resources/cdn/ip_ranges.py +224 -0
- gcore/resources/cdn/logs/__init__.py +33 -0
- gcore/resources/cdn/logs/logs.py +1424 -0
- gcore/resources/cdn/logs/settings.py +1081 -0
- gcore/resources/cdn/logs_uploader/__init__.py +61 -0
- gcore/resources/cdn/logs_uploader/configs.py +868 -0
- gcore/resources/cdn/logs_uploader/logs_uploader.py +166 -0
- gcore/resources/cdn/logs_uploader/policies.py +1060 -0
- gcore/resources/cdn/logs_uploader/targets.py +811 -0
- gcore/resources/cdn/metrics.py +419 -0
- gcore/resources/cdn/network_capacity.py +139 -0
- gcore/resources/cdn/origin_groups.py +1496 -0
- gcore/resources/cdn/resources/__init__.py +47 -0
- gcore/resources/cdn/resources/resources.py +2060 -0
- gcore/resources/cdn/resources/rules.py +1027 -0
- gcore/resources/cdn/resources/shield.py +259 -0
- gcore/resources/cdn/rule_templates.py +883 -0
- gcore/resources/cdn/shields.py +139 -0
- gcore/resources/cdn/statistics.py +1408 -0
- gcore/resources/cdn/trusted_ca_certificates.py +592 -0
- gcore/resources/cloud/audit_logs.py +33 -29
- gcore/resources/cloud/baremetal/flavors.py +21 -17
- gcore/resources/cloud/baremetal/images.py +19 -15
- gcore/resources/cloud/baremetal/servers.py +141 -119
- gcore/resources/cloud/billing_reservations.py +41 -33
- gcore/resources/cloud/cloud.py +24 -0
- gcore/resources/cloud/cost_reports.py +149 -119
- gcore/resources/cloud/file_shares/access_rules.py +25 -13
- gcore/resources/cloud/file_shares/file_shares.py +107 -71
- gcore/resources/cloud/floating_ips.py +101 -59
- gcore/resources/cloud/gpu_baremetal_clusters/flavors.py +13 -9
- gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +275 -65
- gcore/resources/cloud/gpu_baremetal_clusters/images.py +69 -53
- gcore/resources/cloud/gpu_baremetal_clusters/interfaces.py +9 -5
- gcore/resources/cloud/gpu_baremetal_clusters/servers.py +151 -127
- gcore/resources/cloud/inference/api_keys.py +51 -31
- gcore/resources/cloud/inference/applications/deployments.py +49 -31
- gcore/resources/cloud/inference/applications/templates.py +17 -9
- gcore/resources/cloud/inference/deployments/deployments.py +171 -139
- gcore/resources/cloud/inference/deployments/logs.py +17 -13
- gcore/resources/cloud/inference/flavors.py +21 -13
- gcore/resources/cloud/inference/inference.py +9 -5
- gcore/resources/cloud/inference/registry_credentials.py +45 -25
- gcore/resources/cloud/inference/secrets.py +45 -25
- gcore/resources/cloud/instances/flavors.py +17 -13
- gcore/resources/cloud/instances/images.py +153 -129
- gcore/resources/cloud/instances/instances.py +287 -213
- gcore/resources/cloud/instances/interfaces.py +165 -161
- gcore/resources/cloud/instances/metrics.py +9 -5
- gcore/resources/cloud/ip_ranges.py +25 -15
- gcore/resources/cloud/k8s/clusters/clusters.py +151 -87
- gcore/resources/cloud/k8s/clusters/nodes.py +19 -11
- gcore/resources/cloud/k8s/clusters/pools/nodes.py +19 -11
- gcore/resources/cloud/k8s/clusters/pools/pools.py +83 -59
- gcore/resources/cloud/k8s/flavors.py +13 -9
- gcore/resources/cloud/k8s/k8s.py +9 -5
- gcore/resources/cloud/load_balancers/flavors.py +11 -7
- gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py +103 -83
- gcore/resources/cloud/load_balancers/l7_policies/rules.py +77 -57
- gcore/resources/cloud/load_balancers/listeners.py +125 -105
- gcore/resources/cloud/load_balancers/load_balancers.py +155 -123
- gcore/resources/cloud/load_balancers/metrics.py +9 -5
- gcore/resources/cloud/load_balancers/pools/health_monitors.py +25 -17
- gcore/resources/cloud/load_balancers/pools/members.py +31 -23
- gcore/resources/cloud/load_balancers/pools/pools.py +155 -129
- gcore/resources/cloud/load_balancers/statuses.py +17 -9
- gcore/resources/cloud/networks/networks.py +79 -55
- gcore/resources/cloud/networks/routers.py +75 -47
- gcore/resources/cloud/networks/subnets.py +109 -87
- gcore/resources/cloud/placement_groups.py +33 -17
- gcore/resources/cloud/projects.py +53 -41
- gcore/resources/cloud/quotas/quotas.py +25 -13
- gcore/resources/cloud/quotas/requests.py +41 -25
- gcore/resources/cloud/regions.py +25 -23
- gcore/resources/cloud/registries/artifacts.py +17 -9
- gcore/resources/cloud/registries/registries.py +55 -29
- gcore/resources/cloud/registries/repositories.py +17 -9
- gcore/resources/cloud/registries/tags.py +9 -5
- gcore/resources/cloud/registries/users.py +65 -35
- gcore/resources/cloud/reserved_fixed_ips/reserved_fixed_ips.py +233 -108
- gcore/resources/cloud/reserved_fixed_ips/vip.py +45 -25
- gcore/resources/cloud/secrets.py +43 -27
- gcore/resources/cloud/security_groups/rules.py +55 -43
- gcore/resources/cloud/security_groups/security_groups.py +79 -47
- gcore/resources/cloud/ssh_keys.py +51 -31
- gcore/resources/cloud/tasks.py +57 -45
- gcore/resources/cloud/usage_reports.py +27 -23
- gcore/resources/cloud/users/role_assignments.py +49 -33
- gcore/resources/cloud/volumes.py +237 -201
- gcore/resources/dns/dns.py +17 -13
- gcore/resources/dns/locations.py +29 -17
- gcore/resources/dns/metrics.py +13 -9
- gcore/resources/dns/pickers/pickers.py +5 -5
- gcore/resources/dns/pickers/presets.py +9 -5
- gcore/resources/dns/zones/dnssec.py +19 -11
- gcore/resources/dns/zones/rrsets.py +149 -91
- gcore/resources/dns/zones/zones.py +245 -187
- gcore/resources/fastedge/apps/apps.py +105 -89
- gcore/resources/fastedge/apps/logs.py +25 -21
- gcore/resources/fastedge/binaries.py +33 -17
- gcore/resources/fastedge/fastedge.py +5 -5
- gcore/resources/fastedge/kv_stores.py +43 -31
- gcore/resources/fastedge/secrets.py +69 -45
- gcore/resources/fastedge/statistics.py +25 -17
- gcore/resources/fastedge/templates.py +59 -39
- gcore/resources/iam/api_tokens.py +47 -29
- gcore/resources/iam/iam.py +5 -5
- gcore/resources/iam/users.py +97 -65
- gcore/resources/security/bgp_announces.py +27 -19
- gcore/resources/security/events.py +23 -19
- gcore/resources/security/profile_templates.py +9 -5
- gcore/resources/security/profiles.py +69 -45
- gcore/resources/storage/buckets/buckets.py +37 -25
- gcore/resources/storage/buckets/cors.py +19 -11
- gcore/resources/storage/buckets/lifecycle.py +19 -11
- gcore/resources/storage/buckets/policy.py +25 -13
- gcore/resources/storage/credentials.py +19 -15
- gcore/resources/storage/locations.py +13 -9
- gcore/resources/storage/statistics.py +39 -31
- gcore/resources/storage/storage.py +105 -69
- gcore/resources/streaming/ai_tasks.py +307 -197
- gcore/resources/streaming/broadcasts.py +63 -35
- gcore/resources/streaming/directories.py +65 -39
- gcore/resources/streaming/players.py +47 -31
- gcore/resources/streaming/playlists.py +189 -123
- gcore/resources/streaming/quality_sets.py +69 -39
- gcore/resources/streaming/restreams.py +47 -27
- gcore/resources/streaming/statistics.py +613 -407
- gcore/resources/streaming/streams/overlays.py +107 -67
- gcore/resources/streaming/streams/streams.py +403 -263
- gcore/resources/streaming/videos/subtitles.py +131 -75
- gcore/resources/streaming/videos/videos.py +429 -279
- gcore/resources/waap/advanced_rules.py +9 -5
- gcore/resources/waap/custom_page_sets.py +99 -75
- gcore/resources/waap/domains/advanced_rules.py +157 -99
- gcore/resources/waap/domains/api_discovery.py +71 -47
- gcore/resources/waap/domains/api_path_groups.py +9 -5
- gcore/resources/waap/domains/api_paths.py +79 -83
- gcore/resources/waap/domains/custom_rules.py +89 -59
- gcore/resources/waap/domains/domains.py +59 -41
- gcore/resources/waap/domains/firewall_rules.py +83 -55
- gcore/resources/waap/domains/insight_silences.py +59 -39
- gcore/resources/waap/domains/insights.py +39 -27
- gcore/resources/waap/domains/settings.py +21 -13
- gcore/resources/waap/domains/statistics.py +99 -75
- gcore/resources/waap/insights.py +23 -21
- gcore/resources/waap/ip_info/ip_info.py +65 -33
- gcore/resources/waap/ip_info/metrics.py +11 -7
- gcore/resources/waap/organizations.py +17 -13
- gcore/resources/waap/statistics.py +9 -5
- gcore/resources/waap/tags.py +17 -17
- gcore/resources/waap/waap.py +5 -5
- gcore/types/cdn/__init__.py +80 -0
- gcore/types/cdn/audit_log_list_params.py +73 -0
- gcore/types/cdn/ca_certificate.py +53 -0
- gcore/types/cdn/ca_certificate_list.py +10 -0
- gcore/types/cdn/cdn_account.py +86 -0
- gcore/types/cdn/cdn_account_limits.py +27 -0
- gcore/types/cdn/cdn_audit_log_entry.py +66 -0
- gcore/types/cdn/cdn_available_features.py +46 -0
- gcore/types/cdn/cdn_list_purge_statuses_params.py +67 -0
- gcore/types/cdn/cdn_log_entry.py +70 -0
- gcore/types/cdn/cdn_metrics.py +22 -0
- gcore/types/cdn/cdn_metrics_groups.py +13 -0
- gcore/types/cdn/cdn_metrics_values.py +19 -0
- gcore/types/cdn/cdn_resource.py +1997 -0
- gcore/types/cdn/cdn_resource_list.py +10 -0
- gcore/types/cdn/cdn_update_account_params.py +15 -0
- gcore/types/cdn/certificate_create_params.py +51 -0
- gcore/types/cdn/certificate_get_status_params.py +14 -0
- gcore/types/cdn/certificate_list_params.py +29 -0
- gcore/types/cdn/certificate_replace_params.py +39 -0
- gcore/types/cdn/log_download_params.py +279 -0
- gcore/types/cdn/log_list_params.py +273 -0
- gcore/types/cdn/logs/__init__.py +7 -0
- gcore/types/cdn/logs/log_settings.py +172 -0
- gcore/types/cdn/logs/setting_create_params.py +200 -0
- gcore/types/cdn/logs/setting_update_params.py +200 -0
- gcore/types/cdn/logs_aggregated_stats.py +23 -0
- gcore/types/cdn/logs_uploader/__init__.py +23 -0
- gcore/types/cdn/logs_uploader/config_create_params.py +32 -0
- gcore/types/cdn/logs_uploader/config_list_params.py +16 -0
- gcore/types/cdn/logs_uploader/config_replace_params.py +32 -0
- gcore/types/cdn/logs_uploader/config_update_params.py +32 -0
- gcore/types/cdn/logs_uploader/logs_uploader_config.py +51 -0
- gcore/types/cdn/logs_uploader/logs_uploader_config_list.py +10 -0
- gcore/types/cdn/logs_uploader/logs_uploader_policy.py +73 -0
- gcore/types/cdn/logs_uploader/logs_uploader_policy_list.py +10 -0
- gcore/types/cdn/logs_uploader/logs_uploader_target.py +236 -0
- gcore/types/cdn/logs_uploader/logs_uploader_target_list.py +10 -0
- gcore/types/cdn/logs_uploader/policy_create_params.py +61 -0
- gcore/types/cdn/logs_uploader/policy_list_fields_response.py +8 -0
- gcore/types/cdn/logs_uploader/policy_list_params.py +16 -0
- gcore/types/cdn/logs_uploader/policy_replace_params.py +61 -0
- gcore/types/cdn/logs_uploader/policy_update_params.py +61 -0
- gcore/types/cdn/logs_uploader/target_create_params.py +249 -0
- gcore/types/cdn/logs_uploader/target_list_params.py +16 -0
- gcore/types/cdn/logs_uploader/target_replace_params.py +249 -0
- gcore/types/cdn/logs_uploader/target_update_params.py +249 -0
- gcore/types/cdn/logs_uploader_validation.py +23 -0
- gcore/types/cdn/metric_list_params.py +168 -0
- gcore/types/cdn/network_capacity.py +22 -0
- gcore/types/cdn/origin_group_create_params.py +184 -0
- gcore/types/cdn/origin_group_list_params.py +24 -0
- gcore/types/cdn/origin_group_replace_params.py +190 -0
- gcore/types/cdn/origin_group_update_params.py +190 -0
- gcore/types/cdn/origin_groups.py +212 -0
- gcore/types/cdn/origin_groups_list.py +10 -0
- gcore/types/cdn/public_ip_list.py +15 -0
- gcore/types/cdn/public_network_list.py +15 -0
- gcore/types/cdn/purge_status.py +55 -0
- gcore/types/cdn/resource_aggregated_stats.py +80 -0
- gcore/types/cdn/resource_create_params.py +1845 -0
- gcore/types/cdn/resource_list_params.py +107 -0
- gcore/types/cdn/resource_prefetch_params.py +17 -0
- gcore/types/cdn/resource_purge_params.py +71 -0
- gcore/types/cdn/resource_replace_params.py +1823 -0
- gcore/types/cdn/resource_update_params.py +1814 -0
- gcore/types/cdn/resource_usage_stats.py +111 -0
- gcore/types/cdn/resources/__init__.py +11 -0
- gcore/types/cdn/resources/cdn_resource_rule.py +1715 -0
- gcore/types/cdn/resources/origin_shielding.py +15 -0
- gcore/types/cdn/resources/rule_create_params.py +1672 -0
- gcore/types/cdn/resources/rule_list_response.py +10 -0
- gcore/types/cdn/resources/rule_replace_params.py +1674 -0
- gcore/types/cdn/resources/rule_update_params.py +1674 -0
- gcore/types/cdn/resources/shield_replace_params.py +16 -0
- gcore/types/cdn/rule_template.py +1686 -0
- gcore/types/cdn/rule_template_create_params.py +1656 -0
- gcore/types/cdn/rule_template_list.py +10 -0
- gcore/types/cdn/rule_template_replace_params.py +1656 -0
- gcore/types/cdn/rule_template_update_params.py +1656 -0
- gcore/types/cdn/shield_aggregated_stats.py +23 -0
- gcore/types/cdn/shield_list_response.py +25 -0
- gcore/types/cdn/ssl_detail.py +62 -0
- gcore/types/cdn/ssl_detail_list.py +10 -0
- gcore/types/cdn/ssl_request_status.py +135 -0
- gcore/types/cdn/statistic_get_logs_usage_aggregated_params.py +42 -0
- gcore/types/cdn/statistic_get_logs_usage_series_params.py +35 -0
- gcore/types/cdn/statistic_get_resource_usage_aggregated_params.py +151 -0
- gcore/types/cdn/statistic_get_resource_usage_series_params.py +131 -0
- gcore/types/cdn/statistic_get_shield_usage_aggregated_params.py +42 -0
- gcore/types/cdn/statistic_get_shield_usage_series_params.py +25 -0
- gcore/types/cdn/trusted_ca_certificate_create_params.py +23 -0
- gcore/types/cdn/trusted_ca_certificate_list_params.py +29 -0
- gcore/types/cdn/trusted_ca_certificate_replace_params.py +15 -0
- gcore/types/cdn/usage_series_stats.py +31 -0
- gcore/types/cloud/__init__.py +2 -0
- gcore/types/cloud/file_share.py +4 -0
- gcore/types/cloud/file_share_create_params.py +20 -0
- gcore/types/cloud/file_share_update_params.py +40 -3
- gcore/types/cloud/floating_ip_update_params.py +3 -1
- gcore/types/cloud/gpu_baremetal_cluster_action_params.py +46 -0
- gcore/types/cloud/gpu_baremetal_clusters/gpu_baremetal_flavor.py +12 -0
- gcore/types/cloud/inference/inference_deployment.py +3 -1
- gcore/types/cloud/instance_create_params.py +3 -1
- gcore/types/cloud/k8s/cluster_create_params.py +46 -4
- gcore/types/cloud/k8s/cluster_update_params.py +60 -6
- gcore/types/cloud/k8s/clusters/pool_update_params.py +1 -1
- gcore/types/cloud/k8s/k8s_cluster.py +40 -3
- gcore/types/cloud/load_balancer_update_params.py +3 -1
- gcore/types/cloud/network_update_params.py +3 -1
- gcore/types/cloud/networks/subnet_update_params.py +3 -1
- gcore/types/cloud/quota_get_all_response.py +8 -8
- gcore/types/cloud/quota_get_by_region_response.py +8 -8
- gcore/types/cloud/quotas/request_create_params.py +4 -4
- gcore/types/cloud/quotas/request_get_response.py +4 -4
- gcore/types/cloud/quotas/request_list_response.py +4 -4
- gcore/types/cloud/registries/user_create_multiple_params.py +5 -3
- gcore/types/cloud/registries/user_create_params.py +5 -3
- gcore/types/cloud/registry_create_params.py +5 -3
- gcore/types/cloud/reserved_fixed_ip_update_params.py +16 -0
- gcore/types/cloud/security_group_update_params.py +3 -1
- gcore/types/cloud/ssh_key_created.py +6 -3
- gcore/types/cloud/volume_update_params.py +3 -1
- gcore/types/dns/zone_get_statistics_params.py +12 -9
- gcore/types/dns/zone_get_statistics_response.py +3 -1
- gcore/types/dns/zone_import_params.py +21 -15
- gcore/types/dns/zones/dns_output_rrset.py +7 -3
- gcore/types/iam/account_overview.py +31 -28
- gcore/types/iam/api_token.py +24 -24
- gcore/types/iam/api_token_create_params.py +2 -1
- gcore/types/iam/api_token_list.py +24 -24
- gcore/types/iam/user.py +7 -2
- gcore/types/iam/user_detailed.py +22 -17
- gcore/types/iam/user_invite.py +2 -4
- gcore/types/iam/user_invite_params.py +4 -1
- gcore/types/iam/user_update.py +22 -17
- gcore/types/iam/user_update_params.py +7 -2
- gcore/types/streaming/ai_contentmoderation_hardnudity.py +6 -4
- gcore/types/streaming/ai_contentmoderation_nsfw.py +6 -4
- gcore/types/streaming/ai_contentmoderation_softnudity.py +6 -4
- gcore/types/streaming/ai_contentmoderation_sport.py +6 -4
- gcore/types/streaming/ai_task.py +20 -11
- gcore/types/streaming/ai_task_create_params.py +20 -11
- gcore/types/streaming/ai_task_get_response.py +5 -4
- gcore/types/streaming/ai_task_list_params.py +11 -5
- gcore/types/streaming/clip.py +33 -22
- gcore/types/streaming/create_video_param.py +75 -43
- gcore/types/streaming/playlist.py +7 -5
- gcore/types/streaming/playlist_create_params.py +7 -5
- gcore/types/streaming/playlist_update_params.py +7 -5
- gcore/types/streaming/playlist_video.py +75 -43
- gcore/types/streaming/statistic_get_unique_viewers_cdn_params.py +7 -4
- gcore/types/streaming/stream.py +207 -136
- gcore/types/streaming/stream_create_clip_params.py +33 -22
- gcore/types/streaming/stream_create_params.py +41 -24
- gcore/types/streaming/stream_update_params.py +41 -24
- gcore/types/streaming/video.py +138 -76
- gcore/types/streaming/video_list_params.py +4 -2
- gcore/types/streaming/video_update_params.py +75 -43
- gcore/types/waap/domain_update_params.py +2 -2
- gcore/types/waap/domains/advanced_rule_create_params.py +26 -18
- gcore/types/waap/domains/advanced_rule_list_params.py +10 -7
- gcore/types/waap/domains/advanced_rule_update_params.py +22 -17
- gcore/types/waap/domains/api_path_create_params.py +0 -3
- gcore/types/waap/domains/api_path_update_params.py +1 -3
- gcore/types/waap/domains/custom_rule_create_params.py +36 -35
- gcore/types/waap/domains/custom_rule_update_params.py +31 -33
- gcore/types/waap/domains/firewall_rule_create_params.py +6 -6
- gcore/types/waap/domains/firewall_rule_update_params.py +5 -5
- gcore/types/waap/domains/waap_advanced_rule.py +17 -9
- gcore/types/waap/domains/waap_custom_rule.py +5 -2
- gcore/types/waap/domains/waap_firewall_rule.py +1 -1
- gcore/types/waap/domains/waap_insight.py +1 -1
- gcore/types/waap/insight_list_types_params.py +1 -1
- {gcore-0.13.0.dist-info → gcore-0.15.0.dist-info}/METADATA +1 -1
- {gcore-0.13.0.dist-info → gcore-0.15.0.dist-info}/RECORD +345 -224
- {gcore-0.13.0.dist-info → gcore-0.15.0.dist-info}/WHEEL +0 -0
- {gcore-0.13.0.dist-info → gcore-0.15.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,868 @@
|
|
|
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 Iterable
|
|
6
|
+
|
|
7
|
+
import httpx
|
|
8
|
+
|
|
9
|
+
from ...._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given
|
|
10
|
+
from ...._utils import maybe_transform, async_maybe_transform
|
|
11
|
+
from ...._compat import cached_property
|
|
12
|
+
from ...._resource import SyncAPIResource, AsyncAPIResource
|
|
13
|
+
from ...._response import (
|
|
14
|
+
to_raw_response_wrapper,
|
|
15
|
+
to_streamed_response_wrapper,
|
|
16
|
+
async_to_raw_response_wrapper,
|
|
17
|
+
async_to_streamed_response_wrapper,
|
|
18
|
+
)
|
|
19
|
+
from ...._base_client import make_request_options
|
|
20
|
+
from ....types.cdn.logs_uploader import (
|
|
21
|
+
config_list_params,
|
|
22
|
+
config_create_params,
|
|
23
|
+
config_update_params,
|
|
24
|
+
config_replace_params,
|
|
25
|
+
)
|
|
26
|
+
from ....types.cdn.logs_uploader_validation import LogsUploaderValidation
|
|
27
|
+
from ....types.cdn.logs_uploader.logs_uploader_config import LogsUploaderConfig
|
|
28
|
+
from ....types.cdn.logs_uploader.logs_uploader_config_list import LogsUploaderConfigList
|
|
29
|
+
|
|
30
|
+
__all__ = ["ConfigsResource", "AsyncConfigsResource"]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class ConfigsResource(SyncAPIResource):
|
|
34
|
+
@cached_property
|
|
35
|
+
def with_raw_response(self) -> ConfigsResourceWithRawResponse:
|
|
36
|
+
"""
|
|
37
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
38
|
+
the raw response object instead of the parsed content.
|
|
39
|
+
|
|
40
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
41
|
+
"""
|
|
42
|
+
return ConfigsResourceWithRawResponse(self)
|
|
43
|
+
|
|
44
|
+
@cached_property
|
|
45
|
+
def with_streaming_response(self) -> ConfigsResourceWithStreamingResponse:
|
|
46
|
+
"""
|
|
47
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
48
|
+
|
|
49
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
50
|
+
"""
|
|
51
|
+
return ConfigsResourceWithStreamingResponse(self)
|
|
52
|
+
|
|
53
|
+
def create(
|
|
54
|
+
self,
|
|
55
|
+
*,
|
|
56
|
+
name: str,
|
|
57
|
+
policy: int,
|
|
58
|
+
target: int,
|
|
59
|
+
enabled: bool | Omit = omit,
|
|
60
|
+
for_all_resources: bool | Omit = omit,
|
|
61
|
+
resources: Iterable[int] | Omit = omit,
|
|
62
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
63
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
64
|
+
extra_headers: Headers | None = None,
|
|
65
|
+
extra_query: Query | None = None,
|
|
66
|
+
extra_body: Body | None = None,
|
|
67
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
68
|
+
) -> LogsUploaderConfig:
|
|
69
|
+
"""
|
|
70
|
+
Create logs uploader config.
|
|
71
|
+
|
|
72
|
+
Args:
|
|
73
|
+
name: Name of the config.
|
|
74
|
+
|
|
75
|
+
policy: ID of the policy that should be assigned to given config.
|
|
76
|
+
|
|
77
|
+
target: ID of the target to which logs should be uploaded.
|
|
78
|
+
|
|
79
|
+
enabled: Enables or disables the config.
|
|
80
|
+
|
|
81
|
+
for_all_resources: If set to true, the config will be applied to all CDN resources. If set to
|
|
82
|
+
false, the config will be applied to the resources specified in the `resources`
|
|
83
|
+
field.
|
|
84
|
+
|
|
85
|
+
resources: List of resource IDs to which the config should be applied.
|
|
86
|
+
|
|
87
|
+
extra_headers: Send extra headers
|
|
88
|
+
|
|
89
|
+
extra_query: Add additional query parameters to the request
|
|
90
|
+
|
|
91
|
+
extra_body: Add additional JSON properties to the request
|
|
92
|
+
|
|
93
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
94
|
+
"""
|
|
95
|
+
return self._post(
|
|
96
|
+
"/cdn/logs_uploader/configs"
|
|
97
|
+
if self._client._base_url_overridden
|
|
98
|
+
else "https://api.gcore.com//cdn/logs_uploader/configs",
|
|
99
|
+
body=maybe_transform(
|
|
100
|
+
{
|
|
101
|
+
"name": name,
|
|
102
|
+
"policy": policy,
|
|
103
|
+
"target": target,
|
|
104
|
+
"enabled": enabled,
|
|
105
|
+
"for_all_resources": for_all_resources,
|
|
106
|
+
"resources": resources,
|
|
107
|
+
},
|
|
108
|
+
config_create_params.ConfigCreateParams,
|
|
109
|
+
),
|
|
110
|
+
options=make_request_options(
|
|
111
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
112
|
+
),
|
|
113
|
+
cast_to=LogsUploaderConfig,
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
def update(
|
|
117
|
+
self,
|
|
118
|
+
id: int,
|
|
119
|
+
*,
|
|
120
|
+
enabled: bool | Omit = omit,
|
|
121
|
+
for_all_resources: bool | Omit = omit,
|
|
122
|
+
name: str | Omit = omit,
|
|
123
|
+
policy: int | Omit = omit,
|
|
124
|
+
resources: Iterable[int] | Omit = omit,
|
|
125
|
+
target: int | Omit = omit,
|
|
126
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
127
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
128
|
+
extra_headers: Headers | None = None,
|
|
129
|
+
extra_query: Query | None = None,
|
|
130
|
+
extra_body: Body | None = None,
|
|
131
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
132
|
+
) -> LogsUploaderConfig:
|
|
133
|
+
"""
|
|
134
|
+
Change logs uploader config partially.
|
|
135
|
+
|
|
136
|
+
Args:
|
|
137
|
+
enabled: Enables or disables the config.
|
|
138
|
+
|
|
139
|
+
for_all_resources: If set to true, the config will be applied to all CDN resources. If set to
|
|
140
|
+
false, the config will be applied to the resources specified in the `resources`
|
|
141
|
+
field.
|
|
142
|
+
|
|
143
|
+
name: Name of the config.
|
|
144
|
+
|
|
145
|
+
policy: ID of the policy that should be assigned to given config.
|
|
146
|
+
|
|
147
|
+
resources: List of resource IDs to which the config should be applied.
|
|
148
|
+
|
|
149
|
+
target: ID of the target to which logs should be uploaded.
|
|
150
|
+
|
|
151
|
+
extra_headers: Send extra headers
|
|
152
|
+
|
|
153
|
+
extra_query: Add additional query parameters to the request
|
|
154
|
+
|
|
155
|
+
extra_body: Add additional JSON properties to the request
|
|
156
|
+
|
|
157
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
158
|
+
"""
|
|
159
|
+
return self._patch(
|
|
160
|
+
f"/cdn/logs_uploader/configs/{id}"
|
|
161
|
+
if self._client._base_url_overridden
|
|
162
|
+
else f"https://api.gcore.com//cdn/logs_uploader/configs/{id}",
|
|
163
|
+
body=maybe_transform(
|
|
164
|
+
{
|
|
165
|
+
"enabled": enabled,
|
|
166
|
+
"for_all_resources": for_all_resources,
|
|
167
|
+
"name": name,
|
|
168
|
+
"policy": policy,
|
|
169
|
+
"resources": resources,
|
|
170
|
+
"target": target,
|
|
171
|
+
},
|
|
172
|
+
config_update_params.ConfigUpdateParams,
|
|
173
|
+
),
|
|
174
|
+
options=make_request_options(
|
|
175
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
176
|
+
),
|
|
177
|
+
cast_to=LogsUploaderConfig,
|
|
178
|
+
)
|
|
179
|
+
|
|
180
|
+
def list(
|
|
181
|
+
self,
|
|
182
|
+
*,
|
|
183
|
+
resource_ids: Iterable[int] | Omit = omit,
|
|
184
|
+
search: str | Omit = omit,
|
|
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
|
+
) -> LogsUploaderConfigList:
|
|
192
|
+
"""
|
|
193
|
+
Get list of logs uploader configs.
|
|
194
|
+
|
|
195
|
+
Args:
|
|
196
|
+
resource_ids: Filter by ids of CDN resources that are assigned to given config.
|
|
197
|
+
|
|
198
|
+
search: Search by config name or id.
|
|
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(
|
|
209
|
+
"/cdn/logs_uploader/configs"
|
|
210
|
+
if self._client._base_url_overridden
|
|
211
|
+
else "https://api.gcore.com//cdn/logs_uploader/configs",
|
|
212
|
+
options=make_request_options(
|
|
213
|
+
extra_headers=extra_headers,
|
|
214
|
+
extra_query=extra_query,
|
|
215
|
+
extra_body=extra_body,
|
|
216
|
+
timeout=timeout,
|
|
217
|
+
query=maybe_transform(
|
|
218
|
+
{
|
|
219
|
+
"resource_ids": resource_ids,
|
|
220
|
+
"search": search,
|
|
221
|
+
},
|
|
222
|
+
config_list_params.ConfigListParams,
|
|
223
|
+
),
|
|
224
|
+
),
|
|
225
|
+
cast_to=LogsUploaderConfigList,
|
|
226
|
+
)
|
|
227
|
+
|
|
228
|
+
def delete(
|
|
229
|
+
self,
|
|
230
|
+
id: int,
|
|
231
|
+
*,
|
|
232
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
233
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
234
|
+
extra_headers: Headers | None = None,
|
|
235
|
+
extra_query: Query | None = None,
|
|
236
|
+
extra_body: Body | None = None,
|
|
237
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
238
|
+
) -> None:
|
|
239
|
+
"""
|
|
240
|
+
Delete the logs uploader config from the system permanently.
|
|
241
|
+
|
|
242
|
+
Notes:
|
|
243
|
+
|
|
244
|
+
- **Irreversibility**: This action is irreversible. Once deleted, the logs
|
|
245
|
+
uploader config cannot be recovered.
|
|
246
|
+
|
|
247
|
+
Args:
|
|
248
|
+
extra_headers: Send extra headers
|
|
249
|
+
|
|
250
|
+
extra_query: Add additional query parameters to the request
|
|
251
|
+
|
|
252
|
+
extra_body: Add additional JSON properties to the request
|
|
253
|
+
|
|
254
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
255
|
+
"""
|
|
256
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
257
|
+
return self._delete(
|
|
258
|
+
f"/cdn/logs_uploader/configs/{id}"
|
|
259
|
+
if self._client._base_url_overridden
|
|
260
|
+
else f"https://api.gcore.com//cdn/logs_uploader/configs/{id}",
|
|
261
|
+
options=make_request_options(
|
|
262
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
263
|
+
),
|
|
264
|
+
cast_to=NoneType,
|
|
265
|
+
)
|
|
266
|
+
|
|
267
|
+
def get(
|
|
268
|
+
self,
|
|
269
|
+
id: int,
|
|
270
|
+
*,
|
|
271
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
272
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
273
|
+
extra_headers: Headers | None = None,
|
|
274
|
+
extra_query: Query | None = None,
|
|
275
|
+
extra_body: Body | None = None,
|
|
276
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
277
|
+
) -> LogsUploaderConfig:
|
|
278
|
+
"""
|
|
279
|
+
Get information about logs uploader config.
|
|
280
|
+
|
|
281
|
+
Args:
|
|
282
|
+
extra_headers: Send extra headers
|
|
283
|
+
|
|
284
|
+
extra_query: Add additional query parameters to the request
|
|
285
|
+
|
|
286
|
+
extra_body: Add additional JSON properties to the request
|
|
287
|
+
|
|
288
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
289
|
+
"""
|
|
290
|
+
return self._get(
|
|
291
|
+
f"/cdn/logs_uploader/configs/{id}"
|
|
292
|
+
if self._client._base_url_overridden
|
|
293
|
+
else f"https://api.gcore.com//cdn/logs_uploader/configs/{id}",
|
|
294
|
+
options=make_request_options(
|
|
295
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
296
|
+
),
|
|
297
|
+
cast_to=LogsUploaderConfig,
|
|
298
|
+
)
|
|
299
|
+
|
|
300
|
+
def replace(
|
|
301
|
+
self,
|
|
302
|
+
id: int,
|
|
303
|
+
*,
|
|
304
|
+
name: str,
|
|
305
|
+
policy: int,
|
|
306
|
+
target: int,
|
|
307
|
+
enabled: bool | Omit = omit,
|
|
308
|
+
for_all_resources: bool | Omit = omit,
|
|
309
|
+
resources: Iterable[int] | Omit = omit,
|
|
310
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
311
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
312
|
+
extra_headers: Headers | None = None,
|
|
313
|
+
extra_query: Query | None = None,
|
|
314
|
+
extra_body: Body | None = None,
|
|
315
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
316
|
+
) -> LogsUploaderConfig:
|
|
317
|
+
"""
|
|
318
|
+
Change logs uploader config.
|
|
319
|
+
|
|
320
|
+
Args:
|
|
321
|
+
name: Name of the config.
|
|
322
|
+
|
|
323
|
+
policy: ID of the policy that should be assigned to given config.
|
|
324
|
+
|
|
325
|
+
target: ID of the target to which logs should be uploaded.
|
|
326
|
+
|
|
327
|
+
enabled: Enables or disables the config.
|
|
328
|
+
|
|
329
|
+
for_all_resources: If set to true, the config will be applied to all CDN resources. If set to
|
|
330
|
+
false, the config will be applied to the resources specified in the `resources`
|
|
331
|
+
field.
|
|
332
|
+
|
|
333
|
+
resources: List of resource IDs to which the config should be applied.
|
|
334
|
+
|
|
335
|
+
extra_headers: Send extra headers
|
|
336
|
+
|
|
337
|
+
extra_query: Add additional query parameters to the request
|
|
338
|
+
|
|
339
|
+
extra_body: Add additional JSON properties to the request
|
|
340
|
+
|
|
341
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
342
|
+
"""
|
|
343
|
+
return self._put(
|
|
344
|
+
f"/cdn/logs_uploader/configs/{id}"
|
|
345
|
+
if self._client._base_url_overridden
|
|
346
|
+
else f"https://api.gcore.com//cdn/logs_uploader/configs/{id}",
|
|
347
|
+
body=maybe_transform(
|
|
348
|
+
{
|
|
349
|
+
"name": name,
|
|
350
|
+
"policy": policy,
|
|
351
|
+
"target": target,
|
|
352
|
+
"enabled": enabled,
|
|
353
|
+
"for_all_resources": for_all_resources,
|
|
354
|
+
"resources": resources,
|
|
355
|
+
},
|
|
356
|
+
config_replace_params.ConfigReplaceParams,
|
|
357
|
+
),
|
|
358
|
+
options=make_request_options(
|
|
359
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
360
|
+
),
|
|
361
|
+
cast_to=LogsUploaderConfig,
|
|
362
|
+
)
|
|
363
|
+
|
|
364
|
+
def validate(
|
|
365
|
+
self,
|
|
366
|
+
id: int,
|
|
367
|
+
*,
|
|
368
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
369
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
370
|
+
extra_headers: Headers | None = None,
|
|
371
|
+
extra_query: Query | None = None,
|
|
372
|
+
extra_body: Body | None = None,
|
|
373
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
374
|
+
) -> LogsUploaderValidation:
|
|
375
|
+
"""
|
|
376
|
+
Validate logs uploader config.
|
|
377
|
+
|
|
378
|
+
Args:
|
|
379
|
+
extra_headers: Send extra headers
|
|
380
|
+
|
|
381
|
+
extra_query: Add additional query parameters to the request
|
|
382
|
+
|
|
383
|
+
extra_body: Add additional JSON properties to the request
|
|
384
|
+
|
|
385
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
386
|
+
"""
|
|
387
|
+
return self._post(
|
|
388
|
+
f"/cdn/logs_uploader/configs/{id}/validate"
|
|
389
|
+
if self._client._base_url_overridden
|
|
390
|
+
else f"https://api.gcore.com//cdn/logs_uploader/configs/{id}/validate",
|
|
391
|
+
options=make_request_options(
|
|
392
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
393
|
+
),
|
|
394
|
+
cast_to=LogsUploaderValidation,
|
|
395
|
+
)
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
class AsyncConfigsResource(AsyncAPIResource):
|
|
399
|
+
@cached_property
|
|
400
|
+
def with_raw_response(self) -> AsyncConfigsResourceWithRawResponse:
|
|
401
|
+
"""
|
|
402
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
403
|
+
the raw response object instead of the parsed content.
|
|
404
|
+
|
|
405
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
406
|
+
"""
|
|
407
|
+
return AsyncConfigsResourceWithRawResponse(self)
|
|
408
|
+
|
|
409
|
+
@cached_property
|
|
410
|
+
def with_streaming_response(self) -> AsyncConfigsResourceWithStreamingResponse:
|
|
411
|
+
"""
|
|
412
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
413
|
+
|
|
414
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
415
|
+
"""
|
|
416
|
+
return AsyncConfigsResourceWithStreamingResponse(self)
|
|
417
|
+
|
|
418
|
+
async def create(
|
|
419
|
+
self,
|
|
420
|
+
*,
|
|
421
|
+
name: str,
|
|
422
|
+
policy: int,
|
|
423
|
+
target: int,
|
|
424
|
+
enabled: bool | Omit = omit,
|
|
425
|
+
for_all_resources: bool | Omit = omit,
|
|
426
|
+
resources: Iterable[int] | Omit = omit,
|
|
427
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
428
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
429
|
+
extra_headers: Headers | None = None,
|
|
430
|
+
extra_query: Query | None = None,
|
|
431
|
+
extra_body: Body | None = None,
|
|
432
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
433
|
+
) -> LogsUploaderConfig:
|
|
434
|
+
"""
|
|
435
|
+
Create logs uploader config.
|
|
436
|
+
|
|
437
|
+
Args:
|
|
438
|
+
name: Name of the config.
|
|
439
|
+
|
|
440
|
+
policy: ID of the policy that should be assigned to given config.
|
|
441
|
+
|
|
442
|
+
target: ID of the target to which logs should be uploaded.
|
|
443
|
+
|
|
444
|
+
enabled: Enables or disables the config.
|
|
445
|
+
|
|
446
|
+
for_all_resources: If set to true, the config will be applied to all CDN resources. If set to
|
|
447
|
+
false, the config will be applied to the resources specified in the `resources`
|
|
448
|
+
field.
|
|
449
|
+
|
|
450
|
+
resources: List of resource IDs to which the config should be applied.
|
|
451
|
+
|
|
452
|
+
extra_headers: Send extra headers
|
|
453
|
+
|
|
454
|
+
extra_query: Add additional query parameters to the request
|
|
455
|
+
|
|
456
|
+
extra_body: Add additional JSON properties to the request
|
|
457
|
+
|
|
458
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
459
|
+
"""
|
|
460
|
+
return await self._post(
|
|
461
|
+
"/cdn/logs_uploader/configs"
|
|
462
|
+
if self._client._base_url_overridden
|
|
463
|
+
else "https://api.gcore.com//cdn/logs_uploader/configs",
|
|
464
|
+
body=await async_maybe_transform(
|
|
465
|
+
{
|
|
466
|
+
"name": name,
|
|
467
|
+
"policy": policy,
|
|
468
|
+
"target": target,
|
|
469
|
+
"enabled": enabled,
|
|
470
|
+
"for_all_resources": for_all_resources,
|
|
471
|
+
"resources": resources,
|
|
472
|
+
},
|
|
473
|
+
config_create_params.ConfigCreateParams,
|
|
474
|
+
),
|
|
475
|
+
options=make_request_options(
|
|
476
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
477
|
+
),
|
|
478
|
+
cast_to=LogsUploaderConfig,
|
|
479
|
+
)
|
|
480
|
+
|
|
481
|
+
async def update(
|
|
482
|
+
self,
|
|
483
|
+
id: int,
|
|
484
|
+
*,
|
|
485
|
+
enabled: bool | Omit = omit,
|
|
486
|
+
for_all_resources: bool | Omit = omit,
|
|
487
|
+
name: str | Omit = omit,
|
|
488
|
+
policy: int | Omit = omit,
|
|
489
|
+
resources: Iterable[int] | Omit = omit,
|
|
490
|
+
target: int | Omit = omit,
|
|
491
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
492
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
493
|
+
extra_headers: Headers | None = None,
|
|
494
|
+
extra_query: Query | None = None,
|
|
495
|
+
extra_body: Body | None = None,
|
|
496
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
497
|
+
) -> LogsUploaderConfig:
|
|
498
|
+
"""
|
|
499
|
+
Change logs uploader config partially.
|
|
500
|
+
|
|
501
|
+
Args:
|
|
502
|
+
enabled: Enables or disables the config.
|
|
503
|
+
|
|
504
|
+
for_all_resources: If set to true, the config will be applied to all CDN resources. If set to
|
|
505
|
+
false, the config will be applied to the resources specified in the `resources`
|
|
506
|
+
field.
|
|
507
|
+
|
|
508
|
+
name: Name of the config.
|
|
509
|
+
|
|
510
|
+
policy: ID of the policy that should be assigned to given config.
|
|
511
|
+
|
|
512
|
+
resources: List of resource IDs to which the config should be applied.
|
|
513
|
+
|
|
514
|
+
target: ID of the target to which logs should be uploaded.
|
|
515
|
+
|
|
516
|
+
extra_headers: Send extra headers
|
|
517
|
+
|
|
518
|
+
extra_query: Add additional query parameters to the request
|
|
519
|
+
|
|
520
|
+
extra_body: Add additional JSON properties to the request
|
|
521
|
+
|
|
522
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
523
|
+
"""
|
|
524
|
+
return await self._patch(
|
|
525
|
+
f"/cdn/logs_uploader/configs/{id}"
|
|
526
|
+
if self._client._base_url_overridden
|
|
527
|
+
else f"https://api.gcore.com//cdn/logs_uploader/configs/{id}",
|
|
528
|
+
body=await async_maybe_transform(
|
|
529
|
+
{
|
|
530
|
+
"enabled": enabled,
|
|
531
|
+
"for_all_resources": for_all_resources,
|
|
532
|
+
"name": name,
|
|
533
|
+
"policy": policy,
|
|
534
|
+
"resources": resources,
|
|
535
|
+
"target": target,
|
|
536
|
+
},
|
|
537
|
+
config_update_params.ConfigUpdateParams,
|
|
538
|
+
),
|
|
539
|
+
options=make_request_options(
|
|
540
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
541
|
+
),
|
|
542
|
+
cast_to=LogsUploaderConfig,
|
|
543
|
+
)
|
|
544
|
+
|
|
545
|
+
async def list(
|
|
546
|
+
self,
|
|
547
|
+
*,
|
|
548
|
+
resource_ids: Iterable[int] | Omit = omit,
|
|
549
|
+
search: str | Omit = omit,
|
|
550
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
551
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
552
|
+
extra_headers: Headers | None = None,
|
|
553
|
+
extra_query: Query | None = None,
|
|
554
|
+
extra_body: Body | None = None,
|
|
555
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
556
|
+
) -> LogsUploaderConfigList:
|
|
557
|
+
"""
|
|
558
|
+
Get list of logs uploader configs.
|
|
559
|
+
|
|
560
|
+
Args:
|
|
561
|
+
resource_ids: Filter by ids of CDN resources that are assigned to given config.
|
|
562
|
+
|
|
563
|
+
search: Search by config name or id.
|
|
564
|
+
|
|
565
|
+
extra_headers: Send extra headers
|
|
566
|
+
|
|
567
|
+
extra_query: Add additional query parameters to the request
|
|
568
|
+
|
|
569
|
+
extra_body: Add additional JSON properties to the request
|
|
570
|
+
|
|
571
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
572
|
+
"""
|
|
573
|
+
return await self._get(
|
|
574
|
+
"/cdn/logs_uploader/configs"
|
|
575
|
+
if self._client._base_url_overridden
|
|
576
|
+
else "https://api.gcore.com//cdn/logs_uploader/configs",
|
|
577
|
+
options=make_request_options(
|
|
578
|
+
extra_headers=extra_headers,
|
|
579
|
+
extra_query=extra_query,
|
|
580
|
+
extra_body=extra_body,
|
|
581
|
+
timeout=timeout,
|
|
582
|
+
query=await async_maybe_transform(
|
|
583
|
+
{
|
|
584
|
+
"resource_ids": resource_ids,
|
|
585
|
+
"search": search,
|
|
586
|
+
},
|
|
587
|
+
config_list_params.ConfigListParams,
|
|
588
|
+
),
|
|
589
|
+
),
|
|
590
|
+
cast_to=LogsUploaderConfigList,
|
|
591
|
+
)
|
|
592
|
+
|
|
593
|
+
async def delete(
|
|
594
|
+
self,
|
|
595
|
+
id: int,
|
|
596
|
+
*,
|
|
597
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
598
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
599
|
+
extra_headers: Headers | None = None,
|
|
600
|
+
extra_query: Query | None = None,
|
|
601
|
+
extra_body: Body | None = None,
|
|
602
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
603
|
+
) -> None:
|
|
604
|
+
"""
|
|
605
|
+
Delete the logs uploader config from the system permanently.
|
|
606
|
+
|
|
607
|
+
Notes:
|
|
608
|
+
|
|
609
|
+
- **Irreversibility**: This action is irreversible. Once deleted, the logs
|
|
610
|
+
uploader config cannot be recovered.
|
|
611
|
+
|
|
612
|
+
Args:
|
|
613
|
+
extra_headers: Send extra headers
|
|
614
|
+
|
|
615
|
+
extra_query: Add additional query parameters to the request
|
|
616
|
+
|
|
617
|
+
extra_body: Add additional JSON properties to the request
|
|
618
|
+
|
|
619
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
620
|
+
"""
|
|
621
|
+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
|
|
622
|
+
return await self._delete(
|
|
623
|
+
f"/cdn/logs_uploader/configs/{id}"
|
|
624
|
+
if self._client._base_url_overridden
|
|
625
|
+
else f"https://api.gcore.com//cdn/logs_uploader/configs/{id}",
|
|
626
|
+
options=make_request_options(
|
|
627
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
628
|
+
),
|
|
629
|
+
cast_to=NoneType,
|
|
630
|
+
)
|
|
631
|
+
|
|
632
|
+
async def get(
|
|
633
|
+
self,
|
|
634
|
+
id: int,
|
|
635
|
+
*,
|
|
636
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
637
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
638
|
+
extra_headers: Headers | None = None,
|
|
639
|
+
extra_query: Query | None = None,
|
|
640
|
+
extra_body: Body | None = None,
|
|
641
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
642
|
+
) -> LogsUploaderConfig:
|
|
643
|
+
"""
|
|
644
|
+
Get information about logs uploader config.
|
|
645
|
+
|
|
646
|
+
Args:
|
|
647
|
+
extra_headers: Send extra headers
|
|
648
|
+
|
|
649
|
+
extra_query: Add additional query parameters to the request
|
|
650
|
+
|
|
651
|
+
extra_body: Add additional JSON properties to the request
|
|
652
|
+
|
|
653
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
654
|
+
"""
|
|
655
|
+
return await self._get(
|
|
656
|
+
f"/cdn/logs_uploader/configs/{id}"
|
|
657
|
+
if self._client._base_url_overridden
|
|
658
|
+
else f"https://api.gcore.com//cdn/logs_uploader/configs/{id}",
|
|
659
|
+
options=make_request_options(
|
|
660
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
661
|
+
),
|
|
662
|
+
cast_to=LogsUploaderConfig,
|
|
663
|
+
)
|
|
664
|
+
|
|
665
|
+
async def replace(
|
|
666
|
+
self,
|
|
667
|
+
id: int,
|
|
668
|
+
*,
|
|
669
|
+
name: str,
|
|
670
|
+
policy: int,
|
|
671
|
+
target: int,
|
|
672
|
+
enabled: bool | Omit = omit,
|
|
673
|
+
for_all_resources: bool | Omit = omit,
|
|
674
|
+
resources: Iterable[int] | Omit = omit,
|
|
675
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
676
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
677
|
+
extra_headers: Headers | None = None,
|
|
678
|
+
extra_query: Query | None = None,
|
|
679
|
+
extra_body: Body | None = None,
|
|
680
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
681
|
+
) -> LogsUploaderConfig:
|
|
682
|
+
"""
|
|
683
|
+
Change logs uploader config.
|
|
684
|
+
|
|
685
|
+
Args:
|
|
686
|
+
name: Name of the config.
|
|
687
|
+
|
|
688
|
+
policy: ID of the policy that should be assigned to given config.
|
|
689
|
+
|
|
690
|
+
target: ID of the target to which logs should be uploaded.
|
|
691
|
+
|
|
692
|
+
enabled: Enables or disables the config.
|
|
693
|
+
|
|
694
|
+
for_all_resources: If set to true, the config will be applied to all CDN resources. If set to
|
|
695
|
+
false, the config will be applied to the resources specified in the `resources`
|
|
696
|
+
field.
|
|
697
|
+
|
|
698
|
+
resources: List of resource IDs to which the config should be applied.
|
|
699
|
+
|
|
700
|
+
extra_headers: Send extra headers
|
|
701
|
+
|
|
702
|
+
extra_query: Add additional query parameters to the request
|
|
703
|
+
|
|
704
|
+
extra_body: Add additional JSON properties to the request
|
|
705
|
+
|
|
706
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
707
|
+
"""
|
|
708
|
+
return await self._put(
|
|
709
|
+
f"/cdn/logs_uploader/configs/{id}"
|
|
710
|
+
if self._client._base_url_overridden
|
|
711
|
+
else f"https://api.gcore.com//cdn/logs_uploader/configs/{id}",
|
|
712
|
+
body=await async_maybe_transform(
|
|
713
|
+
{
|
|
714
|
+
"name": name,
|
|
715
|
+
"policy": policy,
|
|
716
|
+
"target": target,
|
|
717
|
+
"enabled": enabled,
|
|
718
|
+
"for_all_resources": for_all_resources,
|
|
719
|
+
"resources": resources,
|
|
720
|
+
},
|
|
721
|
+
config_replace_params.ConfigReplaceParams,
|
|
722
|
+
),
|
|
723
|
+
options=make_request_options(
|
|
724
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
725
|
+
),
|
|
726
|
+
cast_to=LogsUploaderConfig,
|
|
727
|
+
)
|
|
728
|
+
|
|
729
|
+
async def validate(
|
|
730
|
+
self,
|
|
731
|
+
id: int,
|
|
732
|
+
*,
|
|
733
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
734
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
735
|
+
extra_headers: Headers | None = None,
|
|
736
|
+
extra_query: Query | None = None,
|
|
737
|
+
extra_body: Body | None = None,
|
|
738
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
739
|
+
) -> LogsUploaderValidation:
|
|
740
|
+
"""
|
|
741
|
+
Validate logs uploader config.
|
|
742
|
+
|
|
743
|
+
Args:
|
|
744
|
+
extra_headers: Send extra headers
|
|
745
|
+
|
|
746
|
+
extra_query: Add additional query parameters to the request
|
|
747
|
+
|
|
748
|
+
extra_body: Add additional JSON properties to the request
|
|
749
|
+
|
|
750
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
751
|
+
"""
|
|
752
|
+
return await self._post(
|
|
753
|
+
f"/cdn/logs_uploader/configs/{id}/validate"
|
|
754
|
+
if self._client._base_url_overridden
|
|
755
|
+
else f"https://api.gcore.com//cdn/logs_uploader/configs/{id}/validate",
|
|
756
|
+
options=make_request_options(
|
|
757
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
758
|
+
),
|
|
759
|
+
cast_to=LogsUploaderValidation,
|
|
760
|
+
)
|
|
761
|
+
|
|
762
|
+
|
|
763
|
+
class ConfigsResourceWithRawResponse:
|
|
764
|
+
def __init__(self, configs: ConfigsResource) -> None:
|
|
765
|
+
self._configs = configs
|
|
766
|
+
|
|
767
|
+
self.create = to_raw_response_wrapper(
|
|
768
|
+
configs.create,
|
|
769
|
+
)
|
|
770
|
+
self.update = to_raw_response_wrapper(
|
|
771
|
+
configs.update,
|
|
772
|
+
)
|
|
773
|
+
self.list = to_raw_response_wrapper(
|
|
774
|
+
configs.list,
|
|
775
|
+
)
|
|
776
|
+
self.delete = to_raw_response_wrapper(
|
|
777
|
+
configs.delete,
|
|
778
|
+
)
|
|
779
|
+
self.get = to_raw_response_wrapper(
|
|
780
|
+
configs.get,
|
|
781
|
+
)
|
|
782
|
+
self.replace = to_raw_response_wrapper(
|
|
783
|
+
configs.replace,
|
|
784
|
+
)
|
|
785
|
+
self.validate = to_raw_response_wrapper(
|
|
786
|
+
configs.validate,
|
|
787
|
+
)
|
|
788
|
+
|
|
789
|
+
|
|
790
|
+
class AsyncConfigsResourceWithRawResponse:
|
|
791
|
+
def __init__(self, configs: AsyncConfigsResource) -> None:
|
|
792
|
+
self._configs = configs
|
|
793
|
+
|
|
794
|
+
self.create = async_to_raw_response_wrapper(
|
|
795
|
+
configs.create,
|
|
796
|
+
)
|
|
797
|
+
self.update = async_to_raw_response_wrapper(
|
|
798
|
+
configs.update,
|
|
799
|
+
)
|
|
800
|
+
self.list = async_to_raw_response_wrapper(
|
|
801
|
+
configs.list,
|
|
802
|
+
)
|
|
803
|
+
self.delete = async_to_raw_response_wrapper(
|
|
804
|
+
configs.delete,
|
|
805
|
+
)
|
|
806
|
+
self.get = async_to_raw_response_wrapper(
|
|
807
|
+
configs.get,
|
|
808
|
+
)
|
|
809
|
+
self.replace = async_to_raw_response_wrapper(
|
|
810
|
+
configs.replace,
|
|
811
|
+
)
|
|
812
|
+
self.validate = async_to_raw_response_wrapper(
|
|
813
|
+
configs.validate,
|
|
814
|
+
)
|
|
815
|
+
|
|
816
|
+
|
|
817
|
+
class ConfigsResourceWithStreamingResponse:
|
|
818
|
+
def __init__(self, configs: ConfigsResource) -> None:
|
|
819
|
+
self._configs = configs
|
|
820
|
+
|
|
821
|
+
self.create = to_streamed_response_wrapper(
|
|
822
|
+
configs.create,
|
|
823
|
+
)
|
|
824
|
+
self.update = to_streamed_response_wrapper(
|
|
825
|
+
configs.update,
|
|
826
|
+
)
|
|
827
|
+
self.list = to_streamed_response_wrapper(
|
|
828
|
+
configs.list,
|
|
829
|
+
)
|
|
830
|
+
self.delete = to_streamed_response_wrapper(
|
|
831
|
+
configs.delete,
|
|
832
|
+
)
|
|
833
|
+
self.get = to_streamed_response_wrapper(
|
|
834
|
+
configs.get,
|
|
835
|
+
)
|
|
836
|
+
self.replace = to_streamed_response_wrapper(
|
|
837
|
+
configs.replace,
|
|
838
|
+
)
|
|
839
|
+
self.validate = to_streamed_response_wrapper(
|
|
840
|
+
configs.validate,
|
|
841
|
+
)
|
|
842
|
+
|
|
843
|
+
|
|
844
|
+
class AsyncConfigsResourceWithStreamingResponse:
|
|
845
|
+
def __init__(self, configs: AsyncConfigsResource) -> None:
|
|
846
|
+
self._configs = configs
|
|
847
|
+
|
|
848
|
+
self.create = async_to_streamed_response_wrapper(
|
|
849
|
+
configs.create,
|
|
850
|
+
)
|
|
851
|
+
self.update = async_to_streamed_response_wrapper(
|
|
852
|
+
configs.update,
|
|
853
|
+
)
|
|
854
|
+
self.list = async_to_streamed_response_wrapper(
|
|
855
|
+
configs.list,
|
|
856
|
+
)
|
|
857
|
+
self.delete = async_to_streamed_response_wrapper(
|
|
858
|
+
configs.delete,
|
|
859
|
+
)
|
|
860
|
+
self.get = async_to_streamed_response_wrapper(
|
|
861
|
+
configs.get,
|
|
862
|
+
)
|
|
863
|
+
self.replace = async_to_streamed_response_wrapper(
|
|
864
|
+
configs.replace,
|
|
865
|
+
)
|
|
866
|
+
self.validate = async_to_streamed_response_wrapper(
|
|
867
|
+
configs.validate,
|
|
868
|
+
)
|