generate_param_descriptions

command
v1.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Command generate_param_descriptions fetches OpenAPI parameter descriptions for every service/version present in the SDK metadata inventory, and writes asset/paramdescriptions/params.json. build_asset.sh then runs go-bindata into package paramdescriptions (asset/paramdescriptions/bindata.go) — separate from asset/asset.go (metadata + explorer only).

Inventory resolution (same idea as generate_explorer_descriptions):

  1. --metadata-dir (default: <repo>/volcengine-sdk-metadata/metadata)
  2. fallback: parse paths in asset/asset.go

Data source (public Explorer APIs, no DB):

  • GET /api/common/explorer/services → canonical ServiceCode casing
  • GET /api/common/explorer/apis → action list per service/version
  • GET /api/common/explorer/api-swagger → param descriptions per action

ServiceCode casing: metadata inventory dirs are lowercased, but api-swagger is case-sensitive (cdn≠CDN, acep≠ACEP, advdefence≠AdvDefence). Requests use the canonical code from /services; params.json keys stay inventory lower for CLI join.

Rate limiting: serial requests with --delay (default 150ms). Retries on 429/5xx.

Usage:

go run ./scripts/generate_param_descriptions
go run ./scripts/generate_param_descriptions --service ecs --version 2020-04-01
go run ./scripts/generate_param_descriptions --delay 200ms --lang zh
go run ./scripts/generate_param_descriptions --strict
go run ./scripts/generate_param_descriptions --prune-missing
go generate ./asset/paramdescriptions   # after writing params.json

Write policy: merge successful fetches into any existing --out file so partial runs (--service / --max-actions / skipped HTTP errors) do not wipe unscanned actions. Use --prune-missing to drop previous service/version keys absent from inventory; --strict refuses to write when any fetch was skipped.

Full asset rebuild (metadata + explorer + params + bindata):

bash build_asset.sh <metadata-git-url> [branch]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL