All Products
Search
Document Center

Function Compute:PutFunctionAsyncInvokeConfig

Last Updated:Jun 02, 2023

Creates or modifies an asynchronous invocation configuration for a function.

Operation Description

The maximum validity period of messages.

Authorization information

There is currently no authorization information disclosed in the API.

Request syntax

PUT /2021-04-06/services/{serviceName}/functions/{functionName}/async-invoke-config

Request parameters

ParameterTypeRequiredDescriptionExample
serviceNamestringYes

The information about the asynchronous invocation configuration.

demo-service
functionNamestringYes

The configurations of the destination of an asynchronous invocation.

helloworld
qualifierstringNo

The latest version of Function Compute API.

test
bodyobjectNo

Alibaba Cloud provides SDKs for multiple programming languages to help you integrate Alibaba Cloud services by using APIs. We recommend that you use an SDK to call API operations. This frees you from manual signature verification.

destinationConfigDestinationConfigNo

You can search for API operations, call and debug API operations online, and dynamically generate executable sample code for SDKs.

maxAsyncEventAgeInSecondslongNo

Alibaba Cloud CLI

300
maxAsyncRetryAttemptslongNo

The information about the asynchronous invocation configuration.

3
statefulInvocationbooleanNo

The version or alias of the service.

true
X-Fc-Account-IdstringNo

The name of the service.

188077086902****
X-Fc-DatestringNo

The creation time.

The information about the asynchronous invocation configuration.
X-Fc-Trace-IdstringNo

The maximum number of retries allowed after an asynchronous invocation fails. Default value: 3. Valid values: 0 to 8.

ksdfjkdmkki***

Response parameters

ParameterTypeDescriptionExample
object

The configuration structure of the destination for asynchronous invocation.

createdTimestring

Sat, 14 Jul 2017 07:02:38 GMT

2020-09-10T02:45:02Z
destinationConfigDestinationConfig

The trace ID of the invocation request of Function Compute.

{"onSuccess": null,"onFailure": {"destination": "acs:mns:cn-shanghai:123:/queues/xxx/messages"}}
functionstring

The name of the function.

helloworld
lastModifiedTimestring

The configuration structure of the destination for asynchronous invocation.

2020-09-10T02:45:02Z
maxAsyncEventAgeInSecondslong

Specifies whether to enable the asynchronous task feature.

  • true: enables the asynchronous task feature.
  • false: does not enable the asynchronous task feature.
300
maxAsyncRetryAttemptslong

The ID of your Alibaba Cloud account.

3
qualifierstring

Specifies whether to enable the asynchronous task feature.

  • true: enables the asynchronous task feature.
  • false: does not enable the asynchronous task feature.
test
servicestring

Creates or modifies an asynchronous invocation configuration for a function.

demo-service
statefulInvocationboolean

Jianyi

true

Examples

Sample success responses

JSONformat

{
  "createdTime": "2020-09-10T02:45:02Z",
  "destinationConfig": {
    "onSuccess": {
      "destination": "acs:fc:cn-shanghai:xxx:services/s1/functions/f1"
    },
    "onFailure": {
      "destination": "acs:fc:cn-shanghai:xxx:services/s1/functions/f1"
    }
  },
  "function": "helloworld",
  "lastModifiedTime": "2020-09-10T02:45:02Z",
  "maxAsyncEventAgeInSeconds": 300,
  "maxAsyncRetryAttempts": 3,
  "qualifier": "test",
  "service": "demo-service",
  "statefulInvocation": true
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2021-06-29The input parameters of the API operation change.
Change itemChange content
Input ParametersThe input parameters of the API operation change.
    Added Input Parameters: X-Fc-Account-Id
    Added Input Parameters: X-Fc-Code-Checksum
    Added Input Parameters: X-Fc-Log-Type
    Added Input Parameters: X-Fc-Invocation-Type
    Added Input Parameters: X-Fc-Date
    Added Input Parameters: X-Fc-Trace-Id
2021-06-29The input parameters of the API operation change.
Change itemChange content
Input ParametersThe input parameters of the API operation change.
    Added Input Parameters: X-Fc-Account-Id
2021-06-29The input parameters of the API operation change.
Change itemChange content
Input ParametersThe input parameters of the API operation change.
    delete Input Parameters: X-Fc-Account-Id