CDN Abnormal Status Code Analysis
Overview
This skill diagnoses abnormal HTTP status codes (4xx / 5xx) on a Huawei Cloud CDN accelerated domain.
It is read-only end to end: every action is a query (GET statistics / GET config / GET log-download-link / read-only log fetch).
It answers four questions for any 4xx/5xx anomaly:
- Is there an anomaly, and how big? — quantify 4xx/5xx volume and ratio over a window.
- Which exact code, when, edge or origin? — drill to the specific code + time bucket, and fork edge-generated vs origin-generated via the back-to-source (
bs_*) status statistics.
- Who / where / what path? — top IPs/paths/UA/referer, client IP count (刷量 vs real users).
- Root cause + forensics? — narrow to edge-config rules or origin-side issues, then pin the exact requests via access logs.
Key Features:
- Edge-vs-origin fork driven by one command (
bs_status_code_*): result={} ⇒ edge-generated; non-empty ⇒ origin-generated.
- Covers the full 4xx/5xx set: 400/401/403/404/405/406/408/410/412/416/429/499/495/496/500/501/502/503/504/505/530….
- Read-only log helper
scripts/fetch_cdn_log.py downloads + decompresses a CDN log and extracts the abnormal-status rows as JSON.
- Structured diagnosis report with a status-code → root-cause decision tree and console/工单 remediation boundary (no CLI write ops).
Tools: hcloud CLI (KooCLI) + Python log helper (scripts/fetch_cdn_log.py).
Core Principle: Read-only diagnosis; no configuration changes.
⛔ Prohibited Operations (Security Constraints)
This skill strictly prohibits all non-GET (write/modify/delete) CDN operations, even if requested by the user.
Total: 55 prohibited operations (24 POST + 25 PUT + 6 DELETE).
For the complete list of all 55 prohibited non-GET operations with risk descriptions, see references/prohibited-operations.md.
Representative prohibited operations (full list in the reference doc):
| Prohibited Operation |
Example CLI |
Reason |
| ❌ Create domain |
CreateDomain (v1/v2), CreateDomainByDuplicate |
Write op, creates production resource |
| ❌ Delete domain |
DeleteDomain (v1/v2) |
Irreversible |
| ❌ Modify domain config |
hcloud CDN UpdateDomainFullConfig / UpdateBlackWhiteList / UpdateRefer / UpdateResponseHeader / UpdateOriginHost / UpdateCacheRules / UpdateHttpsInfo |
Write op, affects production traffic |
| ❌ Enable / disable domain |
EnableDomain (v1/v2), DisableDomain (v1/v2) |
Write op, affects production traffic |
| ❌ Refresh / preheat |
hcloud CDN CreateRefreshTasks / CreatePreheatingTasks |
Write op, changes cache |
| ❌ Modify billing mode |
SetChargeModes |
Financial impact |
| ❌ Verify domain owner |
hcloud CDN VerifyDomainOwner |
Write op |
| ❌ Set stats config / export open |
SetStatsConfig / ExportStatsOpen |
Write op |
If the user requests a prohibited operation, refuse and inform:
"Per security constraints, this skill performs read-only diagnosis only and does not run any write/delete operations.
To change CDN configuration, use the Huawei Cloud CDN console or run the relevant hcloud command manually — this skill will not execute it.
The complete list of 55 prohibited operations is documented in references/prohibited-operations.md."
Architecture
CDN Abnormal Status Code Analysis (read-only)
├── ListDomains/v2 (target domain → domain_id)
├── ShowDomainStats/v2
│ ├── summary http_code_2xx..5xx + req_num → quantify 4xx/5xx volume + ratio
│ └── detail status_code_4xx/5xx → exact code + time array
├── ShowDomainStats/v2 bs_status_code_4xx/5xx → ★ edge vs origin fork ★
├── ShowBandwidthCalc / ListDomainClientStats → traffic-spike / 刷量 correlation
├── Top-N family → who / where / what path
├── Root cause fork
│ ├── origin side: ShowOriginHost / ShowDomainDetail / ShowHistoryTasks / TopOriginUrl
│ └── edge side: ShowDomainFullConfig / ShowRefer / ShowBlackWhiteList /
│ ListRuleDetails / ListBanUrl / ListAccessControlTask /
│ ShowResponseHeader / ShowCertificatesHttpsInfo
├── ShowLogs/v2 + python scripts/fetch_cdn_log.py → per-request forensics (JSON)
├── ShowIpInfo/v2 → client/edge IP attribution
└── generate diagnosis report
API Call Budget
| Step |
API / Script |
Rate Limit |
Est. Time |
| 1 |
hcloud CDN ListDomains/v2 --cli-region={region} |
— |
<2s |
| 2 |
hcloud CDN ShowDomainStats/v2 --cli-region={region} (summary + detail + bs) |
5/s |
<3s |
| 3 |
Top-N family + ListDomainClientStats |
2-5/s |
<5s |
| 4 |
hcloud CDN ShowDomainFullConfig/v2 --cli-region={region} + Show* config |
— |
<5s |
| 5 |
hcloud CDN ShowLogs/v2 --cli-region={region} + python scripts/fetch_cdn_log.py |
— |
≤ 30s |
Total estimated time: < 45 seconds (log-heavy window may be longer).
KooCLI Command Format Standard
hcloud CDN <Operation> --cli-region=<region> [--key=value ...]
- Service name:
CDN (uppercase). Operation name: PascalCase (e.g., ShowDomainStats/v2).
- Region parameter:
--cli-region=<region>. CDN supports cn-north-1 (Beijing) and ap-southeast-1 (Singapore); results are region-independent.
Recommended: cn-north-1 uniformly. (cn-north-4 is NOT supported by CDN.)
- Parameter format:
--key=value (equals sign, no spaces). Space-separated form is unsupported.
- Output: append
--cli-output=json for machine parsing.
Prerequisites
Pre-check: hcloud (KooCLI) >= 3.2.0 — hcloud version. If missing, see references/cli-installation-guide.md.
Pre-check: Python >= 3.8 — python --version. Required by scripts/fetch_cdn_log.py.
Pre-check: Python requests >= 2.25 — python -c "import requests; print('ok')". The log helper downloads via requests.
Install if missing: pip install requests>=2.25
Pre-check: hcloud credentials — hcloud configure list. If invalid, stop and guide secure configuration. Never read/echo/print AK/SK; never ask the user to paste AK/SK in chat.
⚠️ hcloud parameter format: all params must use --key=value.
⚠️ CDN region: use cn-north-1 uniformly (CDN does not support cn-north-4).
⚠️ Time / interval rules: time = ms timestamp, [start,end) left-closed right-open;
interval=300 (≤2d, 5-min points) / 3600 (≤7d, hour points) / 86400 (≤31d, CST 0:00 points).
status_code_* (edge) and bs_status_code_* (origin) cannot be mixed in one query.
Authentication
- Prohibited: reading/echoing/printing AK/SK; asking users to input AK/SK in chat;
hcloud configure set with plaintext; accepting AK/SK pasted by the user.
- Allowed: read credentials from environment variables or the active CLI profile only.
- If the user pastes AK/SK, stop, refuse, and emit the secure setup template (
export HUAWEICLOUD_SDK_AK=... / HUAWEICLOUD_SDK_SK=...), then wait.
- Verify:
hcloud configure list — confirm a valid profile exists; if not, stop.
IAM Permission Policies
See references/iam-policies.md. Minimum: read-only CDN query scope (cdn:domain:get + statistics/log query).
The simplest grant is the system read-only policy CDN Domain Viewer ("Allow Query Domains"). No write permissions are required or included.
Core Commands
| Command |
Purpose |
Key Parameters |
hcloud configure list |
Check credentials |
none |
hcloud CDN ListDomains/v2 --cli-region=<region> |
List domains → domain_id |
— |
hcloud CDN ShowDomainStats/v2 --cli-region=<region> --action=summary|detail --domain_name=<d> --stat_type=<t> --start_time=<ms> --end_time=<ms> --interval=<s> |
Quantify / localize status codes |
--action, --stat_type, --interval |
hcloud CDN ShowBandwidthCalc --cli-region=<region> --domain_name=<d> --calc_type=bw_peak --start_time=<ms> --end_time=<ms> |
Bandwidth peak (traffic-spike correlation) |
--calc_type |
hcloud CDN ListDomainClientStats --cli-region=<region> --domain_name=<d> --stat_type=ip_num --start_time=<ms> --end_time=<ms> |
Client IP count (刷量 vs real users) |
--stat_type=ip_num |
hcloud CDN ListCdnDomainTopIps --cli-region=<region> --domain_name=<d> --stat_type=req_num --start_time=<ms> --end_time=<ms> |
Top-N drill (TopIps; same form for Path/OriginUrl/Refers/Uas; req_num only, no status) |
--stat_type=req_num |
hcloud CDN ShowDomainFullConfig/v2 --cli-region=<region> --domain_name=<d> |
Full edge config (auth/refer/ip_filter/ua/…) |
— |
hcloud CDN ShowRefer --cli-region=<region> --domain_id=<id> |
Referer防盗链 config |
--domain_id |
hcloud CDN ShowBlackWhiteList --cli-region=<region> --domain_id=<id> |
IP blacklist/whitelist |
--domain_id |
hcloud CDN ListRuleDetails --cli-region=<region> --domain_name=<d> |
Rule engine block rules |
— |
hcloud CDN ListBanUrl --cli-region=<region> --start_time=<ms> --end_time=<ms> --page_number=1 --page_size=50 |
Banned URLs (may need工单 whitelist) |
time range |
hcloud CDN ListAccessControlTask --cli-region=<region> --start_time=<ms> --end_time=<ms> --limit=100 |
Ban/unban tasks (may need工单 whitelist) |
time range |
hcloud CDN ShowOriginHost --cli-region=<region> --domain_id=<id> |
回源HOST |
--domain_id |
hcloud CDN ShowResponseHeader --cli-region=<region> --domain_id=<id> |
Response header / error-page config |
--domain_id |
hcloud CDN ShowDomainDetail --cli-region=<region> --domain_id=<id> |
Domain detail (origin/status/CNAME) |
--domain_id |
hcloud CDN ShowHistoryTasks/v2 --cli-region=<region> --file_type=file --page_number=1 --page_size=50 |
Refresh/preheat history |
— |
hcloud CDN ShowCertificatesHttpsInfo/v2 --cli-region=<region> --domain_name=<d> |
HTTPS cert (49x/TLS) |
--domain_name |
hcloud CDN ShowLogs/v2 --cli-region=<region> --domain_name=<d> --start_time=<ms> --end_time=<ms> --page_size=100 |
Log download links (single domain, ≤30 days) |
--domain_name |
python scripts/fetch_cdn_log.py --url <link> [--status 403,502,503,504] [--timeout 30] [--max-lines 200] |
Fetch+decompress log, extract abnormal rows (emits JSON) |
--url, --status |
hcloud CDN ShowIpInfo/v2 --cli-region=<region> --ips=<ip1>,<ip2> |
IP attribution (≤20) |
--ips |
Top-N family stat_type supports only flux/req_num (no status code) — cross-reference with ShowDomainStats/logs.
Parameter Confirmation
| Parameter |
Required |
Description |
Default |
Example |
domain_name |
Yes |
CDN accelerated domain to diagnose |
— |
www.example.com |
domain_id |
Yes (for some Show* by-id ops) |
From ListDomains/v2 |
— |
d3aaa521… |
--cli-region |
Yes |
CDN region |
cn-north-1 |
cn-north-1 |
| time window |
Yes |
[start,end) ms timestamps, aligned to interval points |
— |
last 7 days |
--status (log helper) |
No |
Status codes to extract |
403,404,499,500,502,503,504,530 |
403,502 |
User confirmation checklist:
Core Workflows
Step 1: Discovery & Quantification — find 4xx/5xx, size, traffic correlation
📄 Detailed steps → references/task-discovery.md
Step 2: Localize & Fork — exact code + time + edge/origin
📄 Detailed steps → references/task-localize.md
Step 3: Distribution — top-N + client-IP count
📄 Detailed steps → references/task-distribution.md
Step 4: Root Cause — origin side (4A) / edge side (4B) per Step 2 fork
📄 Detailed steps → references/task-rootcause.md
Step 5: Per-request Forensics — log fetch + IP attribution
📄 Detailed steps → references/task-forensics.md
Step 6: Report — decision tree + remediation boundary
📄 Detailed steps → references/task-report.md
References
| Document |
Description |
| task-discovery.md |
Step 1: discovery & quantification |
| task-localize.md |
Step 2: localize exact code + edge/origin fork |
| task-distribution.md |
Step 3: top-N/client distribution |
| task-rootcause.md |
Step 4: origin-side (4A) / edge-side (4B) root cause |
| task-forensics.md |
Step 5: per-request log forensics |
| task-report.md |
Step 6: diagnosis report + decision tree |
| prohibited-operations.md |
All 55 prohibited non-GET operations (POST/PUT/DELETE) |
| dataflow-diagram.md |
Mermaid data flow diagram |
| related-apis.md |
API/CLI reference + stat_type + status-code map |
| iam-policies.md |
IAM least-privilege policies |
| verification-method.md |
Verification method |
| acceptance-criteria.md |
Acceptance criteria checklist |
| troubleshooting.md |
Troubleshooting |
| cli-installation-guide.md |
CLI installation guide |
1---
2name: huawei-cloud-cdn-abnormal-status-code-analysis
3description: |
4 Diagnose CDN business abnormal HTTP status codes (4xx/5xx) using hcloud CLI. Discover and quantify 4xx/5xx volume, localize the exact status code and time window, fork edge-generated vs origin-generated via back-to-source status statistics, correlate top-N distribution, narrow root cause on CDN edge config or origin side, and取证 per-request access logs.
5 Use this skill when the user wants to: (1) diagnose CDN abnormal 4xx/5xx status codes, (2) root-cause a 403/404/5xx spike on a CDN domain, (3) tell whether abnormal codes are generated by the CDN edge or returned by the origin, (4) troubleshoot CDN business exception status codes during daily inspection or incidents.
6 Triggers include: 状态码异常, 业务异常码, 4xx, 5xx, 403, 404, 502, 503, 504, status code, abnormal status, CDN异常, 边缘/回源, 限流, status code analysis, edge vs origin
7tags:
8 - cdn
9 - status-code
10 - diagnosis
11 - hcloud
12 - troubleshooting
13---
14
15# CDN Abnormal Status Code Analysis
16
17## Overview
18
19This skill diagnoses **abnormal HTTP status codes (4xx / 5xx)** on a Huawei Cloud CDN accelerated domain.
20It is **read-only** end to end: every action is a query (GET statistics / GET config / GET log-download-link / read-only log fetch).
21It answers four questions for any 4xx/5xx anomaly:
22
231. **Is there an anomaly, and how big?** — quantify 4xx/5xx volume and ratio over a window.
242. **Which exact code, when, edge or origin?** — drill to the specific code + time bucket, and fork **edge-generated vs origin-generated** via the back-to-source (`bs_*`) status statistics.
253. **Who / where / what path?** — top IPs/paths/UA/referer, client IP count (刷量 vs real users).
264. **Root cause + forensics?** — narrow to edge-config rules or origin-side issues, then pin the exact requests via access logs.
27
28**Key Features:**
29
30- Edge-vs-origin fork driven by one command (`bs_status_code_*`): `result={}` ⇒ edge-generated; non-empty ⇒ origin-generated.
31- Covers the full 4xx/5xx set: 400/401/403/404/405/406/408/410/412/416/429/499/495/496/500/501/502/503/504/505/530….
32- Read-only log helper `scripts/fetch_cdn_log.py` downloads + decompresses a CDN log and extracts the abnormal-status rows as JSON.
33- Structured diagnosis report with a status-code → root-cause decision tree and console/工单 remediation boundary (no CLI write ops).
34
35**Tools**: hcloud CLI (KooCLI) + Python log helper (`scripts/fetch_cdn_log.py`).
36**Core Principle**: Read-only diagnosis; **no configuration changes**.
37
38## ⛔ Prohibited Operations (Security Constraints)
39
40> This skill strictly prohibits **all non-GET (write/modify/delete) CDN operations**, even if requested by the user.
41
42**Total: 55 prohibited operations** (24 POST + 25 PUT + 6 DELETE).
43
44For the complete list of all 55 prohibited non-GET operations with risk descriptions, see [references/prohibited-operations.md](references/prohibited-operations.md).
45
46**Representative prohibited operations (full list in the reference doc):**
47
48| Prohibited Operation | Example CLI | Reason |
49|----------------------|-------------|--------|
50| ❌ Create domain | `CreateDomain` (v1/v2), `CreateDomainByDuplicate` | Write op, creates production resource |
51| ❌ Delete domain | `DeleteDomain` (v1/v2) | Irreversible |
52| ❌ Modify domain config | `hcloud CDN UpdateDomainFullConfig` / `UpdateBlackWhiteList` / `UpdateRefer` / `UpdateResponseHeader` / `UpdateOriginHost` / `UpdateCacheRules` / `UpdateHttpsInfo` | Write op, affects production traffic |
53| ❌ Enable / disable domain | `EnableDomain` (v1/v2), `DisableDomain` (v1/v2) | Write op, affects production traffic |
54| ❌ Refresh / preheat | `hcloud CDN CreateRefreshTasks` / `CreatePreheatingTasks` | Write op, changes cache |
55| ❌ Modify billing mode | `SetChargeModes` | Financial impact |
56| ❌ Verify domain owner | `hcloud CDN VerifyDomainOwner` | Write op |
57| ❌ Set stats config / export open | `SetStatsConfig` / `ExportStatsOpen` | Write op |
58
59> If the user requests a prohibited operation, refuse and inform:
60> "Per security constraints, this skill performs read-only diagnosis only and does not run any write/delete operations.
61> To change CDN configuration, use the Huawei Cloud CDN console or run the relevant hcloud command manually — this skill will not execute it.
62> The complete list of 55 prohibited operations is documented in references/prohibited-operations.md."
63
64## Architecture
65
66```
67CDN Abnormal Status Code Analysis (read-only)
68├── ListDomains/v2 (target domain → domain_id)
69├── ShowDomainStats/v2
70│ ├── summary http_code_2xx..5xx + req_num → quantify 4xx/5xx volume + ratio
71│ └── detail status_code_4xx/5xx → exact code + time array
72├── ShowDomainStats/v2 bs_status_code_4xx/5xx → ★ edge vs origin fork ★
73├── ShowBandwidthCalc / ListDomainClientStats → traffic-spike / 刷量 correlation
74├── Top-N family → who / where / what path
75├── Root cause fork
76│ ├── origin side: ShowOriginHost / ShowDomainDetail / ShowHistoryTasks / TopOriginUrl
77│ └── edge side: ShowDomainFullConfig / ShowRefer / ShowBlackWhiteList /
78│ ListRuleDetails / ListBanUrl / ListAccessControlTask /
79│ ShowResponseHeader / ShowCertificatesHttpsInfo
80├── ShowLogs/v2 + python scripts/fetch_cdn_log.py → per-request forensics (JSON)
81├── ShowIpInfo/v2 → client/edge IP attribution
82└── generate diagnosis report
83```
84
85### API Call Budget
86
87| Step | API / Script | Rate Limit | Est. Time |
88|------|--------------|-----------|-----------|
89| 1 | `hcloud CDN ListDomains/v2 --cli-region={region}` | — | <2s |
90| 2 | `hcloud CDN ShowDomainStats/v2 --cli-region={region}` (summary + detail + bs) | 5/s | <3s |
91| 3 | Top-N family + `ListDomainClientStats` | 2-5/s | <5s |
92| 4 | `hcloud CDN ShowDomainFullConfig/v2 --cli-region={region}` + Show* config | — | <5s |
93| 5 | `hcloud CDN ShowLogs/v2 --cli-region={region}` + `python scripts/fetch_cdn_log.py` | — | ≤ 30s |
94
95**Total estimated time**: < 45 seconds (log-heavy window may be longer).
96
97## KooCLI Command Format Standard
98
99```bash
100hcloud CDN <Operation> --cli-region=<region> [--key=value ...]
101```
102
103- **Service name**: `CDN` (uppercase). Operation name: PascalCase (e.g., `ShowDomainStats/v2`).
104- **Region parameter**: `--cli-region=<region>`. CDN supports `cn-north-1` (Beijing) and `ap-southeast-1` (Singapore); results are region-independent.
105 **Recommended: `cn-north-1` uniformly.** (`cn-north-4` is NOT supported by CDN.)
106- **Parameter format**: `--key=value` (equals sign, no spaces). Space-separated form is unsupported.
107- **Output**: append `--cli-output=json` for machine parsing.
108
109## Prerequisites
110
111> **Pre-check: hcloud (KooCLI) >= 3.2.0** — `hcloud version`. If missing, see [references/cli-installation-guide.md](references/cli-installation-guide.md).
112
113> **Pre-check: Python >= 3.8** — `python --version`. Required by `scripts/fetch_cdn_log.py`.
114
115> **Pre-check: Python `requests >= 2.25`** — `python -c "import requests; print('ok')"`. The log helper downloads via `requests`.
116> Install if missing: `pip install requests>=2.25`
117
118> **Pre-check: hcloud credentials** — `hcloud configure list`. If invalid, stop and guide secure configuration. Never read/echo/print AK/SK; never ask the user to paste AK/SK in chat.
119
120> **⚠️ hcloud parameter format**: all params must use `--key=value`.
121
122> **⚠️ CDN region**: use `cn-north-1` uniformly (CDN does not support `cn-north-4`).
123
124> **⚠️ Time / interval rules**: time = ms timestamp, `[start,end)` left-closed right-open;
125> `interval=300` (≤2d, 5-min points) / `3600` (≤7d, hour points) / `86400` (≤31d, **CST 0:00 points**).
126> `status_code_*` (edge) and `bs_status_code_*` (origin) **cannot be mixed in one query**.
127
128## Authentication
129
130- **Prohibited**: reading/echoing/printing AK/SK; asking users to input AK/SK in chat; `hcloud configure set` with plaintext; accepting AK/SK pasted by the user.
131- **Allowed**: read credentials from environment variables or the active CLI profile only.
132- If the user pastes AK/SK, stop, refuse, and emit the secure setup template (`export HUAWEICLOUD_SDK_AK=...` / `HUAWEICLOUD_SDK_SK=...`), then wait.
133- Verify: `hcloud configure list` — confirm a valid profile exists; if not, stop.
134
135## IAM Permission Policies
136
137See [references/iam-policies.md](references/iam-policies.md). Minimum: read-only CDN query scope (`cdn:domain:get` + statistics/log query).
138The simplest grant is the system read-only policy **CDN Domain Viewer** ("Allow Query Domains"). No write permissions are required or included.
139
140## Core Commands
141
142| Command | Purpose | Key Parameters |
143|---------|---------|----------------|
144| `hcloud configure list` | Check credentials | none |
145| `hcloud CDN ListDomains/v2 --cli-region=<region>` | List domains → domain_id | — |
146| `hcloud CDN ShowDomainStats/v2 --cli-region=<region> --action=summary\|detail --domain_name=<d> --stat_type=<t> --start_time=<ms> --end_time=<ms> --interval=<s>` | Quantify / localize status codes | `--action`, `--stat_type`, `--interval` |
147| `hcloud CDN ShowBandwidthCalc --cli-region=<region> --domain_name=<d> --calc_type=bw_peak --start_time=<ms> --end_time=<ms>` | Bandwidth peak (traffic-spike correlation) | `--calc_type` |
148| `hcloud CDN ListDomainClientStats --cli-region=<region> --domain_name=<d> --stat_type=ip_num --start_time=<ms> --end_time=<ms>` | Client IP count (刷量 vs real users) | `--stat_type=ip_num` |
149| `hcloud CDN ListCdnDomainTopIps --cli-region=<region> --domain_name=<d> --stat_type=req_num --start_time=<ms> --end_time=<ms>` | Top-N drill (TopIps; same form for Path/OriginUrl/Refers/Uas; req_num only, no status) | `--stat_type=req_num` |
150| `hcloud CDN ShowDomainFullConfig/v2 --cli-region=<region> --domain_name=<d>` | Full edge config (auth/refer/ip_filter/ua/…) | — |
151| `hcloud CDN ShowRefer --cli-region=<region> --domain_id=<id>` | Referer防盗链 config | `--domain_id` |
152| `hcloud CDN ShowBlackWhiteList --cli-region=<region> --domain_id=<id>` | IP blacklist/whitelist | `--domain_id` |
153| `hcloud CDN ListRuleDetails --cli-region=<region> --domain_name=<d>` | Rule engine block rules | — |
154| `hcloud CDN ListBanUrl --cli-region=<region> --start_time=<ms> --end_time=<ms> --page_number=1 --page_size=50` | Banned URLs (may need工单 whitelist) | time range |
155| `hcloud CDN ListAccessControlTask --cli-region=<region> --start_time=<ms> --end_time=<ms> --limit=100` | Ban/unban tasks (may need工单 whitelist) | time range |
156| `hcloud CDN ShowOriginHost --cli-region=<region> --domain_id=<id>` | 回源HOST | `--domain_id` |
157| `hcloud CDN ShowResponseHeader --cli-region=<region> --domain_id=<id>` | Response header / error-page config | `--domain_id` |
158| `hcloud CDN ShowDomainDetail --cli-region=<region> --domain_id=<id>` | Domain detail (origin/status/CNAME) | `--domain_id` |
159| `hcloud CDN ShowHistoryTasks/v2 --cli-region=<region> --file_type=file --page_number=1 --page_size=50` | Refresh/preheat history | — |
160| `hcloud CDN ShowCertificatesHttpsInfo/v2 --cli-region=<region> --domain_name=<d>` | HTTPS cert (49x/TLS) | `--domain_name` |
161| `hcloud CDN ShowLogs/v2 --cli-region=<region> --domain_name=<d> --start_time=<ms> --end_time=<ms> --page_size=100` | Log download links (single domain, ≤30 days) | `--domain_name` |
162| `python scripts/fetch_cdn_log.py --url <link> [--status 403,502,503,504] [--timeout 30] [--max-lines 200]` | Fetch+decompress log, extract abnormal rows (emits JSON) | `--url`, `--status` |
163| `hcloud CDN ShowIpInfo/v2 --cli-region=<region> --ips=<ip1>,<ip2>` | IP attribution (≤20) | `--ips` |
164
165> Top-N family `stat_type` supports only `flux`/`req_num` (no status code) — cross-reference with `ShowDomainStats`/logs.
166
167## Parameter Confirmation
168
169| Parameter | Required | Description | Default | Example |
170|-----------|----------|-------------|---------|---------|
171| `domain_name` | Yes | CDN accelerated domain to diagnose | — | `www.example.com` |
172| `domain_id` | Yes (for some Show* by-id ops) | From `ListDomains/v2` | — | `d3aaa521…` |
173| `--cli-region` | Yes | CDN region | `cn-north-1` | `cn-north-1` |
174| time window | Yes | `[start,end)` ms timestamps, aligned to interval points | — | last 7 days |
175| `--status` (log helper) | No | Status codes to extract | `403,404,499,500,502,503,504,530` | `403,502` |
176
177**User confirmation checklist:**
178
179- [ ] Target domain provided
180- [ ] User understands this is read-only diagnosis
181- [ ] User understands log fetch has a 30s timeout
182
183## Core Workflows
184
185### Step 1: Discovery & Quantification — find 4xx/5xx, size, traffic correlation
186
187📄 Detailed steps → [references/task-discovery.md](references/task-discovery.md)
188
189### Step 2: Localize & Fork — exact code + time + edge/origin
190
191📄 Detailed steps → [references/task-localize.md](references/task-localize.md)
192
193### Step 3: Distribution — top-N + client-IP count
194
195📄 Detailed steps → [references/task-distribution.md](references/task-distribution.md)
196
197### Step 4: Root Cause — origin side (4A) / edge side (4B) per Step 2 fork
198
199📄 Detailed steps → [references/task-rootcause.md](references/task-rootcause.md)
200
201### Step 5: Per-request Forensics — log fetch + IP attribution
202
203📄 Detailed steps → [references/task-forensics.md](references/task-forensics.md)
204
205### Step 6: Report — decision tree + remediation boundary
206
207📄 Detailed steps → [references/task-report.md](references/task-report.md)
208
209## References
210
211| Document | Description |
212|----------|-------------|
213| [task-discovery.md](references/task-discovery.md) | Step 1: discovery & quantification |
214| [task-localize.md](references/task-localize.md) | Step 2: localize exact code + edge/origin fork |
215| [task-distribution.md](references/task-distribution.md) | Step 3: top-N/client distribution |
216| [task-rootcause.md](references/task-rootcause.md) | Step 4: origin-side (4A) / edge-side (4B) root cause |
217| [task-forensics.md](references/task-forensics.md) | Step 5: per-request log forensics |
218| [task-report.md](references/task-report.md) | Step 6: diagnosis report + decision tree |
219| [prohibited-operations.md](references/prohibited-operations.md) | All 55 prohibited non-GET operations (POST/PUT/DELETE) |
220| [dataflow-diagram.md](references/dataflow-diagram.md) | Mermaid data flow diagram |
221| [related-apis.md](references/related-apis.md) | API/CLI reference + stat_type + status-code map |
222| [iam-policies.md](references/iam-policies.md) | IAM least-privilege policies |
223| [verification-method.md](references/verification-method.md) | Verification method |
224| [acceptance-criteria.md](references/acceptance-criteria.md) | Acceptance criteria checklist |
225| [troubleshooting.md](references/troubleshooting.md) | Troubleshooting |
226| [cli-installation-guide.md](references/cli-installation-guide.md) | CLI installation guide |