리소스 생성 명령
리소스 생성 명령 (kongctl api post)
이 문서는 kongctl CLI의 api post 명령으로 Konnect API에 POST 요청을 보내 리소스를 생성하는 방법을 설명해요. 명령 기본 사용법과 함께 base-url, body-file 같은 주요 플래그와 jq 필터, 로그 설정 옵션까지 한눈에 확인할 수 있어요. 요청 본문을 파일이나 표준 입력으로 넘기는 방법도 소개하고 있으니 처음 이 명령을 접할 때 참고하기 좋아요
출처: 문서
본문
명령어 사용법
Usage:
kongctl api post <endpoint> [field=value ...] [flags]
Flags:
--base-url string Base URL for Konnect API requests.
- Config path: [ konnect.base-url ]
- Default : [ https://us.api.konghq.com ]
-f, --body-file string Read request body from file ('-' to read from standard input)
--color-theme string Configures the CLI UI/theme (prompt, tables, TUI elements).
- Config path: [ color-theme ]
- Examples : [ auto, 3024_day, 3024_night, aardvark_blue, abernathy ]
- Reference : [ https://github.com/lrstanley/bubbletint/blob/master/DEFAULT_TINTS.md ] (default "auto")
--config-file string Path to the configuration file to load.
- Environment variable: KONGCTL_CONFIG_FILE (overridden by this flag)
- Default: [ $XDG_CONFIG_HOME/kongctl/config.yaml ]
-h, --help help for post
--include-response-headers Include response headers in error output
--jq string Filter JSON responses using jq expressions (powered by gojq for full jq compatibility)
--jq-color string Controls colorized output for jq filter results.
- Config path: [ jq.color.enabled ]
- Allowed : [ auto|always|never ] (default "auto")
--jq-color-theme string Select the color theme used for jq filter results.
- Config path: [ jq.color.theme ]
- Examples : [ friendly, github-dark, dracula ]
- Reference : [ https://xyproto.github.io/splash/docs/ ] (default "friendly")
-r, --jq-raw-output Output string jq results without JSON quotes (like jq -r).
- Config path: [ jq.raw-output ]
--log-file string Write execution logs to the specified file instead of STDERR.
- Config path: [ log-file ]
--log-level string Configures the logging level. Execution logs are written to STDERR.
- Config path: [ log-level ]
- Allowed : [ trace|debug|info|warn|error ] (default "error")
--no-telemetry Disable telemetry for this command invocation. Overrides config and env.
- Config path: [ telemetry.enabled ]
- Env var : [ KONGCTL_NO_TELEMETRY ]
- Default : [ false ]
--no-trunc Preserve full cell widths in static text tables beyond terminal width.
Does not change column selection, UUID formatting, or explicit string slices.
- Config path: [ text.no-trunc ]
- Default : [ false ]
-o, --output string Configures the format of data written to STDOUT.
- Config path: [ output ]
- Allowed : [ json|yaml|text ] (default "text")
--pat string Konnect Personal Access Token (PAT) used to authenticate the CLI.
Setting this value overrides tokens obtained from the login command.
- Config path: [ konnect.pat ]
-p, --profile string Specify the profile to use for this command. (default "default")
--region string Konnect region identifier (for example "eu"). Used to construct the base URL when --base-url is not provided.
- Config path: [ konnect.region ]
--text-id-format string Configure UUID rendering in static text-table ID columns.
- Config path: [ text.id-format ]
- Allowed : [ compact|full ]
- Default : [ compact ]
--text-layout string Configure static text-table column selection.
- Config path: [ text.layout ]
- Allowed : [ compact|auto|wide ]
- Default : [ compact ]
관련 리소스
더 알아보기 (Learn more)
- POST 요청에 사용할 Konnect API의 전체 레퍼런스를 확인할 수 있어요 — Konnect APIs
- 조회, 수정 등 kongctl의 다른 api 하위 명령들도 함께 살펴봐요 — kongctl api commands