deploy#
Register an agent (function) to the openYuanrong cluster via meta_service.
Usage#
adx deploy [OPTIONS]
Parameters#
-s, --spec: Function definition, either an inline JSON string or a JSON file path (auto-detected); invalid JSON or non-existent file will cause an error.--server: meta_service address inhost:portformat, e.g.127.0.0.1:31182(http is assumed, no scheme needed); you can also explicitly passhttps://host:portto use HTTPS; invalid format will cause an error.
Notes#
JWT authentication is supported via the global
--jwt-tokenoption or theYR_JWT_TOKENenvironment variable, sent in theX-Authrequest header. Using the environment variable is recommended to avoid token leakage in process lists or shell history.-s/--specperforms format validation: if the value is an existing file, it reads and parses the JSON from the file; otherwise, it parses as inline JSON (i.e. file path takes priority). If neither condition is met (neither valid JSON nor an existing file path), it exits with an error (exit code 2).--servermust be inhost:portformat (missing port or invalid port will cause an error). HTTP is used by default; to use HTTPS, explicitly passhttps://host:port.If the
enableSessionCtxfield is not set in the function definition, it defaults totrue; if explicitly set (totrueorfalse), the user’s value is preserved.Upon successful registration, the public agent name is printed in the format
0@namespace@funcname, which can be used directly withadx exec --agent.
Exit Codes#
Exit Code |
Meaning |
|---|---|
|
Success |
|
Server failure (HTTP non-2xx, or response |
|
Parameter error (invalid JSON, file not found, invalid |
|
Network error (connection failure, timeout) |
Examples#
adx deploy -s ./agent.json --server 127.0.0.1:31182
adx deploy -s '{"name":"0@faaspy@demo","runtime":"python3.11","handler":"demo.handler"}' \
--server 127.0.0.1:31182