CLI reference

norcube api

Make an authenticated request to a Norcube API

Not verified yet

Sends one request to a Norcube service with the profile's credentials, organization, timeouts and retries, and prints the JSON response. Use it for endpoints the CLI has no command for yet.

Services: backup, billing, domainradar, langsync, prompthub. The path is relative to the service's API base URL (see norcube config list). METHOD defaults to GET, or POST when fields or --input are given.

-f key=value adds a string field and -F key=value a typed one (true, false, null, numbers, or @file for a file's contents). Fields become query parameters on GET, HEAD and DELETE and a JSON body otherwise. --input sends a file (or - for stdin) as the body instead.

--paginate follows the service's cursor (nextCursor, cursors.next or the nextCursorCreatedAt/nextCursorId pair) and merges the arrays of every page.

Usage

norcube api <service> [METHOD] <path> [flags]

Examples

# List data sources in the profile's organization
norcube api backup GET /datasources

# Check one domain in another organization
norcube api domainradar POST /check -f domain=example.com --org acme

# Every bulk check, all pages, only the ids
norcube api domainradar /check/bulk --paginate --query "list[].id"

# A request body from a file
norcube api langsync POST /namespaces --input namespace.json

Flags

FlagDefaultDescription
-f, --fieldAdd a string field key=value (repeatable)
-H, --headerAdd a request header "Key: Value" (repeatable)
--inputSend this file as the request body, - for stdin
--paginateFollow cursors and merge every page
-F, --raw-fieldAdd a typed field key=value: true, false, null, a number or @file (repeatable)

Every command also takes the global flags: --profile, --org, -o, --query, --debug and more.

See also

  • norcube: Command-line interface for the Norcube platform

On this page