Create function
Creates a function and assigns its hostname. The kind is required and immutable, and the new function is scaffolded with a working hello-world so that "created" and "deployable" are the same state.
Authorization
BearerAuth A team API key, created by a team admin in the console and presented as
Authorization: Bearer xk_…. Xeonr Auth issues and verifies it; the
secret is shown once at creation and stored only as a hash, and a
revoked key stops working within 30 seconds. An existing fnt_… token
is accepted the same way.
In: header
Header Parameters
Define the version of the Connect protocol
1Define the timeout, in ms
Request Body
application/json
display_name is what a human calls this function.
kind is required: a build never has to guess, and a wrong guess would otherwise surface as a build failure rather than as a question.
"KIND_UNSPECIFIED" | "KIND_NODE" | "KIND_GO" | "KIND_STATIC"owner_team is the owning Xeonr team's URN. Required; a token always uses its own team.
BuildConfig is the author's declared intent. Every field is optional, and each applies to only some kinds.
ScalingSpec is passed through to the platform. Ignored for static functions, which have nothing to scale. An unset field means the platform's default.
Response Body
application/json
application/json
curl -X POST "https://functions.xeonr.io/xeonr.functions.v1.FunctionService/CreateFunction" \ -H "Connect-Protocol-Version: 1" \ -H "Content-Type: application/json" \ -d '{}'{
"function": {
"functionId": "string",
"name": "string",
"displayName": "string",
"ownerTeam": "string",
"kind": "KIND_UNSPECIFIED",
"build": {
"packages": [
"string"
],
"entrypoint": [
"string"
],
"port": 0,
"staticDir": "string",
"mainPackage": "string"
},
"scaling": {
"minInstances": 0,
"maxInstances": 0,
"concurrency": 0,
"idleTimeoutSec": 0,
"activationTimeoutSec": 0
},
"env": {
"property1": "string",
"property2": "string"
},
"secretKeys": [
"string"
],
"git": {
"provider": "GIT_PROVIDER_UNSPECIFIED",
"repo": "string",
"branch": "string",
"subdirectory": "string",
"webhookUrl": "string",
"credentialsSet": true,
"authMode": "AUTH_MODE_UNSPECIFIED",
"installationId": 0,
"credentialExpiresAtUnix": 0
},
"activeVersionId": "string",
"filesReadOnly": true,
"createdAtUnix": 0,
"updatedAtUnix": 0,
"activeVersion": {
"versionId": "string",
"functionId": "string",
"state": "VERSION_STATE_UNSPECIFIED",
"snapshotId": "string",
"environmentId": "string",
"appId": "string",
"staticRoot": "string",
"gitCommit": "string",
"gitRef": "string",
"failureMessage": "string",
"createdAtUnix": 0
},
"latestVersion": {
"versionId": "string",
"functionId": "string",
"state": "VERSION_STATE_UNSPECIFIED",
"snapshotId": "string",
"environmentId": "string",
"appId": "string",
"staticRoot": "string",
"gitCommit": "string",
"gitRef": "string",
"failureMessage": "string",
"createdAtUnix": 0
}
}
}{
"code": "not_found",
"message": "string",
"details": [
{
"type": "string",
"value": "string",
"debug": {}
}
]
}