Executing a Function Asynchronously and Returning Reserved Instance IDs(Discarded)
Function
This API is used to execute a function asynchronously and return reserved instance IDs. It is suitable for clients that execute a time-consuming task but do not need to wait for the execution result. A reserved instance ID will be returned for this API. If the instance is abnormal, you can delete it based on its ID. Note that this API is only available for whitelisted users.
URI
POST /v2/{project_id}/fgs/functions/{function_urn}/reserved-invocations
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details, see Obtaining a Project ID. |
function_urn |
Yes |
String |
Function URN. For details, see the function model description. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
{User defined key} |
Yes |
Object |
Request body for executing a function asynchronously and returning reserved instance IDs. |
Response Parameters
Status code: 202
Parameter |
Type |
Description |
---|---|---|
Content-Type |
String |
application/json |
Parameter |
Type |
Description |
---|---|---|
instance_id |
String |
Reserved instance ID. |
Status code: 404
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Example Requests
Execute a function asynchronously and return reserved instance IDs.
POST /v2/{project_id}/fgs/functions/{function_urn}/reserved-invocations { "body" : { "k" : "v" } }
Example Responses
Status code: 202
Accepted
{ "instance_id" : "048bad9b-96ae-45ad-8f12-4061a744ef9d" }
Status code: 404
Not Found
{ "error_code" : "FSS.1051", "error_msg" : "Not found the function" }
Status Codes
Status Code |
Description |
---|---|
202 |
Accepted |
404 |
Not Found |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank 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