Deploy (or replace) one function from its source in the body.
PUT
/v0/projects/{id}/functions/{name}
const url = 'https://infra-hyphae.run/v0/projects/example/functions/example';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'text/javascript'}, body: 'example'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://infra-hyphae.run/v0/projects/example/functions/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: text/javascript' \ --data exampleThe body is the JavaScript module (UTF-8, ≤ 512 KiB) with
export default async function handler(req) returning
{ status, headers?, body }. It is written to
CLOUDD_FUNCTIONS_ROOT/<project>/<name>/index.js; the record keeps
version (incremented on redeploy) and sha256 of the source.
Session owner only. Receipted.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”id
required
string
name
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typetext/javascript
string
Responses
Section titled “ Responses ”Redeployed (version incremented).
Media typeapplication/json
object
project
required
string
name
required
string
version
required
integer
sha256
required
SHA-256 hex of the deployed source.
string
size
required
integer
runtime
required
string
created_at
required
RFC 3339, UTC.
string format: date-time
updated_at
required
RFC 3339, UTC.
string format: date-time
Example
{ "runtime": "node"}Deployed.
Media typeapplication/json
object
project
required
string
name
required
string
version
required
integer
sha256
required
SHA-256 hex of the deployed source.
string
size
required
integer
runtime
required
string
created_at
required
RFC 3339, UTC.
string format: date-time
updated_at
required
RFC 3339, UTC.
string format: date-time
Example
{ "runtime": "node"}Malformed or out-of-bounds input (invalid_request).
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
Example
{ "error": { "code": "invalid_request" }}Missing, malformed, duplicate, or unknown credential (authentication_required).
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
Example
{ "error": { "code": "invalid_request" }}Headers
Section titled “Headers”WWW-Authenticate
string
Unknown route, or a project the caller does not own (not_found).
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
Example
{ "error": { "code": "invalid_request" }}Body exceeds the surface’s limit (payload_too_large).
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
Example
{ "error": { "code": "invalid_request" }}