- 官方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 template
- get all function template
- use a function template
- update a function template
- delete a function template
- get one function template
- star a function template
- get function template user star state
- get people who use this function template
- get my function template
- get all recommend function template
- 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 applicationPOST
- Get user application listGET
- Get an application by appidGET
- Delete an applicationDELETE
- Update application namePATCH
- Update application statePATCH
- Update application bundlePATCH
- Bind custom domain to applicationPATCH
- Remove custom domain of applicationDELETE
- Check if domain is resolvedPOST
- Update environment variables (replace all)POST
- Set a environment variable (create/update)PATCH
- Get environment variablesGET
- Delete an environment variable by nameDELETE
- Get app all pod nameGET
- Get pod's containersGET
- Get app pod logsGET
- Add application dependenciesPOST
- Update application dependenciesPATCH
- Get application dependenciesGET
- Remove a dependencyDELETE
- 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 application
国服环境
https://api.laf.run
国服环境
https://api.laf.run
POST
/v1/applications
Application
请求参数
Body 参数application/json
cpu
number
必需
示例值:
200
memory
number
必需
示例值:
256
databaseCapacity
number
必需
示例值:
2048
storageCapacity
number
必需
示例值:
4096
autoscaling
object (CreateAutoscalingDto)
必需
enable
boolean
必需
默认值:
false
minReplicas
number
必需
默认值:
1
maxReplicas
number
必需
默认值:
5
targetCPUUtilizationPercentage
number
可选
默认值:
50
targetMemoryUtilizationPercentage
number
可选
默认值:
50
dedicatedDatabase
object (CreateDedicatedDatabaseDto)
必需
cpu
number
必需
示例值:
200
memory
number
必需
示例值:
256
capacity
number
必需
示例值:
1024
replicas
number
必需
示例值:
3
name
string
必需
state
enum<string>
必需
枚举值:
Running
默认值:
Running
regionId
string
必需
runtimeId
string
必需
示例
{
"cpu": 200,
"memory": 256,
"databaseCapacity": 2048,
"storageCapacity": 4096,
"autoscaling": {
"enable": false,
"minReplicas": 1,
"maxReplicas": 5,
"targetCPUUtilizationPercentage": 50,
"targetMemoryUtilizationPercentage": 50
},
"dedicatedDatabase": {
"cpu": 200,
"memory": 256,
"capacity": 1024,
"replicas": 3
},
"name": "string",
"state": "Running",
"regionId": "string",
"runtimeId": "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/applications' \
--header 'Content-Type: application/json' \
--data-raw '{
"cpu": 200,
"memory": 256,
"databaseCapacity": 2048,
"storageCapacity": 4096,
"autoscaling": {
"enable": false,
"minReplicas": 1,
"maxReplicas": 5,
"targetCPUUtilizationPercentage": 50,
"targetMemoryUtilizationPercentage": 50
},
"dedicatedDatabase": {
"cpu": 200,
"memory": 256,
"capacity": 1024,
"replicas": 3
},
"name": "string",
"state": "Running",
"regionId": "string",
"runtimeId": "string"
}'
返回响应
🟢200成功
application/json
Body
error
string
可选
data
object
ApplicationWithRelations
_id
string
必需
name
string
必需
appid
string
必需
regionId
string
必需
runtimeId
string
必需
tags
array[string]
必需
state
enum<string>
必需
枚举值:
RunningStoppedRestartingDeleted
phase
enum<string>
必需
枚举值:
CreatingCreatedStartingStartedStoppingStoppedDeletingDeleted
createdAt
string <date-time>
必需
updatedAt
string <date-time>
必需
createdBy
string
必需
region
object
Region
bundle
object
ApplicationBundle
runtime
object
Runtime
configuration
object
ApplicationConfiguration
domain
object
RuntimeDomain
示例
{
"error": "string",
"data": {
"_id": "string",
"name": "string",
"appid": "string",
"regionId": "string",
"runtimeId": "string",
"tags": [
"string"
],
"state": "Running",
"phase": "Creating",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"createdBy": "string",
"region": {
"_id": "string",
"name": "string",
"displayName": "string",
"state": "string",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
},
"bundle": {
"_id": "string",
"appid": "string",
"resource": {
"limitCPU": 500,
"limitMemory": 1024,
"databaseCapacity": 1024,
"storageCapacity": 1024,
"limitCountOfCloudFunction": 100,
"limitCountOfBucket": 3,
"limitCountOfDatabasePolicy": 3,
"limitCountOfTrigger": 1,
"limitCountOfWebsiteHosting": 3,
"reservedTimeAfterExpired": 0,
"dedicatedDatabase": {
"limitCPU": 500,
"limitMemory": 1024,
"capacity": 1024,
"replicas": 1
}
},
"autoscaling": {
"enable": true,
"minReplicas": 0,
"maxReplicas": 0,
"targetCPUUtilizationPercentage": 0,
"targetMemoryUtilizationPercentage": 0
},
"isTrialTier": true,
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
},
"runtime": {
"_id": "string",
"name": "string",
"type": "string",
"image": {
"main": "string",
"init": "string",
"sidecar": "string"
},
"state": "string",
"version": "string",
"latest": true
},
"configuration": {
"_id": "string",
"appid": "string",
"environments": [
{
"name": "string",
"value": "string"
}
],
"dependencies": [
"string"
],
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
},
"domain": {
"_id": "string",
"appid": "string",
"domain": "string",
"customDomain": "string",
"state": "Active",
"phase": "Creating",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
}
}
}