gcore 0.13.0__py3-none-any.whl → 0.14.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 +105 -81
- 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 +123 -107
- 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 +43 -27
- 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 +1977 -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 +1825 -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 +1803 -0
- gcore/types/cdn/resource_update_params.py +1794 -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 +1695 -0
- gcore/types/cdn/resources/origin_shielding.py +15 -0
- gcore/types/cdn/resources/rule_create_params.py +1652 -0
- gcore/types/cdn/resources/rule_list_response.py +10 -0
- gcore/types/cdn/resources/rule_replace_params.py +1654 -0
- gcore/types/cdn/resources/rule_update_params.py +1654 -0
- gcore/types/cdn/resources/shield_replace_params.py +16 -0
- gcore/types/cdn/rule_template.py +1666 -0
- gcore/types/cdn/rule_template_create_params.py +1636 -0
- gcore/types/cdn/rule_template_list.py +10 -0
- gcore/types/cdn/rule_template_replace_params.py +1636 -0
- gcore/types/cdn/rule_template_update_params.py +1636 -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 +1 -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/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/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/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 +7 -2
- gcore/types/iam/user.py +7 -2
- gcore/types/iam/user_detailed.py +7 -2
- gcore/types/iam/user_invite_params.py +4 -1
- gcore/types/iam/user_update.py +7 -2
- 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.14.0.dist-info}/METADATA +1 -1
- {gcore-0.13.0.dist-info → gcore-0.14.0.dist-info}/RECORD +334 -214
- {gcore-0.13.0.dist-info → gcore-0.14.0.dist-info}/WHEEL +0 -0
- {gcore-0.13.0.dist-info → gcore-0.14.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,1408 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
8
|
+
from ..._utils import maybe_transform, async_maybe_transform
|
|
9
|
+
from ..._compat import cached_property
|
|
10
|
+
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
11
|
+
from ..._response import (
|
|
12
|
+
to_raw_response_wrapper,
|
|
13
|
+
to_streamed_response_wrapper,
|
|
14
|
+
async_to_raw_response_wrapper,
|
|
15
|
+
async_to_streamed_response_wrapper,
|
|
16
|
+
)
|
|
17
|
+
from ...types.cdn import (
|
|
18
|
+
statistic_get_logs_usage_series_params,
|
|
19
|
+
statistic_get_shield_usage_series_params,
|
|
20
|
+
statistic_get_logs_usage_aggregated_params,
|
|
21
|
+
statistic_get_resource_usage_series_params,
|
|
22
|
+
statistic_get_shield_usage_aggregated_params,
|
|
23
|
+
statistic_get_resource_usage_aggregated_params,
|
|
24
|
+
)
|
|
25
|
+
from ..._base_client import make_request_options
|
|
26
|
+
from ...types.cdn.usage_series_stats import UsageSeriesStats
|
|
27
|
+
from ...types.cdn.resource_usage_stats import ResourceUsageStats
|
|
28
|
+
from ...types.cdn.logs_aggregated_stats import LogsAggregatedStats
|
|
29
|
+
from ...types.cdn.shield_aggregated_stats import ShieldAggregatedStats
|
|
30
|
+
from ...types.cdn.resource_aggregated_stats import ResourceAggregatedStats
|
|
31
|
+
|
|
32
|
+
__all__ = ["StatisticsResource", "AsyncStatisticsResource"]
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class StatisticsResource(SyncAPIResource):
|
|
36
|
+
@cached_property
|
|
37
|
+
def with_raw_response(self) -> StatisticsResourceWithRawResponse:
|
|
38
|
+
"""
|
|
39
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
40
|
+
the raw response object instead of the parsed content.
|
|
41
|
+
|
|
42
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
43
|
+
"""
|
|
44
|
+
return StatisticsResourceWithRawResponse(self)
|
|
45
|
+
|
|
46
|
+
@cached_property
|
|
47
|
+
def with_streaming_response(self) -> StatisticsResourceWithStreamingResponse:
|
|
48
|
+
"""
|
|
49
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
50
|
+
|
|
51
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
52
|
+
"""
|
|
53
|
+
return StatisticsResourceWithStreamingResponse(self)
|
|
54
|
+
|
|
55
|
+
def get_logs_usage_aggregated(
|
|
56
|
+
self,
|
|
57
|
+
*,
|
|
58
|
+
from_: str,
|
|
59
|
+
to: str,
|
|
60
|
+
flat: bool | Omit = omit,
|
|
61
|
+
group_by: str | Omit = omit,
|
|
62
|
+
resource: int | Omit = omit,
|
|
63
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
64
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
65
|
+
extra_headers: Headers | None = None,
|
|
66
|
+
extra_query: Query | None = None,
|
|
67
|
+
extra_body: Body | None = None,
|
|
68
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
69
|
+
) -> LogsAggregatedStats:
|
|
70
|
+
"""
|
|
71
|
+
Get the number of CDN resources that used raw logs.
|
|
72
|
+
|
|
73
|
+
Request URL parameters should be added as a query string after the endpoint.
|
|
74
|
+
|
|
75
|
+
Args:
|
|
76
|
+
from_: Beginning of the requested time period (ISO 8601/RFC 3339 format, UTC.)
|
|
77
|
+
|
|
78
|
+
to: End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
|
|
79
|
+
|
|
80
|
+
flat: The waу parameters are arranged in the response.
|
|
81
|
+
|
|
82
|
+
Possible values:
|
|
83
|
+
|
|
84
|
+
- **true** – Flat structure is used.
|
|
85
|
+
- **false** – Embedded structure is used (default.)
|
|
86
|
+
|
|
87
|
+
group_by: Output data grouping.
|
|
88
|
+
|
|
89
|
+
Possible value:
|
|
90
|
+
|
|
91
|
+
- **resource** - Data is grouped by CDN resources.
|
|
92
|
+
|
|
93
|
+
resource: CDN resources IDs by that statistics data is grouped.
|
|
94
|
+
|
|
95
|
+
To request multiple values, use:
|
|
96
|
+
|
|
97
|
+
- &resource=1&resource=2
|
|
98
|
+
|
|
99
|
+
extra_headers: Send extra headers
|
|
100
|
+
|
|
101
|
+
extra_query: Add additional query parameters to the request
|
|
102
|
+
|
|
103
|
+
extra_body: Add additional JSON properties to the request
|
|
104
|
+
|
|
105
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
106
|
+
"""
|
|
107
|
+
return self._get(
|
|
108
|
+
"/cdn/statistics/raw_logs_usage/aggregated"
|
|
109
|
+
if self._client._base_url_overridden
|
|
110
|
+
else "https://api.gcore.com//cdn/statistics/raw_logs_usage/aggregated",
|
|
111
|
+
options=make_request_options(
|
|
112
|
+
extra_headers=extra_headers,
|
|
113
|
+
extra_query=extra_query,
|
|
114
|
+
extra_body=extra_body,
|
|
115
|
+
timeout=timeout,
|
|
116
|
+
query=maybe_transform(
|
|
117
|
+
{
|
|
118
|
+
"from_": from_,
|
|
119
|
+
"to": to,
|
|
120
|
+
"flat": flat,
|
|
121
|
+
"group_by": group_by,
|
|
122
|
+
"resource": resource,
|
|
123
|
+
},
|
|
124
|
+
statistic_get_logs_usage_aggregated_params.StatisticGetLogsUsageAggregatedParams,
|
|
125
|
+
),
|
|
126
|
+
),
|
|
127
|
+
cast_to=LogsAggregatedStats,
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
def get_logs_usage_series(
|
|
131
|
+
self,
|
|
132
|
+
*,
|
|
133
|
+
from_: str,
|
|
134
|
+
to: str,
|
|
135
|
+
resource: int | Omit = omit,
|
|
136
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
137
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
138
|
+
extra_headers: Headers | None = None,
|
|
139
|
+
extra_query: Query | None = None,
|
|
140
|
+
extra_body: Body | None = None,
|
|
141
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
142
|
+
) -> UsageSeriesStats:
|
|
143
|
+
"""
|
|
144
|
+
Get raw logs usage statistics for up to 90 days starting today.
|
|
145
|
+
|
|
146
|
+
Request URL parameters should be added as a query string after the endpoint.
|
|
147
|
+
|
|
148
|
+
Args:
|
|
149
|
+
from_: Beginning of the requested time period (ISO 8601/RFC 3339 format, UTC.)
|
|
150
|
+
|
|
151
|
+
Example:
|
|
152
|
+
|
|
153
|
+
- &from=2020-01-01T00:00:00.000
|
|
154
|
+
|
|
155
|
+
to: End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
|
|
156
|
+
|
|
157
|
+
Example:
|
|
158
|
+
|
|
159
|
+
- &from=2020-01-01T00:00:00.000
|
|
160
|
+
|
|
161
|
+
resource: CDN resources IDs by that statistics data is grouped.
|
|
162
|
+
|
|
163
|
+
To request multiple values, use:
|
|
164
|
+
|
|
165
|
+
- &resource=1&resource=2
|
|
166
|
+
|
|
167
|
+
extra_headers: Send extra headers
|
|
168
|
+
|
|
169
|
+
extra_query: Add additional query parameters to the request
|
|
170
|
+
|
|
171
|
+
extra_body: Add additional JSON properties to the request
|
|
172
|
+
|
|
173
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
174
|
+
"""
|
|
175
|
+
return self._get(
|
|
176
|
+
"/cdn/statistics/raw_logs_usage/series"
|
|
177
|
+
if self._client._base_url_overridden
|
|
178
|
+
else "https://api.gcore.com//cdn/statistics/raw_logs_usage/series",
|
|
179
|
+
options=make_request_options(
|
|
180
|
+
extra_headers=extra_headers,
|
|
181
|
+
extra_query=extra_query,
|
|
182
|
+
extra_body=extra_body,
|
|
183
|
+
timeout=timeout,
|
|
184
|
+
query=maybe_transform(
|
|
185
|
+
{
|
|
186
|
+
"from_": from_,
|
|
187
|
+
"to": to,
|
|
188
|
+
"resource": resource,
|
|
189
|
+
},
|
|
190
|
+
statistic_get_logs_usage_series_params.StatisticGetLogsUsageSeriesParams,
|
|
191
|
+
),
|
|
192
|
+
),
|
|
193
|
+
cast_to=UsageSeriesStats,
|
|
194
|
+
)
|
|
195
|
+
|
|
196
|
+
def get_resource_usage_aggregated(
|
|
197
|
+
self,
|
|
198
|
+
*,
|
|
199
|
+
from_: str,
|
|
200
|
+
metrics: str,
|
|
201
|
+
service: str,
|
|
202
|
+
to: str,
|
|
203
|
+
countries: str | Omit = omit,
|
|
204
|
+
flat: bool | Omit = omit,
|
|
205
|
+
group_by: str | Omit = omit,
|
|
206
|
+
regions: str | Omit = omit,
|
|
207
|
+
resource: int | Omit = omit,
|
|
208
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
209
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
210
|
+
extra_headers: Headers | None = None,
|
|
211
|
+
extra_query: Query | None = None,
|
|
212
|
+
extra_body: Body | None = None,
|
|
213
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
214
|
+
) -> ResourceAggregatedStats:
|
|
215
|
+
"""
|
|
216
|
+
Get aggregated CDN resources statistics.
|
|
217
|
+
|
|
218
|
+
Request URL parameters should be added as a query string after the endpoint.
|
|
219
|
+
|
|
220
|
+
Aggregated data does not include data for the last two hours.
|
|
221
|
+
|
|
222
|
+
Args:
|
|
223
|
+
from_: Beginning of the requested time period (ISO 8601/RFC 3339 format, UTC.)
|
|
224
|
+
|
|
225
|
+
Examples:
|
|
226
|
+
|
|
227
|
+
- &from=2018-11-01T00:00:00.000
|
|
228
|
+
- &from=2018-11-01
|
|
229
|
+
|
|
230
|
+
metrics: Types of statistics data.
|
|
231
|
+
|
|
232
|
+
Possible values:
|
|
233
|
+
|
|
234
|
+
- **`upstream_bytes`** – Traffic in bytes from an origin server to CDN servers
|
|
235
|
+
or to origin shielding when used.
|
|
236
|
+
- **`sent_bytes`** – Traffic in bytes from CDN servers to clients.
|
|
237
|
+
- **`shield_bytes`** – Traffic in bytes from origin shielding to CDN servers.
|
|
238
|
+
- **`backblaze_bytes`** - Traffic in bytes from Backblaze origin.
|
|
239
|
+
- **`total_bytes`** – `shield_bytes`, `upstream_bytes` and `sent_bytes`
|
|
240
|
+
combined.
|
|
241
|
+
- **`cdn_bytes`** – `sent_bytes` and `shield_bytes` combined.
|
|
242
|
+
- **requests** – Number of requests to edge servers.
|
|
243
|
+
- **`responses_2xx`** – Number of 2xx response codes.
|
|
244
|
+
- **`responses_3xx`** – Number of 3xx response codes.
|
|
245
|
+
- **`responses_4xx`** – Number of 4xx response codes.
|
|
246
|
+
- **`responses_5xx`** – Number of 5xx response codes.
|
|
247
|
+
- **`responses_hit`** – Number of responses with the header Cache: HIT.
|
|
248
|
+
- **`responses_miss`** – Number of responses with the header Cache: MISS.
|
|
249
|
+
- **`response_types`** – Statistics by content type. It returns a number of
|
|
250
|
+
responses for content with different MIME types.
|
|
251
|
+
- **`cache_hit_traffic_ratio`** – Formula: 1 - `upstream_bytes` / `sent_bytes`.
|
|
252
|
+
We deduct the non-cached traffic from the total traffic amount.
|
|
253
|
+
- **`cache_hit_requests_ratio`** – Formula: `responses_hit` / requests. The
|
|
254
|
+
share of sending cached content.
|
|
255
|
+
- **`shield_traffic_ratio`** – Formula: (`shield_bytes` - `upstream_bytes`) /
|
|
256
|
+
`shield_bytes`. The efficiency of the Origin Shielding: how much more traffic
|
|
257
|
+
is sent from the Origin Shielding than from the origin.
|
|
258
|
+
- **`image_processed`** - Number of images transformed on the Image optimization
|
|
259
|
+
service.
|
|
260
|
+
- **`request_time`** - Time elapsed between the first bytes of a request were
|
|
261
|
+
processed and logging after the last bytes were sent to a user.
|
|
262
|
+
- **`upstream_response_time`** - Number of milliseconds it took to receive a
|
|
263
|
+
response from an origin. If upstream `response_time_` contains several
|
|
264
|
+
indications for one request (in case of more than 1 origin), we summarize
|
|
265
|
+
them. In case of aggregating several queries, the average of this amount is
|
|
266
|
+
calculated.
|
|
267
|
+
- **`95_percentile`** - Represents the 95th percentile of network bandwidth
|
|
268
|
+
usage in bytes per second. This means that 95% of the time, the network
|
|
269
|
+
resource usage was below this value.
|
|
270
|
+
- **`max_bandwidth`** - The maximum network bandwidth that was used during the
|
|
271
|
+
selected time represented in bytes per second.
|
|
272
|
+
- **`min_bandwidth`** - The minimum network bandwidth that was used during the
|
|
273
|
+
selected time represented in bytes per second.
|
|
274
|
+
|
|
275
|
+
Metrics **`upstream_response_time`** and **`request_time`** should be requested
|
|
276
|
+
separately from other metrics
|
|
277
|
+
|
|
278
|
+
service: Service name.
|
|
279
|
+
|
|
280
|
+
Possible value:
|
|
281
|
+
|
|
282
|
+
- CDN
|
|
283
|
+
|
|
284
|
+
to: End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
|
|
285
|
+
|
|
286
|
+
Examples:
|
|
287
|
+
|
|
288
|
+
- &to=2018-11-01T00:00:00.000
|
|
289
|
+
- &to=2018-11-01
|
|
290
|
+
|
|
291
|
+
countries: Names of countries for which data is displayed.
|
|
292
|
+
|
|
293
|
+
English short name from [ISO 3166 standard][1] without the definite article
|
|
294
|
+
"the" should be used.
|
|
295
|
+
|
|
296
|
+
[1]: https://www.iso.org/obp/ui/#search/code/
|
|
297
|
+
|
|
298
|
+
To request multiple values, use:
|
|
299
|
+
|
|
300
|
+
- &countries=france&countries=denmark
|
|
301
|
+
|
|
302
|
+
flat: The waу the parameters are arranged in the response.
|
|
303
|
+
|
|
304
|
+
Possible values:
|
|
305
|
+
|
|
306
|
+
- **true** – Flat structure is used.
|
|
307
|
+
- **false** – Embedded structure is used (default.)
|
|
308
|
+
|
|
309
|
+
group_by: Output data grouping.
|
|
310
|
+
|
|
311
|
+
Possible values:
|
|
312
|
+
|
|
313
|
+
- **resource** – Data is grouped by CDN resources IDs.
|
|
314
|
+
- **region** – Data is grouped by regions of CDN edge servers.
|
|
315
|
+
- **country** – Data is grouped by countries of CDN edge servers.
|
|
316
|
+
- **vhost** – Data is grouped by resources CNAME.
|
|
317
|
+
|
|
318
|
+
To request multiple values, use:
|
|
319
|
+
|
|
320
|
+
- &`group_by`=region&`group_by`=resource
|
|
321
|
+
|
|
322
|
+
regions: Regions for which data is displayed.
|
|
323
|
+
|
|
324
|
+
Possible values:
|
|
325
|
+
|
|
326
|
+
- **na** – North America
|
|
327
|
+
- **eu** – Europe
|
|
328
|
+
- **cis** – Commonwealth of Independent States
|
|
329
|
+
- **asia** – Asia
|
|
330
|
+
- **au** – Australia
|
|
331
|
+
- **latam** – Latin America
|
|
332
|
+
- **me** – Middle East
|
|
333
|
+
- **africa** - Africa
|
|
334
|
+
- **sa** - South America
|
|
335
|
+
|
|
336
|
+
resource: CDN resources IDs by which statistics data is grouped.
|
|
337
|
+
|
|
338
|
+
To request multiple values, use:
|
|
339
|
+
|
|
340
|
+
- &resource=1&resource=2
|
|
341
|
+
|
|
342
|
+
If CDN resource ID is not specified, data related to all CDN resources is
|
|
343
|
+
returned.
|
|
344
|
+
|
|
345
|
+
extra_headers: Send extra headers
|
|
346
|
+
|
|
347
|
+
extra_query: Add additional query parameters to the request
|
|
348
|
+
|
|
349
|
+
extra_body: Add additional JSON properties to the request
|
|
350
|
+
|
|
351
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
352
|
+
"""
|
|
353
|
+
return self._get(
|
|
354
|
+
"/cdn/statistics/aggregate/stats"
|
|
355
|
+
if self._client._base_url_overridden
|
|
356
|
+
else "https://api.gcore.com//cdn/statistics/aggregate/stats",
|
|
357
|
+
options=make_request_options(
|
|
358
|
+
extra_headers=extra_headers,
|
|
359
|
+
extra_query=extra_query,
|
|
360
|
+
extra_body=extra_body,
|
|
361
|
+
timeout=timeout,
|
|
362
|
+
query=maybe_transform(
|
|
363
|
+
{
|
|
364
|
+
"from_": from_,
|
|
365
|
+
"metrics": metrics,
|
|
366
|
+
"service": service,
|
|
367
|
+
"to": to,
|
|
368
|
+
"countries": countries,
|
|
369
|
+
"flat": flat,
|
|
370
|
+
"group_by": group_by,
|
|
371
|
+
"regions": regions,
|
|
372
|
+
"resource": resource,
|
|
373
|
+
},
|
|
374
|
+
statistic_get_resource_usage_aggregated_params.StatisticGetResourceUsageAggregatedParams,
|
|
375
|
+
),
|
|
376
|
+
),
|
|
377
|
+
cast_to=ResourceAggregatedStats,
|
|
378
|
+
)
|
|
379
|
+
|
|
380
|
+
def get_resource_usage_series(
|
|
381
|
+
self,
|
|
382
|
+
*,
|
|
383
|
+
from_: str,
|
|
384
|
+
granularity: str,
|
|
385
|
+
metrics: str,
|
|
386
|
+
service: str,
|
|
387
|
+
to: str,
|
|
388
|
+
countries: str | Omit = omit,
|
|
389
|
+
group_by: str | Omit = omit,
|
|
390
|
+
regions: str | Omit = omit,
|
|
391
|
+
resource: int | Omit = omit,
|
|
392
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
393
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
394
|
+
extra_headers: Headers | None = None,
|
|
395
|
+
extra_query: Query | None = None,
|
|
396
|
+
extra_body: Body | None = None,
|
|
397
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
398
|
+
) -> ResourceUsageStats:
|
|
399
|
+
"""
|
|
400
|
+
Get CDN resources statistics for up to 365 days starting today.
|
|
401
|
+
|
|
402
|
+
Args:
|
|
403
|
+
from_: Beginning of the requested time period (ISO 8601/RFC 3339 format, UTC.)
|
|
404
|
+
|
|
405
|
+
granularity: Duration of the time blocks into which the data will be divided.
|
|
406
|
+
|
|
407
|
+
Possible values:
|
|
408
|
+
|
|
409
|
+
- **1m** - available only for up to 1 month in the past.
|
|
410
|
+
- **5m**
|
|
411
|
+
- **15m**
|
|
412
|
+
- **1h**
|
|
413
|
+
- **1d**
|
|
414
|
+
|
|
415
|
+
metrics: Types of statistics data.
|
|
416
|
+
|
|
417
|
+
Possible values:
|
|
418
|
+
|
|
419
|
+
- **`upstream_bytes`** – Traffic in bytes from an origin server to CDN servers
|
|
420
|
+
or to origin shielding when used.
|
|
421
|
+
- **`sent_bytes`** – Traffic in bytes from CDN servers to clients.
|
|
422
|
+
- **`shield_bytes`** – Traffic in bytes from origin shielding to CDN servers.
|
|
423
|
+
- **`backblaze_bytes`** - Traffic in bytes from Backblaze origin.
|
|
424
|
+
- **`total_bytes`** – `shield_bytes`, `upstream_bytes` and `sent_bytes`
|
|
425
|
+
combined.
|
|
426
|
+
- **`cdn_bytes`** – `sent_bytes` and `shield_bytes` combined.
|
|
427
|
+
- **requests** – Number of requests to edge servers.
|
|
428
|
+
- **`responses_2xx`** – Number of 2xx response codes.
|
|
429
|
+
- **`responses_3xx`** – Number of 3xx response codes.
|
|
430
|
+
- **`responses_4xx`** – Number of 4xx response codes.
|
|
431
|
+
- **`responses_5xx`** – Number of 5xx response codes.
|
|
432
|
+
- **`responses_hit`** – Number of responses with the header Cache: HIT.
|
|
433
|
+
- **`responses_miss`** – Number of responses with the header Cache: MISS.
|
|
434
|
+
- **`response_types`** – Statistics by content type. It returns a number of
|
|
435
|
+
responses for content with different MIME types.
|
|
436
|
+
- **`cache_hit_traffic_ratio`** – Formula: 1 - `upstream_bytes` / `sent_bytes`.
|
|
437
|
+
We deduct the non-cached traffic from the total traffic amount.
|
|
438
|
+
- **`cache_hit_requests_ratio`** – Formula: `responses_hit` / requests. The
|
|
439
|
+
share of sending cached content.
|
|
440
|
+
- **`shield_traffic_ratio`** – Formula: (`shield_bytes` - `upstream_bytes`) /
|
|
441
|
+
`shield_bytes`. The efficiency of the Origin Shielding: how much more traffic
|
|
442
|
+
is sent from the Origin Shielding than from the origin.
|
|
443
|
+
- **`image_processed`** - Number of images transformed on the Image optimization
|
|
444
|
+
service.
|
|
445
|
+
- **`request_time`** - Time elapsed between the first bytes of a request were
|
|
446
|
+
processed and logging after the last bytes were sent to a user.
|
|
447
|
+
- **`upstream_response_time`** - Number of milliseconds it took to receive a
|
|
448
|
+
response from an origin. If upstream `response_time_` contains several
|
|
449
|
+
indications for one request (in case of more than 1 origin), we summarize
|
|
450
|
+
them. In case of aggregating several queries, the average of this amount is
|
|
451
|
+
calculated.
|
|
452
|
+
|
|
453
|
+
Metrics **`upstream_response_time`** and **`request_time`** should be requested
|
|
454
|
+
separately from other metrics
|
|
455
|
+
|
|
456
|
+
service: Service name.
|
|
457
|
+
|
|
458
|
+
Possible value:
|
|
459
|
+
|
|
460
|
+
- CDN
|
|
461
|
+
|
|
462
|
+
to: End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
|
|
463
|
+
|
|
464
|
+
countries: Names of countries for which data should be displayed. English short name from
|
|
465
|
+
[ISO 3166 standard][1] without the definite article ("the") should be used.
|
|
466
|
+
|
|
467
|
+
[1]: https://www.iso.org/obp/ui/#search/code/
|
|
468
|
+
|
|
469
|
+
To request multiple values, use:
|
|
470
|
+
|
|
471
|
+
- &countries=france&countries=denmark
|
|
472
|
+
|
|
473
|
+
group_by: Output data grouping.
|
|
474
|
+
|
|
475
|
+
Possible values:
|
|
476
|
+
|
|
477
|
+
- **resource** – Data is grouped by CDN resources IDs.
|
|
478
|
+
- **region** – Data is grouped by regions of CDN edge servers.
|
|
479
|
+
- **country** – Data is grouped by countries of CDN edge servers.
|
|
480
|
+
- **vhost** – Data is grouped by resources CNAMEs.
|
|
481
|
+
|
|
482
|
+
To request multiple values, use:
|
|
483
|
+
|
|
484
|
+
- &`group_by`=region&`group_by`=resource
|
|
485
|
+
|
|
486
|
+
regions: Regions for which data is displayed.
|
|
487
|
+
|
|
488
|
+
Possible values:
|
|
489
|
+
|
|
490
|
+
- **na** – North America
|
|
491
|
+
- **eu** – Europe
|
|
492
|
+
- **cis** – Commonwealth of Independent States
|
|
493
|
+
- **asia** – Asia
|
|
494
|
+
- **au** – Australia
|
|
495
|
+
- **latam** – Latin America
|
|
496
|
+
- **me** – Middle East
|
|
497
|
+
- **africa** - Africa
|
|
498
|
+
- **sa** - South America
|
|
499
|
+
|
|
500
|
+
resource: CDN resource IDs.
|
|
501
|
+
|
|
502
|
+
To request multiple values, use:
|
|
503
|
+
|
|
504
|
+
- &resource=1&resource=2
|
|
505
|
+
|
|
506
|
+
extra_headers: Send extra headers
|
|
507
|
+
|
|
508
|
+
extra_query: Add additional query parameters to the request
|
|
509
|
+
|
|
510
|
+
extra_body: Add additional JSON properties to the request
|
|
511
|
+
|
|
512
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
513
|
+
"""
|
|
514
|
+
return self._get(
|
|
515
|
+
"/cdn/statistics/series"
|
|
516
|
+
if self._client._base_url_overridden
|
|
517
|
+
else "https://api.gcore.com//cdn/statistics/series",
|
|
518
|
+
options=make_request_options(
|
|
519
|
+
extra_headers=extra_headers,
|
|
520
|
+
extra_query=extra_query,
|
|
521
|
+
extra_body=extra_body,
|
|
522
|
+
timeout=timeout,
|
|
523
|
+
query=maybe_transform(
|
|
524
|
+
{
|
|
525
|
+
"from_": from_,
|
|
526
|
+
"granularity": granularity,
|
|
527
|
+
"metrics": metrics,
|
|
528
|
+
"service": service,
|
|
529
|
+
"to": to,
|
|
530
|
+
"countries": countries,
|
|
531
|
+
"group_by": group_by,
|
|
532
|
+
"regions": regions,
|
|
533
|
+
"resource": resource,
|
|
534
|
+
},
|
|
535
|
+
statistic_get_resource_usage_series_params.StatisticGetResourceUsageSeriesParams,
|
|
536
|
+
),
|
|
537
|
+
),
|
|
538
|
+
cast_to=ResourceUsageStats,
|
|
539
|
+
)
|
|
540
|
+
|
|
541
|
+
def get_shield_usage_aggregated(
|
|
542
|
+
self,
|
|
543
|
+
*,
|
|
544
|
+
from_: str,
|
|
545
|
+
to: str,
|
|
546
|
+
flat: bool | Omit = omit,
|
|
547
|
+
group_by: str | Omit = omit,
|
|
548
|
+
resource: int | Omit = omit,
|
|
549
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
550
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
551
|
+
extra_headers: Headers | None = None,
|
|
552
|
+
extra_query: Query | None = None,
|
|
553
|
+
extra_body: Body | None = None,
|
|
554
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
555
|
+
) -> ShieldAggregatedStats:
|
|
556
|
+
"""
|
|
557
|
+
The number of CDN resources that use origin shielding.
|
|
558
|
+
|
|
559
|
+
Request URL parameters should be added as a query string after the endpoint.
|
|
560
|
+
|
|
561
|
+
Args:
|
|
562
|
+
from_: Beginning of the requested time period (ISO 8601/RFC 3339 format, UTC.)
|
|
563
|
+
|
|
564
|
+
to: End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
|
|
565
|
+
|
|
566
|
+
flat: The waу parameters are arranged in the response.
|
|
567
|
+
|
|
568
|
+
Possible values:
|
|
569
|
+
|
|
570
|
+
- **true** – Flat structure is used.
|
|
571
|
+
- **false** – Embedded structure is used (default.)
|
|
572
|
+
|
|
573
|
+
group_by: Output data grouping.
|
|
574
|
+
|
|
575
|
+
Possible value:
|
|
576
|
+
|
|
577
|
+
- **resource** - Data is grouped by CDN resource.
|
|
578
|
+
|
|
579
|
+
resource: CDN resources IDs by that statistics data is grouped.
|
|
580
|
+
|
|
581
|
+
To request multiple values, use:
|
|
582
|
+
|
|
583
|
+
- &resource=1&resource=2
|
|
584
|
+
|
|
585
|
+
extra_headers: Send extra headers
|
|
586
|
+
|
|
587
|
+
extra_query: Add additional query parameters to the request
|
|
588
|
+
|
|
589
|
+
extra_body: Add additional JSON properties to the request
|
|
590
|
+
|
|
591
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
592
|
+
"""
|
|
593
|
+
return self._get(
|
|
594
|
+
"/cdn/statistics/shield_usage/aggregated"
|
|
595
|
+
if self._client._base_url_overridden
|
|
596
|
+
else "https://api.gcore.com//cdn/statistics/shield_usage/aggregated",
|
|
597
|
+
options=make_request_options(
|
|
598
|
+
extra_headers=extra_headers,
|
|
599
|
+
extra_query=extra_query,
|
|
600
|
+
extra_body=extra_body,
|
|
601
|
+
timeout=timeout,
|
|
602
|
+
query=maybe_transform(
|
|
603
|
+
{
|
|
604
|
+
"from_": from_,
|
|
605
|
+
"to": to,
|
|
606
|
+
"flat": flat,
|
|
607
|
+
"group_by": group_by,
|
|
608
|
+
"resource": resource,
|
|
609
|
+
},
|
|
610
|
+
statistic_get_shield_usage_aggregated_params.StatisticGetShieldUsageAggregatedParams,
|
|
611
|
+
),
|
|
612
|
+
),
|
|
613
|
+
cast_to=ShieldAggregatedStats,
|
|
614
|
+
)
|
|
615
|
+
|
|
616
|
+
def get_shield_usage_series(
|
|
617
|
+
self,
|
|
618
|
+
*,
|
|
619
|
+
from_: str,
|
|
620
|
+
to: str,
|
|
621
|
+
resource: int | Omit = omit,
|
|
622
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
623
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
624
|
+
extra_headers: Headers | None = None,
|
|
625
|
+
extra_query: Query | None = None,
|
|
626
|
+
extra_body: Body | None = None,
|
|
627
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
628
|
+
) -> UsageSeriesStats:
|
|
629
|
+
"""
|
|
630
|
+
Get origin shielding usage statistics for up to 365 days starting from today.
|
|
631
|
+
|
|
632
|
+
Request URL parameters should be added as a query string after the endpoint.
|
|
633
|
+
|
|
634
|
+
Args:
|
|
635
|
+
from_: Beginning of the requested time period (ISO 8601/RFC 3339 format, UTC.)
|
|
636
|
+
|
|
637
|
+
to: End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
|
|
638
|
+
|
|
639
|
+
resource: CDN resources IDs by that statistics data is grouped.
|
|
640
|
+
|
|
641
|
+
To request multiple values, use:
|
|
642
|
+
|
|
643
|
+
- &resource=1&resource=2
|
|
644
|
+
|
|
645
|
+
extra_headers: Send extra headers
|
|
646
|
+
|
|
647
|
+
extra_query: Add additional query parameters to the request
|
|
648
|
+
|
|
649
|
+
extra_body: Add additional JSON properties to the request
|
|
650
|
+
|
|
651
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
652
|
+
"""
|
|
653
|
+
return self._get(
|
|
654
|
+
"/cdn/statistics/shield_usage/series"
|
|
655
|
+
if self._client._base_url_overridden
|
|
656
|
+
else "https://api.gcore.com//cdn/statistics/shield_usage/series",
|
|
657
|
+
options=make_request_options(
|
|
658
|
+
extra_headers=extra_headers,
|
|
659
|
+
extra_query=extra_query,
|
|
660
|
+
extra_body=extra_body,
|
|
661
|
+
timeout=timeout,
|
|
662
|
+
query=maybe_transform(
|
|
663
|
+
{
|
|
664
|
+
"from_": from_,
|
|
665
|
+
"to": to,
|
|
666
|
+
"resource": resource,
|
|
667
|
+
},
|
|
668
|
+
statistic_get_shield_usage_series_params.StatisticGetShieldUsageSeriesParams,
|
|
669
|
+
),
|
|
670
|
+
),
|
|
671
|
+
cast_to=UsageSeriesStats,
|
|
672
|
+
)
|
|
673
|
+
|
|
674
|
+
|
|
675
|
+
class AsyncStatisticsResource(AsyncAPIResource):
|
|
676
|
+
@cached_property
|
|
677
|
+
def with_raw_response(self) -> AsyncStatisticsResourceWithRawResponse:
|
|
678
|
+
"""
|
|
679
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
680
|
+
the raw response object instead of the parsed content.
|
|
681
|
+
|
|
682
|
+
For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
|
|
683
|
+
"""
|
|
684
|
+
return AsyncStatisticsResourceWithRawResponse(self)
|
|
685
|
+
|
|
686
|
+
@cached_property
|
|
687
|
+
def with_streaming_response(self) -> AsyncStatisticsResourceWithStreamingResponse:
|
|
688
|
+
"""
|
|
689
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
690
|
+
|
|
691
|
+
For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
|
|
692
|
+
"""
|
|
693
|
+
return AsyncStatisticsResourceWithStreamingResponse(self)
|
|
694
|
+
|
|
695
|
+
async def get_logs_usage_aggregated(
|
|
696
|
+
self,
|
|
697
|
+
*,
|
|
698
|
+
from_: str,
|
|
699
|
+
to: str,
|
|
700
|
+
flat: bool | Omit = omit,
|
|
701
|
+
group_by: str | Omit = omit,
|
|
702
|
+
resource: int | Omit = omit,
|
|
703
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
704
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
705
|
+
extra_headers: Headers | None = None,
|
|
706
|
+
extra_query: Query | None = None,
|
|
707
|
+
extra_body: Body | None = None,
|
|
708
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
709
|
+
) -> LogsAggregatedStats:
|
|
710
|
+
"""
|
|
711
|
+
Get the number of CDN resources that used raw logs.
|
|
712
|
+
|
|
713
|
+
Request URL parameters should be added as a query string after the endpoint.
|
|
714
|
+
|
|
715
|
+
Args:
|
|
716
|
+
from_: Beginning of the requested time period (ISO 8601/RFC 3339 format, UTC.)
|
|
717
|
+
|
|
718
|
+
to: End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
|
|
719
|
+
|
|
720
|
+
flat: The waу parameters are arranged in the response.
|
|
721
|
+
|
|
722
|
+
Possible values:
|
|
723
|
+
|
|
724
|
+
- **true** – Flat structure is used.
|
|
725
|
+
- **false** – Embedded structure is used (default.)
|
|
726
|
+
|
|
727
|
+
group_by: Output data grouping.
|
|
728
|
+
|
|
729
|
+
Possible value:
|
|
730
|
+
|
|
731
|
+
- **resource** - Data is grouped by CDN resources.
|
|
732
|
+
|
|
733
|
+
resource: CDN resources IDs by that statistics data is grouped.
|
|
734
|
+
|
|
735
|
+
To request multiple values, use:
|
|
736
|
+
|
|
737
|
+
- &resource=1&resource=2
|
|
738
|
+
|
|
739
|
+
extra_headers: Send extra headers
|
|
740
|
+
|
|
741
|
+
extra_query: Add additional query parameters to the request
|
|
742
|
+
|
|
743
|
+
extra_body: Add additional JSON properties to the request
|
|
744
|
+
|
|
745
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
746
|
+
"""
|
|
747
|
+
return await self._get(
|
|
748
|
+
"/cdn/statistics/raw_logs_usage/aggregated"
|
|
749
|
+
if self._client._base_url_overridden
|
|
750
|
+
else "https://api.gcore.com//cdn/statistics/raw_logs_usage/aggregated",
|
|
751
|
+
options=make_request_options(
|
|
752
|
+
extra_headers=extra_headers,
|
|
753
|
+
extra_query=extra_query,
|
|
754
|
+
extra_body=extra_body,
|
|
755
|
+
timeout=timeout,
|
|
756
|
+
query=await async_maybe_transform(
|
|
757
|
+
{
|
|
758
|
+
"from_": from_,
|
|
759
|
+
"to": to,
|
|
760
|
+
"flat": flat,
|
|
761
|
+
"group_by": group_by,
|
|
762
|
+
"resource": resource,
|
|
763
|
+
},
|
|
764
|
+
statistic_get_logs_usage_aggregated_params.StatisticGetLogsUsageAggregatedParams,
|
|
765
|
+
),
|
|
766
|
+
),
|
|
767
|
+
cast_to=LogsAggregatedStats,
|
|
768
|
+
)
|
|
769
|
+
|
|
770
|
+
async def get_logs_usage_series(
|
|
771
|
+
self,
|
|
772
|
+
*,
|
|
773
|
+
from_: str,
|
|
774
|
+
to: str,
|
|
775
|
+
resource: int | Omit = omit,
|
|
776
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
777
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
778
|
+
extra_headers: Headers | None = None,
|
|
779
|
+
extra_query: Query | None = None,
|
|
780
|
+
extra_body: Body | None = None,
|
|
781
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
782
|
+
) -> UsageSeriesStats:
|
|
783
|
+
"""
|
|
784
|
+
Get raw logs usage statistics for up to 90 days starting today.
|
|
785
|
+
|
|
786
|
+
Request URL parameters should be added as a query string after the endpoint.
|
|
787
|
+
|
|
788
|
+
Args:
|
|
789
|
+
from_: Beginning of the requested time period (ISO 8601/RFC 3339 format, UTC.)
|
|
790
|
+
|
|
791
|
+
Example:
|
|
792
|
+
|
|
793
|
+
- &from=2020-01-01T00:00:00.000
|
|
794
|
+
|
|
795
|
+
to: End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
|
|
796
|
+
|
|
797
|
+
Example:
|
|
798
|
+
|
|
799
|
+
- &from=2020-01-01T00:00:00.000
|
|
800
|
+
|
|
801
|
+
resource: CDN resources IDs by that statistics data is grouped.
|
|
802
|
+
|
|
803
|
+
To request multiple values, use:
|
|
804
|
+
|
|
805
|
+
- &resource=1&resource=2
|
|
806
|
+
|
|
807
|
+
extra_headers: Send extra headers
|
|
808
|
+
|
|
809
|
+
extra_query: Add additional query parameters to the request
|
|
810
|
+
|
|
811
|
+
extra_body: Add additional JSON properties to the request
|
|
812
|
+
|
|
813
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
814
|
+
"""
|
|
815
|
+
return await self._get(
|
|
816
|
+
"/cdn/statistics/raw_logs_usage/series"
|
|
817
|
+
if self._client._base_url_overridden
|
|
818
|
+
else "https://api.gcore.com//cdn/statistics/raw_logs_usage/series",
|
|
819
|
+
options=make_request_options(
|
|
820
|
+
extra_headers=extra_headers,
|
|
821
|
+
extra_query=extra_query,
|
|
822
|
+
extra_body=extra_body,
|
|
823
|
+
timeout=timeout,
|
|
824
|
+
query=await async_maybe_transform(
|
|
825
|
+
{
|
|
826
|
+
"from_": from_,
|
|
827
|
+
"to": to,
|
|
828
|
+
"resource": resource,
|
|
829
|
+
},
|
|
830
|
+
statistic_get_logs_usage_series_params.StatisticGetLogsUsageSeriesParams,
|
|
831
|
+
),
|
|
832
|
+
),
|
|
833
|
+
cast_to=UsageSeriesStats,
|
|
834
|
+
)
|
|
835
|
+
|
|
836
|
+
async def get_resource_usage_aggregated(
|
|
837
|
+
self,
|
|
838
|
+
*,
|
|
839
|
+
from_: str,
|
|
840
|
+
metrics: str,
|
|
841
|
+
service: str,
|
|
842
|
+
to: str,
|
|
843
|
+
countries: str | Omit = omit,
|
|
844
|
+
flat: bool | Omit = omit,
|
|
845
|
+
group_by: str | Omit = omit,
|
|
846
|
+
regions: str | Omit = omit,
|
|
847
|
+
resource: int | Omit = omit,
|
|
848
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
849
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
850
|
+
extra_headers: Headers | None = None,
|
|
851
|
+
extra_query: Query | None = None,
|
|
852
|
+
extra_body: Body | None = None,
|
|
853
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
854
|
+
) -> ResourceAggregatedStats:
|
|
855
|
+
"""
|
|
856
|
+
Get aggregated CDN resources statistics.
|
|
857
|
+
|
|
858
|
+
Request URL parameters should be added as a query string after the endpoint.
|
|
859
|
+
|
|
860
|
+
Aggregated data does not include data for the last two hours.
|
|
861
|
+
|
|
862
|
+
Args:
|
|
863
|
+
from_: Beginning of the requested time period (ISO 8601/RFC 3339 format, UTC.)
|
|
864
|
+
|
|
865
|
+
Examples:
|
|
866
|
+
|
|
867
|
+
- &from=2018-11-01T00:00:00.000
|
|
868
|
+
- &from=2018-11-01
|
|
869
|
+
|
|
870
|
+
metrics: Types of statistics data.
|
|
871
|
+
|
|
872
|
+
Possible values:
|
|
873
|
+
|
|
874
|
+
- **`upstream_bytes`** – Traffic in bytes from an origin server to CDN servers
|
|
875
|
+
or to origin shielding when used.
|
|
876
|
+
- **`sent_bytes`** – Traffic in bytes from CDN servers to clients.
|
|
877
|
+
- **`shield_bytes`** – Traffic in bytes from origin shielding to CDN servers.
|
|
878
|
+
- **`backblaze_bytes`** - Traffic in bytes from Backblaze origin.
|
|
879
|
+
- **`total_bytes`** – `shield_bytes`, `upstream_bytes` and `sent_bytes`
|
|
880
|
+
combined.
|
|
881
|
+
- **`cdn_bytes`** – `sent_bytes` and `shield_bytes` combined.
|
|
882
|
+
- **requests** – Number of requests to edge servers.
|
|
883
|
+
- **`responses_2xx`** – Number of 2xx response codes.
|
|
884
|
+
- **`responses_3xx`** – Number of 3xx response codes.
|
|
885
|
+
- **`responses_4xx`** – Number of 4xx response codes.
|
|
886
|
+
- **`responses_5xx`** – Number of 5xx response codes.
|
|
887
|
+
- **`responses_hit`** – Number of responses with the header Cache: HIT.
|
|
888
|
+
- **`responses_miss`** – Number of responses with the header Cache: MISS.
|
|
889
|
+
- **`response_types`** – Statistics by content type. It returns a number of
|
|
890
|
+
responses for content with different MIME types.
|
|
891
|
+
- **`cache_hit_traffic_ratio`** – Formula: 1 - `upstream_bytes` / `sent_bytes`.
|
|
892
|
+
We deduct the non-cached traffic from the total traffic amount.
|
|
893
|
+
- **`cache_hit_requests_ratio`** – Formula: `responses_hit` / requests. The
|
|
894
|
+
share of sending cached content.
|
|
895
|
+
- **`shield_traffic_ratio`** – Formula: (`shield_bytes` - `upstream_bytes`) /
|
|
896
|
+
`shield_bytes`. The efficiency of the Origin Shielding: how much more traffic
|
|
897
|
+
is sent from the Origin Shielding than from the origin.
|
|
898
|
+
- **`image_processed`** - Number of images transformed on the Image optimization
|
|
899
|
+
service.
|
|
900
|
+
- **`request_time`** - Time elapsed between the first bytes of a request were
|
|
901
|
+
processed and logging after the last bytes were sent to a user.
|
|
902
|
+
- **`upstream_response_time`** - Number of milliseconds it took to receive a
|
|
903
|
+
response from an origin. If upstream `response_time_` contains several
|
|
904
|
+
indications for one request (in case of more than 1 origin), we summarize
|
|
905
|
+
them. In case of aggregating several queries, the average of this amount is
|
|
906
|
+
calculated.
|
|
907
|
+
- **`95_percentile`** - Represents the 95th percentile of network bandwidth
|
|
908
|
+
usage in bytes per second. This means that 95% of the time, the network
|
|
909
|
+
resource usage was below this value.
|
|
910
|
+
- **`max_bandwidth`** - The maximum network bandwidth that was used during the
|
|
911
|
+
selected time represented in bytes per second.
|
|
912
|
+
- **`min_bandwidth`** - The minimum network bandwidth that was used during the
|
|
913
|
+
selected time represented in bytes per second.
|
|
914
|
+
|
|
915
|
+
Metrics **`upstream_response_time`** and **`request_time`** should be requested
|
|
916
|
+
separately from other metrics
|
|
917
|
+
|
|
918
|
+
service: Service name.
|
|
919
|
+
|
|
920
|
+
Possible value:
|
|
921
|
+
|
|
922
|
+
- CDN
|
|
923
|
+
|
|
924
|
+
to: End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
|
|
925
|
+
|
|
926
|
+
Examples:
|
|
927
|
+
|
|
928
|
+
- &to=2018-11-01T00:00:00.000
|
|
929
|
+
- &to=2018-11-01
|
|
930
|
+
|
|
931
|
+
countries: Names of countries for which data is displayed.
|
|
932
|
+
|
|
933
|
+
English short name from [ISO 3166 standard][1] without the definite article
|
|
934
|
+
"the" should be used.
|
|
935
|
+
|
|
936
|
+
[1]: https://www.iso.org/obp/ui/#search/code/
|
|
937
|
+
|
|
938
|
+
To request multiple values, use:
|
|
939
|
+
|
|
940
|
+
- &countries=france&countries=denmark
|
|
941
|
+
|
|
942
|
+
flat: The waу the parameters are arranged in the response.
|
|
943
|
+
|
|
944
|
+
Possible values:
|
|
945
|
+
|
|
946
|
+
- **true** – Flat structure is used.
|
|
947
|
+
- **false** – Embedded structure is used (default.)
|
|
948
|
+
|
|
949
|
+
group_by: Output data grouping.
|
|
950
|
+
|
|
951
|
+
Possible values:
|
|
952
|
+
|
|
953
|
+
- **resource** – Data is grouped by CDN resources IDs.
|
|
954
|
+
- **region** – Data is grouped by regions of CDN edge servers.
|
|
955
|
+
- **country** – Data is grouped by countries of CDN edge servers.
|
|
956
|
+
- **vhost** – Data is grouped by resources CNAME.
|
|
957
|
+
|
|
958
|
+
To request multiple values, use:
|
|
959
|
+
|
|
960
|
+
- &`group_by`=region&`group_by`=resource
|
|
961
|
+
|
|
962
|
+
regions: Regions for which data is displayed.
|
|
963
|
+
|
|
964
|
+
Possible values:
|
|
965
|
+
|
|
966
|
+
- **na** – North America
|
|
967
|
+
- **eu** – Europe
|
|
968
|
+
- **cis** – Commonwealth of Independent States
|
|
969
|
+
- **asia** – Asia
|
|
970
|
+
- **au** – Australia
|
|
971
|
+
- **latam** – Latin America
|
|
972
|
+
- **me** – Middle East
|
|
973
|
+
- **africa** - Africa
|
|
974
|
+
- **sa** - South America
|
|
975
|
+
|
|
976
|
+
resource: CDN resources IDs by which statistics data is grouped.
|
|
977
|
+
|
|
978
|
+
To request multiple values, use:
|
|
979
|
+
|
|
980
|
+
- &resource=1&resource=2
|
|
981
|
+
|
|
982
|
+
If CDN resource ID is not specified, data related to all CDN resources is
|
|
983
|
+
returned.
|
|
984
|
+
|
|
985
|
+
extra_headers: Send extra headers
|
|
986
|
+
|
|
987
|
+
extra_query: Add additional query parameters to the request
|
|
988
|
+
|
|
989
|
+
extra_body: Add additional JSON properties to the request
|
|
990
|
+
|
|
991
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
992
|
+
"""
|
|
993
|
+
return await self._get(
|
|
994
|
+
"/cdn/statistics/aggregate/stats"
|
|
995
|
+
if self._client._base_url_overridden
|
|
996
|
+
else "https://api.gcore.com//cdn/statistics/aggregate/stats",
|
|
997
|
+
options=make_request_options(
|
|
998
|
+
extra_headers=extra_headers,
|
|
999
|
+
extra_query=extra_query,
|
|
1000
|
+
extra_body=extra_body,
|
|
1001
|
+
timeout=timeout,
|
|
1002
|
+
query=await async_maybe_transform(
|
|
1003
|
+
{
|
|
1004
|
+
"from_": from_,
|
|
1005
|
+
"metrics": metrics,
|
|
1006
|
+
"service": service,
|
|
1007
|
+
"to": to,
|
|
1008
|
+
"countries": countries,
|
|
1009
|
+
"flat": flat,
|
|
1010
|
+
"group_by": group_by,
|
|
1011
|
+
"regions": regions,
|
|
1012
|
+
"resource": resource,
|
|
1013
|
+
},
|
|
1014
|
+
statistic_get_resource_usage_aggregated_params.StatisticGetResourceUsageAggregatedParams,
|
|
1015
|
+
),
|
|
1016
|
+
),
|
|
1017
|
+
cast_to=ResourceAggregatedStats,
|
|
1018
|
+
)
|
|
1019
|
+
|
|
1020
|
+
async def get_resource_usage_series(
|
|
1021
|
+
self,
|
|
1022
|
+
*,
|
|
1023
|
+
from_: str,
|
|
1024
|
+
granularity: str,
|
|
1025
|
+
metrics: str,
|
|
1026
|
+
service: str,
|
|
1027
|
+
to: str,
|
|
1028
|
+
countries: str | Omit = omit,
|
|
1029
|
+
group_by: str | Omit = omit,
|
|
1030
|
+
regions: str | Omit = omit,
|
|
1031
|
+
resource: int | Omit = omit,
|
|
1032
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1033
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1034
|
+
extra_headers: Headers | None = None,
|
|
1035
|
+
extra_query: Query | None = None,
|
|
1036
|
+
extra_body: Body | None = None,
|
|
1037
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1038
|
+
) -> ResourceUsageStats:
|
|
1039
|
+
"""
|
|
1040
|
+
Get CDN resources statistics for up to 365 days starting today.
|
|
1041
|
+
|
|
1042
|
+
Args:
|
|
1043
|
+
from_: Beginning of the requested time period (ISO 8601/RFC 3339 format, UTC.)
|
|
1044
|
+
|
|
1045
|
+
granularity: Duration of the time blocks into which the data will be divided.
|
|
1046
|
+
|
|
1047
|
+
Possible values:
|
|
1048
|
+
|
|
1049
|
+
- **1m** - available only for up to 1 month in the past.
|
|
1050
|
+
- **5m**
|
|
1051
|
+
- **15m**
|
|
1052
|
+
- **1h**
|
|
1053
|
+
- **1d**
|
|
1054
|
+
|
|
1055
|
+
metrics: Types of statistics data.
|
|
1056
|
+
|
|
1057
|
+
Possible values:
|
|
1058
|
+
|
|
1059
|
+
- **`upstream_bytes`** – Traffic in bytes from an origin server to CDN servers
|
|
1060
|
+
or to origin shielding when used.
|
|
1061
|
+
- **`sent_bytes`** – Traffic in bytes from CDN servers to clients.
|
|
1062
|
+
- **`shield_bytes`** – Traffic in bytes from origin shielding to CDN servers.
|
|
1063
|
+
- **`backblaze_bytes`** - Traffic in bytes from Backblaze origin.
|
|
1064
|
+
- **`total_bytes`** – `shield_bytes`, `upstream_bytes` and `sent_bytes`
|
|
1065
|
+
combined.
|
|
1066
|
+
- **`cdn_bytes`** – `sent_bytes` and `shield_bytes` combined.
|
|
1067
|
+
- **requests** – Number of requests to edge servers.
|
|
1068
|
+
- **`responses_2xx`** – Number of 2xx response codes.
|
|
1069
|
+
- **`responses_3xx`** – Number of 3xx response codes.
|
|
1070
|
+
- **`responses_4xx`** – Number of 4xx response codes.
|
|
1071
|
+
- **`responses_5xx`** – Number of 5xx response codes.
|
|
1072
|
+
- **`responses_hit`** – Number of responses with the header Cache: HIT.
|
|
1073
|
+
- **`responses_miss`** – Number of responses with the header Cache: MISS.
|
|
1074
|
+
- **`response_types`** – Statistics by content type. It returns a number of
|
|
1075
|
+
responses for content with different MIME types.
|
|
1076
|
+
- **`cache_hit_traffic_ratio`** – Formula: 1 - `upstream_bytes` / `sent_bytes`.
|
|
1077
|
+
We deduct the non-cached traffic from the total traffic amount.
|
|
1078
|
+
- **`cache_hit_requests_ratio`** – Formula: `responses_hit` / requests. The
|
|
1079
|
+
share of sending cached content.
|
|
1080
|
+
- **`shield_traffic_ratio`** – Formula: (`shield_bytes` - `upstream_bytes`) /
|
|
1081
|
+
`shield_bytes`. The efficiency of the Origin Shielding: how much more traffic
|
|
1082
|
+
is sent from the Origin Shielding than from the origin.
|
|
1083
|
+
- **`image_processed`** - Number of images transformed on the Image optimization
|
|
1084
|
+
service.
|
|
1085
|
+
- **`request_time`** - Time elapsed between the first bytes of a request were
|
|
1086
|
+
processed and logging after the last bytes were sent to a user.
|
|
1087
|
+
- **`upstream_response_time`** - Number of milliseconds it took to receive a
|
|
1088
|
+
response from an origin. If upstream `response_time_` contains several
|
|
1089
|
+
indications for one request (in case of more than 1 origin), we summarize
|
|
1090
|
+
them. In case of aggregating several queries, the average of this amount is
|
|
1091
|
+
calculated.
|
|
1092
|
+
|
|
1093
|
+
Metrics **`upstream_response_time`** and **`request_time`** should be requested
|
|
1094
|
+
separately from other metrics
|
|
1095
|
+
|
|
1096
|
+
service: Service name.
|
|
1097
|
+
|
|
1098
|
+
Possible value:
|
|
1099
|
+
|
|
1100
|
+
- CDN
|
|
1101
|
+
|
|
1102
|
+
to: End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
|
|
1103
|
+
|
|
1104
|
+
countries: Names of countries for which data should be displayed. English short name from
|
|
1105
|
+
[ISO 3166 standard][1] without the definite article ("the") should be used.
|
|
1106
|
+
|
|
1107
|
+
[1]: https://www.iso.org/obp/ui/#search/code/
|
|
1108
|
+
|
|
1109
|
+
To request multiple values, use:
|
|
1110
|
+
|
|
1111
|
+
- &countries=france&countries=denmark
|
|
1112
|
+
|
|
1113
|
+
group_by: Output data grouping.
|
|
1114
|
+
|
|
1115
|
+
Possible values:
|
|
1116
|
+
|
|
1117
|
+
- **resource** – Data is grouped by CDN resources IDs.
|
|
1118
|
+
- **region** – Data is grouped by regions of CDN edge servers.
|
|
1119
|
+
- **country** – Data is grouped by countries of CDN edge servers.
|
|
1120
|
+
- **vhost** – Data is grouped by resources CNAMEs.
|
|
1121
|
+
|
|
1122
|
+
To request multiple values, use:
|
|
1123
|
+
|
|
1124
|
+
- &`group_by`=region&`group_by`=resource
|
|
1125
|
+
|
|
1126
|
+
regions: Regions for which data is displayed.
|
|
1127
|
+
|
|
1128
|
+
Possible values:
|
|
1129
|
+
|
|
1130
|
+
- **na** – North America
|
|
1131
|
+
- **eu** – Europe
|
|
1132
|
+
- **cis** – Commonwealth of Independent States
|
|
1133
|
+
- **asia** – Asia
|
|
1134
|
+
- **au** – Australia
|
|
1135
|
+
- **latam** – Latin America
|
|
1136
|
+
- **me** – Middle East
|
|
1137
|
+
- **africa** - Africa
|
|
1138
|
+
- **sa** - South America
|
|
1139
|
+
|
|
1140
|
+
resource: CDN resource IDs.
|
|
1141
|
+
|
|
1142
|
+
To request multiple values, use:
|
|
1143
|
+
|
|
1144
|
+
- &resource=1&resource=2
|
|
1145
|
+
|
|
1146
|
+
extra_headers: Send extra headers
|
|
1147
|
+
|
|
1148
|
+
extra_query: Add additional query parameters to the request
|
|
1149
|
+
|
|
1150
|
+
extra_body: Add additional JSON properties to the request
|
|
1151
|
+
|
|
1152
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
1153
|
+
"""
|
|
1154
|
+
return await self._get(
|
|
1155
|
+
"/cdn/statistics/series"
|
|
1156
|
+
if self._client._base_url_overridden
|
|
1157
|
+
else "https://api.gcore.com//cdn/statistics/series",
|
|
1158
|
+
options=make_request_options(
|
|
1159
|
+
extra_headers=extra_headers,
|
|
1160
|
+
extra_query=extra_query,
|
|
1161
|
+
extra_body=extra_body,
|
|
1162
|
+
timeout=timeout,
|
|
1163
|
+
query=await async_maybe_transform(
|
|
1164
|
+
{
|
|
1165
|
+
"from_": from_,
|
|
1166
|
+
"granularity": granularity,
|
|
1167
|
+
"metrics": metrics,
|
|
1168
|
+
"service": service,
|
|
1169
|
+
"to": to,
|
|
1170
|
+
"countries": countries,
|
|
1171
|
+
"group_by": group_by,
|
|
1172
|
+
"regions": regions,
|
|
1173
|
+
"resource": resource,
|
|
1174
|
+
},
|
|
1175
|
+
statistic_get_resource_usage_series_params.StatisticGetResourceUsageSeriesParams,
|
|
1176
|
+
),
|
|
1177
|
+
),
|
|
1178
|
+
cast_to=ResourceUsageStats,
|
|
1179
|
+
)
|
|
1180
|
+
|
|
1181
|
+
async def get_shield_usage_aggregated(
|
|
1182
|
+
self,
|
|
1183
|
+
*,
|
|
1184
|
+
from_: str,
|
|
1185
|
+
to: str,
|
|
1186
|
+
flat: bool | Omit = omit,
|
|
1187
|
+
group_by: str | Omit = omit,
|
|
1188
|
+
resource: int | Omit = omit,
|
|
1189
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1190
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1191
|
+
extra_headers: Headers | None = None,
|
|
1192
|
+
extra_query: Query | None = None,
|
|
1193
|
+
extra_body: Body | None = None,
|
|
1194
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1195
|
+
) -> ShieldAggregatedStats:
|
|
1196
|
+
"""
|
|
1197
|
+
The number of CDN resources that use origin shielding.
|
|
1198
|
+
|
|
1199
|
+
Request URL parameters should be added as a query string after the endpoint.
|
|
1200
|
+
|
|
1201
|
+
Args:
|
|
1202
|
+
from_: Beginning of the requested time period (ISO 8601/RFC 3339 format, UTC.)
|
|
1203
|
+
|
|
1204
|
+
to: End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
|
|
1205
|
+
|
|
1206
|
+
flat: The waу parameters are arranged in the response.
|
|
1207
|
+
|
|
1208
|
+
Possible values:
|
|
1209
|
+
|
|
1210
|
+
- **true** – Flat structure is used.
|
|
1211
|
+
- **false** – Embedded structure is used (default.)
|
|
1212
|
+
|
|
1213
|
+
group_by: Output data grouping.
|
|
1214
|
+
|
|
1215
|
+
Possible value:
|
|
1216
|
+
|
|
1217
|
+
- **resource** - Data is grouped by CDN resource.
|
|
1218
|
+
|
|
1219
|
+
resource: CDN resources IDs by that statistics data is grouped.
|
|
1220
|
+
|
|
1221
|
+
To request multiple values, use:
|
|
1222
|
+
|
|
1223
|
+
- &resource=1&resource=2
|
|
1224
|
+
|
|
1225
|
+
extra_headers: Send extra headers
|
|
1226
|
+
|
|
1227
|
+
extra_query: Add additional query parameters to the request
|
|
1228
|
+
|
|
1229
|
+
extra_body: Add additional JSON properties to the request
|
|
1230
|
+
|
|
1231
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
1232
|
+
"""
|
|
1233
|
+
return await self._get(
|
|
1234
|
+
"/cdn/statistics/shield_usage/aggregated"
|
|
1235
|
+
if self._client._base_url_overridden
|
|
1236
|
+
else "https://api.gcore.com//cdn/statistics/shield_usage/aggregated",
|
|
1237
|
+
options=make_request_options(
|
|
1238
|
+
extra_headers=extra_headers,
|
|
1239
|
+
extra_query=extra_query,
|
|
1240
|
+
extra_body=extra_body,
|
|
1241
|
+
timeout=timeout,
|
|
1242
|
+
query=await async_maybe_transform(
|
|
1243
|
+
{
|
|
1244
|
+
"from_": from_,
|
|
1245
|
+
"to": to,
|
|
1246
|
+
"flat": flat,
|
|
1247
|
+
"group_by": group_by,
|
|
1248
|
+
"resource": resource,
|
|
1249
|
+
},
|
|
1250
|
+
statistic_get_shield_usage_aggregated_params.StatisticGetShieldUsageAggregatedParams,
|
|
1251
|
+
),
|
|
1252
|
+
),
|
|
1253
|
+
cast_to=ShieldAggregatedStats,
|
|
1254
|
+
)
|
|
1255
|
+
|
|
1256
|
+
async def get_shield_usage_series(
|
|
1257
|
+
self,
|
|
1258
|
+
*,
|
|
1259
|
+
from_: str,
|
|
1260
|
+
to: str,
|
|
1261
|
+
resource: int | Omit = omit,
|
|
1262
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
1263
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
1264
|
+
extra_headers: Headers | None = None,
|
|
1265
|
+
extra_query: Query | None = None,
|
|
1266
|
+
extra_body: Body | None = None,
|
|
1267
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1268
|
+
) -> UsageSeriesStats:
|
|
1269
|
+
"""
|
|
1270
|
+
Get origin shielding usage statistics for up to 365 days starting from today.
|
|
1271
|
+
|
|
1272
|
+
Request URL parameters should be added as a query string after the endpoint.
|
|
1273
|
+
|
|
1274
|
+
Args:
|
|
1275
|
+
from_: Beginning of the requested time period (ISO 8601/RFC 3339 format, UTC.)
|
|
1276
|
+
|
|
1277
|
+
to: End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
|
|
1278
|
+
|
|
1279
|
+
resource: CDN resources IDs by that statistics data is grouped.
|
|
1280
|
+
|
|
1281
|
+
To request multiple values, use:
|
|
1282
|
+
|
|
1283
|
+
- &resource=1&resource=2
|
|
1284
|
+
|
|
1285
|
+
extra_headers: Send extra headers
|
|
1286
|
+
|
|
1287
|
+
extra_query: Add additional query parameters to the request
|
|
1288
|
+
|
|
1289
|
+
extra_body: Add additional JSON properties to the request
|
|
1290
|
+
|
|
1291
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
1292
|
+
"""
|
|
1293
|
+
return await self._get(
|
|
1294
|
+
"/cdn/statistics/shield_usage/series"
|
|
1295
|
+
if self._client._base_url_overridden
|
|
1296
|
+
else "https://api.gcore.com//cdn/statistics/shield_usage/series",
|
|
1297
|
+
options=make_request_options(
|
|
1298
|
+
extra_headers=extra_headers,
|
|
1299
|
+
extra_query=extra_query,
|
|
1300
|
+
extra_body=extra_body,
|
|
1301
|
+
timeout=timeout,
|
|
1302
|
+
query=await async_maybe_transform(
|
|
1303
|
+
{
|
|
1304
|
+
"from_": from_,
|
|
1305
|
+
"to": to,
|
|
1306
|
+
"resource": resource,
|
|
1307
|
+
},
|
|
1308
|
+
statistic_get_shield_usage_series_params.StatisticGetShieldUsageSeriesParams,
|
|
1309
|
+
),
|
|
1310
|
+
),
|
|
1311
|
+
cast_to=UsageSeriesStats,
|
|
1312
|
+
)
|
|
1313
|
+
|
|
1314
|
+
|
|
1315
|
+
class StatisticsResourceWithRawResponse:
|
|
1316
|
+
def __init__(self, statistics: StatisticsResource) -> None:
|
|
1317
|
+
self._statistics = statistics
|
|
1318
|
+
|
|
1319
|
+
self.get_logs_usage_aggregated = to_raw_response_wrapper(
|
|
1320
|
+
statistics.get_logs_usage_aggregated,
|
|
1321
|
+
)
|
|
1322
|
+
self.get_logs_usage_series = to_raw_response_wrapper(
|
|
1323
|
+
statistics.get_logs_usage_series,
|
|
1324
|
+
)
|
|
1325
|
+
self.get_resource_usage_aggregated = to_raw_response_wrapper(
|
|
1326
|
+
statistics.get_resource_usage_aggregated,
|
|
1327
|
+
)
|
|
1328
|
+
self.get_resource_usage_series = to_raw_response_wrapper(
|
|
1329
|
+
statistics.get_resource_usage_series,
|
|
1330
|
+
)
|
|
1331
|
+
self.get_shield_usage_aggregated = to_raw_response_wrapper(
|
|
1332
|
+
statistics.get_shield_usage_aggregated,
|
|
1333
|
+
)
|
|
1334
|
+
self.get_shield_usage_series = to_raw_response_wrapper(
|
|
1335
|
+
statistics.get_shield_usage_series,
|
|
1336
|
+
)
|
|
1337
|
+
|
|
1338
|
+
|
|
1339
|
+
class AsyncStatisticsResourceWithRawResponse:
|
|
1340
|
+
def __init__(self, statistics: AsyncStatisticsResource) -> None:
|
|
1341
|
+
self._statistics = statistics
|
|
1342
|
+
|
|
1343
|
+
self.get_logs_usage_aggregated = async_to_raw_response_wrapper(
|
|
1344
|
+
statistics.get_logs_usage_aggregated,
|
|
1345
|
+
)
|
|
1346
|
+
self.get_logs_usage_series = async_to_raw_response_wrapper(
|
|
1347
|
+
statistics.get_logs_usage_series,
|
|
1348
|
+
)
|
|
1349
|
+
self.get_resource_usage_aggregated = async_to_raw_response_wrapper(
|
|
1350
|
+
statistics.get_resource_usage_aggregated,
|
|
1351
|
+
)
|
|
1352
|
+
self.get_resource_usage_series = async_to_raw_response_wrapper(
|
|
1353
|
+
statistics.get_resource_usage_series,
|
|
1354
|
+
)
|
|
1355
|
+
self.get_shield_usage_aggregated = async_to_raw_response_wrapper(
|
|
1356
|
+
statistics.get_shield_usage_aggregated,
|
|
1357
|
+
)
|
|
1358
|
+
self.get_shield_usage_series = async_to_raw_response_wrapper(
|
|
1359
|
+
statistics.get_shield_usage_series,
|
|
1360
|
+
)
|
|
1361
|
+
|
|
1362
|
+
|
|
1363
|
+
class StatisticsResourceWithStreamingResponse:
|
|
1364
|
+
def __init__(self, statistics: StatisticsResource) -> None:
|
|
1365
|
+
self._statistics = statistics
|
|
1366
|
+
|
|
1367
|
+
self.get_logs_usage_aggregated = to_streamed_response_wrapper(
|
|
1368
|
+
statistics.get_logs_usage_aggregated,
|
|
1369
|
+
)
|
|
1370
|
+
self.get_logs_usage_series = to_streamed_response_wrapper(
|
|
1371
|
+
statistics.get_logs_usage_series,
|
|
1372
|
+
)
|
|
1373
|
+
self.get_resource_usage_aggregated = to_streamed_response_wrapper(
|
|
1374
|
+
statistics.get_resource_usage_aggregated,
|
|
1375
|
+
)
|
|
1376
|
+
self.get_resource_usage_series = to_streamed_response_wrapper(
|
|
1377
|
+
statistics.get_resource_usage_series,
|
|
1378
|
+
)
|
|
1379
|
+
self.get_shield_usage_aggregated = to_streamed_response_wrapper(
|
|
1380
|
+
statistics.get_shield_usage_aggregated,
|
|
1381
|
+
)
|
|
1382
|
+
self.get_shield_usage_series = to_streamed_response_wrapper(
|
|
1383
|
+
statistics.get_shield_usage_series,
|
|
1384
|
+
)
|
|
1385
|
+
|
|
1386
|
+
|
|
1387
|
+
class AsyncStatisticsResourceWithStreamingResponse:
|
|
1388
|
+
def __init__(self, statistics: AsyncStatisticsResource) -> None:
|
|
1389
|
+
self._statistics = statistics
|
|
1390
|
+
|
|
1391
|
+
self.get_logs_usage_aggregated = async_to_streamed_response_wrapper(
|
|
1392
|
+
statistics.get_logs_usage_aggregated,
|
|
1393
|
+
)
|
|
1394
|
+
self.get_logs_usage_series = async_to_streamed_response_wrapper(
|
|
1395
|
+
statistics.get_logs_usage_series,
|
|
1396
|
+
)
|
|
1397
|
+
self.get_resource_usage_aggregated = async_to_streamed_response_wrapper(
|
|
1398
|
+
statistics.get_resource_usage_aggregated,
|
|
1399
|
+
)
|
|
1400
|
+
self.get_resource_usage_series = async_to_streamed_response_wrapper(
|
|
1401
|
+
statistics.get_resource_usage_series,
|
|
1402
|
+
)
|
|
1403
|
+
self.get_shield_usage_aggregated = async_to_streamed_response_wrapper(
|
|
1404
|
+
statistics.get_shield_usage_aggregated,
|
|
1405
|
+
)
|
|
1406
|
+
self.get_shield_usage_series = async_to_streamed_response_wrapper(
|
|
1407
|
+
statistics.get_shield_usage_series,
|
|
1408
|
+
)
|