Skip to main content

hivepaas function

Functions: code HivePaaS runs on one of its runtimes - node24, bun1, python313, go127 - a handler that answers one request. The code is a directory's here: init writes a runtime's starter code, create makes a function of it, deploy sends it again, run calls it once before it is deployed. A function's logs and domains are its app's: hivepaas logs, hivepaas domain.

hivepaas function [command]

Aliases: function, fn, functions

hivepaas function create​

Make a function in an environment, of DIR's code - . by default - or with --repo of a repository's, and deploy it: the command waits for the deployment while following its logs, as deploy does. The directory is linked to the function, so that function deploy there needs no flags, unless --no-link or it is linked to another app already.

What is sent of a directory leaves out .git, node_modules, pycache, .venv, venv, .hivepaas and what its .gitignore ignores; --list shows it.

hivepaas function create NAME [DIR] [flags]

Examples:

hivepaas function create hello ./hello -p shop -e staging --runtime node24
hivepaas function create resize -p shop -e staging --runtime python313 \
--repo https://github.com/acme/functions.git --ref main --path resize --call-timeout 2m

Flags:

FlagDescription
--auto-deploydeploy each push to the ref
--call-timeout stringhow long one call may take: 30s, 2m; 1s to 15m
--commit stringbuild this commit, its full SHA, and stay at it; none to follow the ref
--domain stringserve it at this domain, over HTTPS
--entrypoint stringthe file the handler is in; for Go, its package's directory
--git-credential stringclone with this git credential; none for none
--handler stringthe handler's name: default, handler, Handle
--listshow the files that would be sent, and send nothing
--max-body stringthe largest request body: 6MB
--max-concurrency intthe calls one replica takes at once
--no-auto-deploydo not deploy on push
--no-linkdo not link the directory to the function
--no-waitdo not wait for the deployment
--packages stringDebian packages the runtime image gets: curl,jq; "" for none
--path stringthe function's directory in the repository
--push-to stringpush the built image to the registry of this credential; none keeps it on the node
--ref stringthe branch to build, or tags/NAME for a tag
--repo stringbuild the function from this git repository
--runtime stringnode24, bun1, python313 or go127
--timeout durationhow long to wait for the deployment (default: 30m0s)

hivepaas function deploy​

Send a function's code - DIR's, . by default, in place of the function's, whole - and the settings its flags change, which deploys it; the command waits as deploy does. A function built from a repository takes no directory: --ref, --commit and --path change what is built, and --use inline sends a directory's code instead. The same code and settings deploy it again.

hivepaas function deploy [DIR] [flags]

Examples:

hivepaas function deploy # in a directory linked to the function
hivepaas function deploy ./hello --call-timeout 1m -a hello
hivepaas function deploy --commit $GITHUB_SHA -a resize

Flags:

FlagDescription
--auto-deploydeploy each push to the ref
--call-timeout stringhow long one call may take: 30s, 2m; 1s to 15m
--commit stringbuild this commit, its full SHA, and stay at it; none to follow the ref
--entrypoint stringthe file the handler is in; for Go, its package's directory
--git-credential stringclone with this git credential; none for none
--handler stringthe handler's name: default, handler, Handle
--listshow the files that would be sent, and send nothing
--max-body stringthe largest request body: 6MB
--max-concurrency intthe calls one replica takes at once
--no-auto-deploydo not deploy on push
--no-waitstart the deployment and return
--packages stringDebian packages the runtime image gets: curl,jq; "" for none
--path stringthe function's directory in the repository
--push-to stringpush the built image to the registry of this credential; none keeps it on the node
--ref stringthe branch to build, or tags/NAME for a tag
--repo stringbuild the function from this git repository
--timeout durationhow long to wait for the deployment (default: 30m0s)
--use stringswitch where the code is: inline, or repo

hivepaas function get​

Show a function: its runtime, code and limits

hivepaas function get [FUNCTION]

hivepaas function init​

Write a runtime's starter code into DIR, . by default, made if missing: a handler answering ?name=Ada with {"hello":"Ada"}, as the dashboard starts a function. A file there already is not overwritten unless --force.

hivepaas function init [DIR] [flags]

Examples:

hivepaas function init hello --runtime node24
hivepaas function create hello hello -p shop -e staging --runtime node24

Flags:

FlagDescription
--forceoverwrite the files there
--runtime stringnode24, bun1, python313 or go127
--typescriptNode.js's starter code in TypeScript

hivepaas function ls​

List an environment's functions

hivepaas function ls

hivepaas function metrics​

Show a function's calls: how many, how they ended, how long they took

hivepaas function metrics [FUNCTION] [flags]

Flags:

FlagDescription
--range string1h, 6h, 24h or 7d (default: 24h)

hivepaas function pull​

Write a function's code as the server keeps it - code written in the dashboard - into DIR, . by default, made if missing. A file there with other content stops it, unless --force.

hivepaas function pull [DIR] [flags]

Flags:

FlagDescription
--forceoverwrite the files there

hivepaas function run​

Call a function once with DIR's code - . by default - not saved nor deployed, in a throwaway container on a build node, with the function's variables and secrets: the dashboard's Test run. The body it answered goes to stdout, as it is; its status, how long it took and what it logged go to stderr. It exits 0 when the function answered, whatever its status - as curl does, and with --fail, 8 for a status of 400 or more - and 8 when it did not answer.

hivepaas function run [DIR] [flags]

Examples:

hivepaas function run --query name=Ada
hivepaas function run ./hello --method POST --data @order.json --header 'Content-Type: application/json' | jq .

Flags:

FlagDescription
--data stringthe request's body: text, @FILE, or @- for stdin
--failexit 8 for a status of 400 or more
--header stringArraya header, 'K: V'; repeat for more
--listshow the files that would be sent, and send nothing
--method stringthe request's method (default: GET)
--path stringthe request's path (default: /)
--query stringArraya query parameter, K=V; repeat for more
--save-lockwrite the lock files the run made into the directory

The global flags apply to every command.