Skip to content

Latest commit

 

History

History
55 lines (39 loc) · 2.66 KB

stackit_curl.md

File metadata and controls

55 lines (39 loc) · 2.66 KB

stackit curl

Executes an authenticated HTTP request to an endpoint

Synopsis

Executes an HTTP request to an endpoint, using the authentication provided by the CLI.

stackit curl URL [flags]

Examples

  Get all the DNS zones for project with ID xxx via GET request to https://dns.api.stackit.cloud/v1/projects/xxx/zones
  $ stackit curl https://dns.api.stackit.cloud/v1/projects/xxx/zones

  Get all the DNS zones for project with ID xxx via GET request to https://dns.api.stackit.cloud/v1/projects/xxx/zones, write complete response (headers and body) to file "./output.txt"
  $ stackit curl https://dns.api.stackit.cloud/v1/projects/xxx/zones --include --output ./output.txt

  Create a new DNS zone for project with ID xxx via POST request to https://dns.api.stackit.cloud/v1/projects/xxx/zones with payload from file "./payload.json"
  $ stackit curl https://dns.api.stackit.cloud/v1/projects/xxx/zones -X POST --data @./payload.json

  Get all the DNS zones for project with ID xxx via GET request to https://dns.api.stackit.cloud/v1/projects/xxx/zones, with header "Authorization: Bearer yyy", fail if server returns error (such as 403 Forbidden)
  $ stackit curl https://dns.api.stackit.cloud/v1/projects/xxx/zones -X POST -H "Authorization: Bearer yyy" --fail

Options

      --data string            Content to include in the request body. Can be a string or a file path prefixed with "@"
      --fail[=true|false]      If set, exits with error 22 if response code is 4XX or 5XX
  -H, --header strings         Custom headers to include in the request, can be specified multiple times. If the "Authorization" header is set, it will override the authentication provided by the CLI
  -h, --help[=true|false]      Help for "stackit curl"
      --include[=true|false]   If set, response headers are added to the output
      --output string          Writes output to provided file instead of printing to console
  -X, --request string         HTTP method, defaults to GET (one of: [GET, HEAD, POST, PUT, PATCH, DELETE, CONNECT, OPTIONS, TRACE]) (default "GET")

Options inherited from parent commands

  -y, --assume-yes[=true|false]   If set, skips all confirmation prompts
      --async[=true|false]        If set, runs the command asynchronously
  -o, --output-format string      Output format, (one of: [json, pretty, none, yaml])
  -p, --project-id string         Project ID
      --region string             Target region for region-specific requests
      --verbosity string          Verbosity of the CLI, (one of: [debug, info, warning, error]) (default "info")

SEE ALSO

  • stackit - Manage STACKIT resources using the command line