Custom tenant command of a function
Function
Custom tenant command of a function
Calling Method
For details, see Calling APIs.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions. For details about the required permissions, see Permissions Policies and Supported Actions.
URI
POST /v2/{project_id}/fgs/functions/{function_urn}/command
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Parameter description: Project ID. For details, see Obtaining a Project ID. Constraints: None Value range: 32 characters, including letters and digits. Default value: None |
| function_urn | Yes | String | Parameter description: URN of the function. For details, see Function Model. Constraints: None Value range: Only letters, digits, underscores (_), hyphens (-), and colons (:) are allowed. Default value: None |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Parameter description: User token. The token can be obtained by calling the IAM API. The value of X-Subject-Token in the response header is the user token. Constraints: None Value range: None Default value: None |
| Content-Type | Yes | String | Parameter description: Specifies the type (or format) of the message body. Constraints: None Value range: Only application/json is supported. Default value: application/json |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| command | Yes | String | Command name |
| runtime | No | String | Runtime |
| pod_name | No | Array of strings | Pod name |
| timeout | No | Integer | Timeout interval of the execution. |
| args | No | Map<String,String> | Command Parameters |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| task_id | String | Task name. |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. |
| error_msg | String | Error message. |
Status code: 401
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. |
| error_msg | String | Error message. |
Status code: 403
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. |
| error_msg | String | Error message. |
Status code: 500
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. |
| error_msg | String | Error message. |
Example Requests
Create a task for customizing a tenant command.
POST https://{Endpoint}/v2/{project_id}/fgs/{function_urn}/command
{
"command" : "heap",
"runtime" : "Cangjie1.9",
"pod_name" : [ "pod1" ],
"timeout" : 60,
"args" : {
"duration" : 60
}
} Example Responses
Status code: 200
{
"task_id" : "52b8abae-2230-479a-959e-602176d6151e"
} Status code: 400
{
"error_code" : "FSS.0400",
"error_msg" : "Invalid parameter."
} Status code: 401
{
"error_code" : "FSS.0401",
"error_msg" : "Unauthorized access."
} Status code: 403
{
"error_code" : "FSS.0403",
"error_msg" : "Forbidden"
} Status Codes
| Status Code | Description |
|---|---|
| 200 | ok |
| 400 | Invalid parameter. |
| 401 | Unauthorized |
| 403 | Forbidden |
| 500 | Internal server error. |
Error Codes
See Error Codes.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot