- 官方Swagger
- Monitor
- Group
- Find internal group of the application
- Get group by invite code
- Get group list of the user
- Create group for the user
- Delete a group
- Get detail of a group
- Update group
- Get group invite code
- Update group invite code
- Delete group invite code
- Get members of a group
- Join a group
- Remove a group member
- Update the role of a member
- Leave a group
- RecycleBin
- FunctionTemplate
- create a function templatePOST
- get all function templateGET
- use a function templatePOST
- update a function templatePATCH
- delete a function templateDELETE
- get one function templateGET
- star a function templatePUT
- get function template user star stateGET
- get people who use this function templateGET
- get my function templateGET
- get all recommend function templateGET
- Billing
- Trigger
- User
- Authentication
- Signup by user-password
- Signin by user-password
- Reset password
- Check if user-password is set
- Send phone verify code
- Signin by phone and verify code
- Auth providers
- Get user token by PAT
- Send email verify code
- Redirect to the login page of github
- Signin by github
- Bind github
- Unbind github
- Create a PAT
- List PATs
- Delete a PAT
- WebsiteHosting
- Public
- Function
- Application
- Create application
- Get user application list
- Get an application by appid
- Delete an application
- Update application name
- Update application state
- Update application bundle
- Bind custom domain to application
- Remove custom domain of application
- Check if domain is resolved
- Update environment variables (replace all)
- Set a environment variable (create/update)
- Get environment variables
- Delete an environment variable by name
- Get app all pod name
- Get pod's containers
- Get app pod logs
- Add application dependencies
- Update application dependencies
- Get application dependencies
- Remove a dependency
- Storage
- Database
- Create a new collection in database
- Get collection list of an application
- Get collection by name
- Update a collection
- Delete a collection by its name
- Create database policy
- Get database policy list
- Update database policy
- Remove a database policy
- The database proxy for database management
- Export database of an application
- Import database of an application
- Create database policy rule
- Get database policy rules
- Update database policy rule by collection name
- Remove a database policy rule by collection name
- Get dedicated database resources metrics data
- Get dedicated database connections metrics data
- Get dedicated database performance metrics data
- Account
- Laf-Toolkit 所需接口
create a function template
国服环境
https://api.laf.run
国服环境
https://api.laf.run
POST
/v1/function-templates
FunctionTemplate
请求参数
Body 参数application/json
name
string
必需
dependencies
array[object (CreateDependencyDto) {2}]
必需
name
string
必需
spec
string
必需
environments
array[object (CreateEnvironmentDto) {2}]
必需
name
string
必需
value
string
必需
private
boolean
必需
description
string
可选
items
array[object (FunctionTemplateItemDto) {4}]
必需
name
string
必需
description
string
可选
methods
array[string]
必需
枚举值:
GETPOSTPUTDELETEPATCHHEAD
code
string
必需
示例
{
"name": "string",
"dependencies": [
{
"name": "string",
"spec": "string"
}
],
"environments": [
{
"name": "string",
"value": "string"
}
],
"private": true,
"description": "string",
"items": [
{
"name": "string",
"description": "string",
"methods": [
"GET"
],
"code": "string"
}
]
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.laf.run/v1/function-templates' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "string",
"dependencies": [
{
"name": "string",
"spec": "string"
}
],
"environments": [
{
"name": "string",
"value": "string"
}
],
"private": true,
"description": "string",
"items": [
{
"name": "string",
"description": "string",
"methods": [
"GET"
],
"code": "string"
}
]
}'
返回响应
🟢200成功
application/json
Body
allOf {2}
可选
object (ResponseUtil)
可选
error
string
可选
data
object
可选
object
可选
data
array[object (FunctionTemplatesDto) {15}]
可选
示例
{
"error": "string",
"data": [
{
"_id": "string",
"uid": "string",
"name": "string",
"dependencies": [
"string"
],
"environments": [
{
"name": "string",
"value": "string"
}
],
"private": true,
"isRecommended": true,
"description": "string",
"star": 0,
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"items": [
{
"_id": "string",
"templateId": "string",
"name": "string",
"desc": "string",
"source": {
"code": "string"
},
"methods": [
"GET"
],
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
}
],
"user": {
"username": "string",
"email": "string"
},
"author": "string",
"stared": true
}
]
}