Alibaba Cloud Function Compute API Specification
Overview
Version information
Version : 0.1
URI scheme
Host : $account-id.$region.fc.aliyuncs.comBasePath : /2016-08-15Schemes : HTTP, HTTPS
Tags
- Service : Service operations
- Function : Function operations
- Trigger : Trigger operations
- Version : Version operations
- Alias :Alias operations
- CustomDomain: CustomDomain operations
- ProvisionConfig: ProvisionConfig operations
Consumes
application/json
Produces
application/json
Resources
Service
Service operations
CreateService
ListServices
GetService
UpdateService
DeleteService
Function
Function operations
CreateFunction
ListFunctions
GetFunction
UpdateFunction
DeleteFunction
GetFunctionCode
InvokeFunction
Trigger
Trigger operations
CreateTrigger
ListTriggers
GetTrigger
UpdateTrigger
DeleteTrigger
Version
Version operations
PublishVersion
ListVersions
DeleteVersion
Alias
Alias operations
CreateAlias
ListAliases
GetAlias
UpdateAlias
DeleteAlias
CustomDomain
CreateCustomDomain
ListCustomDomain
GetCustomDomain
UpdateCustomDomain
DeleteCustomDomain
ProvisionConfig
PutProvisionConfig
GetProvisionConfig
ListProvisionConfigs
Operations
CreateFunction
POST /services/{serviceName}/functions
Description
Create a function
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | Host required |
Host name, $account-id.$region.fc.aliyuncs.com | string |
Path | serviceName required |
Service name | string |
Body | body required |
Function resource | Function |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | Successfully created the resource. Headers : ETag (string) : Guarantees that the function that is updated or deleted matches the etag. |
FunctionResponse |
400 | Invalid arguments. Error code is InvalidArgument. | Error |
403 | Denied requests. Error code is AccessDenied, InvalidAccessKeyId, SignatureNotMatch, and RequestTimeTooSkewed. | Error |
404 | Service does not exist. Error code is ServiceNotFound. | Error |
409 | Function already exists. Error code is FunctionAlreadyExists. | Error |
500 | Internal server error. Error code is InternalServerError. | Error |
CreateService
POST /services
Description
create service
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | Host required |
Host name, $account-id.$region.fc.aliyuncs.com | string |
Body | body required |
Service resource | Service |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | Successfully created the resource. Headers : ETag (string) : Guarantees that the service that is updated or deleted matches the etag. |
ServiceResponse |
400 | Invalid arguments. Error code is InvalidArgument. | Error |
403 | Denied requests. Error code is AccessDenied, InvalidAccessKeyId, SignatureNotMatch, and RequestTimeTooSkewed. | Error |
409 | Service already exists. Error code is ServiceAlreadyExists. | Error |
500 | Internal server error. Error code is InternalServerError. | Error |
CreateTrigger
POST /services/{serviceName}/functions/{functionName}/triggers
Description
Create a trigger
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | Host required |
Host name, $account-id.$region.fc.aliyuncs.com | string |
Path | functionName required |
Function name | string |
Path | serviceName required |
Service name | string |
Body | body required |
Trigger resource | Trigger |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | Successfully created the resource Headers : ETag (string) : Guarantees that the trigger that is updated or deleted matches the etag. |
TriggerResponse |
400 | Invalid arguments. Error code is InvalidArgument. | Error |
403 | Denied requests. Error code is AccessDenied, InvalidAccessKeyId, SignatureNotMatch, and RequestTimeTooSkewed. | Error |
404 | Service or function does not exist. Error code is ServiceNotFound and FunctionNotFound. | Error |
409 | Trigger already exists. Error code is TriggerAlreadyExists. | Error |
500 | Internal server error. Error code is InternalServerError. | Error |
PublishVersion
POST /services/{serviceName}/versions
Description
Publish version
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | Host required |
Host name, $account-id.$region.fc.aliyuncs.com | string |
Header | If-Match optional |
Guarantees the service to be published is the requested one. The value is included in the Create/Get/Update Service API response. | string |
Path | serviceName required |
service name | string |
Body | body optional |
version description | string |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | Successfully published a version Headers : ETag (string) : version etag,Guarantees the version to be deleted matches the etag. |
VersionResponse |
400 | Invalid arguments, Error code is InvalidArgument. | Error |
403 | Denied requests. Error code is AccessDenied,InvalidAccessKeyId,SignatureNotMatch,RequestTimeTooSkewed | Error |
404 | service does not exist. Error code is ServiceNotFound | Error |
409 | service publish error,Error code is VersionPublishError, ConcurrentUpdateError | Error |
500 | Internal server error. Error code is InternalServerError. | Error |
CreateAlias
POST /services/{serviceName}/aliases
Description
Create alias
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | Host required |
Host name, :$account-id.$region.fc.aliyuncs.com | string |
Path | serviceName required |
service name | string |
Body | body required |
alias name | string |
Body | body required |
version Id | string |
Body | body optional |
alias description | string |
Body | body optional |
additional service version and traffic weight | map |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | Successfully created the resource Headers : ETag (string) : alias etag. Guarantee that the alias that is updated or deleted matches the etag. |
AliasResponse |
400 | Invalid arguments. Error code is InvalidArgument. | Error |
403 | Denied requests. Error code is AccessDenied,InvalidAccessKeyId,SignatureNotMatch,RequestTimeTooSkewed | Error |
404 | service or version does not exist. Error code is ServiceNotFound,VersionNotFound | Error |
409 | alias already exists. Error code is AliasAlreadyExists. | Error |
500 | Internal server error. Error code is InternalServerError | Error |
DeleteFunction
DELETE /services/{serviceName}/functions/{functionName}
Description
Deletes the function
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | Host required |
Host name, $account-id.$region.fc.aliyuncs.com | string |
Header | If-Match optional |
Guarantees the resource that’s to be updated is the requested one. The value is included in the Create/Get/Update Service/Function/Trigger API response. | string |
Path | functionName required |
Function name | string |
Path | serviceName required |
Service name | string |
Responses
HTTP Code | Description | Schema |
---|---|---|
204 | Successfully deleted the requested resource. | No Content |
400 | Invalid arguments. Error code is InvalidArgument. | Error |
403 | Denied requests. Error code is AccessDenied, InvalidAccessKeyId, SignatureNotMatch, and RequestTimeTooSkewed. | Error |
404 | Service or function does not exist. Error code is ServiceNotFound and FunctionNotFound. | Error |
409 | Function has at least one trigger. Error code is FunctionNotEmpty. | Error |
500 | Internal server error. Error code is InternalServerError. | Error |
DeleteService
DELETE /services/{serviceName}
Description
Deletes the service
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | Host required |
Host name, $account-id.$region.fc.aliyuncs.com | string |
Header | If-Match optional |
Guarantees the resource that’s to be updated is the requested one. The value is included in the Create/Get/Update Service/Function/Trigger API response. | string |
Path | serviceName required |
Service name | string |
Responses
HTTP Code | Description | Schema |
---|---|---|
204 | Successfully deleted the requested resource. | No Content |
400 | Invalid arguments. Error code is InvalidArgument. | Error |
403 | Denied requests. Error code is AccessDenied, InvalidAccessKeyId, SignatureNotMatch, and RequestTimeTooSkewed. | Error |
404 | Service does not exist. Error code is ServiceNotFound. | Error |
409 | Service has at least one function. Error code is ServiceNotEmpty. | Error |
500 | Internal server error. Error code is InternalServerError. | Error |
DeleteTrigger
DELETE /services/{serviceName}/functions/{functionName}/triggers/{triggerName}
Description
Deletes the trigger
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | Host required |
Host name, $account-id.$region.fc.aliyuncs.com | string |
Header | If-Match optional |
Guarantees the resource that’s to be updated is the requested one. The value is included in the Create/Get/Update Service/Function/Trigger API response. | string |
Path | functionName required |
Function name | string |
Path | serviceName required |
Service name | string |
Path | triggerName required |
Trigger name | string |
Responses
HTTP Code | Description | Schema |
---|---|---|
204 | Successfully deleted the requested resource. | No Content |
400 | Invalid arguments. Error code is InvalidArgument. | Error |
403 | Denied requests. Error code is AccessDenied, InvalidAccessKeyId, SignatureNotMatch, and RequestTimeTooSkewed. | Error |
404 | Service, function, or trigger does not exist. Error code is ServiceNotFound, FunctionNotFound, and TriggerNotFound. | Error |
500 | Internal server error. Error code is InternalServerError. | Error |
DeleteVersion
DELETE /services/{serviceName}/versions/{versionId}
Description
Delete version
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | Host required |
Host name, $account-id.$region.fc.aliyuncs.com | string |
Path | serviceName required |
service name | string |
Path | versionId required |
version Id | string |
Responses
HTTP Code | Description | Schema |
---|---|---|
204 | Successfully deleted the requested resource. | No Content |
400 | Invalid arguments. Error code is InvalidArgument | Error |
403 | Denied requests. Error code is AccessDenied,InvalidAccessKeyId,SignatureNotMatch,RequestTimeTooSkewed | Error |
404 | version does not exist. Error code is VersionNotFound | Error |
409 | Resource is operated by other thread,Error code is ConcurrentUpdateError | Error |
500 | Internal server error. Error code is InternalServerError. | Error |
DeleteAlias
DELETE /services/{serviceName}/aliases/{aliasName}
Description
Delete alias
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | Host required |
Host name:$account-id.$region.fc.aliyuncs.com | string |
Header | If-Match optional |
Guarantees the resource that’s to be updated is the requested one. The value is included in the Create/Get/Update Alias API response. | string |
Path | serviceName required |
service name | string |
Path | aliasName required |
alias name | string |
Responses
HTTP Code | Description | Schema |
---|---|---|
204 | Successfully deleted the requested resource. | No Content |
400 | Invalid arguments. Error code is InvalidArgument | Error |
403 | Denied requests. Error code is AccessDenied,InvalidAccessKeyId,SignatureNotMatch,RequestTimeTooSkewed | Error |
404 | alias does not exist. Error code is AliasNotFound | Error |
409 | Resource is operated by other thread,Error code is ConcurrentUpdateError | Error |
500 | Internal server error. Error code is InternalServerError | Error |
GetFunction
GET /services/{serviceName}/functions/{functionName}
GET /services/{serviceName}.{qualifier}/functions/{functionName}
Description
Get function resource
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | Host required |
Host name, $account-id.$region.fc.aliyuncs.com | string |
Path | functionName required |
Function name | string |
Path | serviceName required |
Service name | string |
Path | qualifier optional |
service version, can be versionId or aliasName | string |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | Successfully retrieved the function Headers : ETag (string) : Guarantees that the function that is updated or deleted matches the etag. |
FunctionResponse |
400 | Invalid arguments. Error code is InvalidArgument. | Error |
403 | Denied requests. Error code is AccessDenied, InvalidAccessKeyId, SignatureNotMatch, and RequestTimeTooSkewed. | Error |
404 | Service, function, version or alias does not exist. Error code is ServiceNotFound, FunctionNotFound, VersionNotFound, AliasNotFound. | Error |
500 | Internal server error. Error code is InternalServerError. | Error |
GetFunctionCode
GET /services/{serviceName}/functions/{functionName}/code
GET /services/{serviceName}.{qualifier}/functions/{functionName}/code
Description
Get function code
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | Host required |
Host name, $account-id.$region.fc.aliyuncs.com | string |
Path | functionName required |
Function name | string |
Path | serviceName required |
Service name | string |
Path | qualifier optional |
service version, can be versionId or aliasName | string |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | Successfully retrieved function | FunctionCodeResponse |
403 | Denied requests. Error code is AccessDenied, InvalidAccessKeyId, SignatureNotMatch, and RequestTimeTooSkewed. | Error |
404 | Service, function, version or alias does not exist. Error code is ServiceNotFound, FunctionNotFound, VersionNotFound, AliasNotFound. | Error |
500 | Internal server error. Error code is InternalServerError. | Error |
GetService
GET /services/{serviceName}
GET /services/{serviceName}.{qualifier}
Description
Get service information
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | Host required |
Host name, $account-id.$region.fc.aliyuncs.com | string |
Path | serviceName required |
Service name | string |
Path | qualifier optional |
service version, can be versionId or aliasName | string |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | Successfully retrieved the service Headers : ETag (string) : Guarantees that the service that is updated or deleted matches the etag. |
ServiceResponse |
400 | Invalid arguments. Error code is InvalidArgument. | Error |
403 | Denied requests. Error code is AccessDenied, InvalidAccessKeyId, SignatureNotMatch, and RequestTimeTooSkewed. | Error |
404 | Service, version or alias does not exist. Error code is ServiceNotFound, VersionNotFound, AliasNotFound. | Error |
500 | Internal server error. Error code is InternalServerError. | Error |
GetAlias
GET /services/{serviceName}/aliases/{aliasName}
Description
Get alias information
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | Host required |
Host name:$account-id.$region.fc.aliyuncs.com | string |
Header | If-Match optional |
Guarantees the resource that’s to be updated is the requested one. The value is included in the Create/Get/Update Alias API response. | string |
Path | serviceName required |
service name | string |
Path | aliasName required |
alias name | string |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | Successfully retrieved the alias Headers : ETag (string) : Guarantees that the alias that is updated or deleted matches the etag. |
AliasResponse |
400 | Invalid arguments. Error code is InvalidArgument. | Error |
403 | Denied requests. Error code is AccessDenied, InvalidAccessKeyId, SignatureNotMatch, and RequestTimeTooSkewed. | Error |
404 | Alias does not exist. Error code is AliasNotFound. | Error |
500 | Internal server error. Error code is InternalServerError. | Error |
GetTrigger
GET /services/{serviceName}/functions/{functionName}/triggers/{triggerName}
Description
Get trigger resource
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | Host required |
Host name, $account-id.$region.fc.aliyuncs.com | string |
Path | functionName required |
Function name | string |
Path | serviceName required |
Service name | string |
Path | triggerName required |
Trigger name | string |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | Successfully retrieved trigger Headers : ETag (string) : Guarantees that the trigger that is updated or deleted matches the etag. |
TriggerResponse |
400 | Invalid arguments. Error code is InvalidArgument. | Error |
403 | Denied requests. Error code is AccessDenied, InvalidAccessKeyId, SignatureNotMatch, and RequestTimeTooSkewed. | Error |
404 | Service, function, or trigger does not exist. Error code is ServiceNotFound, FunctionNotFound, and TriggerNotFound. | Error |
500 | Internal server error. Error code is InternalServerError. | Error |
InvokeFunction
POST /services/{serviceName}/functions/{functionName}/invocations
POST /services/{serviceName}.{qualifier}/functions/{functionName}/invocations
Description
Run function synchronously or asynchronously
Parameters
Type | Name | Description | Schema | Default |
---|---|---|---|---|
Header | Host required |
Host name, $account-id.$region.fc.aliyuncs.com | string | |
Header | X-Fc-Invocation-Type optional |
Invocation type, Sync, or Async. Defaults to Sync. | string | "Sync" |
Path | functionName required |
Function name | string | |
Path | serviceName required |
Service name | string | |
Path | qualifier optional |
service version, can be versionId or aliasName | string | |
Body | body required |
Event, binary type. This value is passed to function without any transformation. It’s function’s responsibility to interpret the value. | object |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | Successfully invoked function synchronously. Headers : X-Fc-Error-Type (string) : Error type, including HandledInvocationError and UnhandledInvocationError. |
InvokeResponse |
202 | The async invocation request has been accepted, and the corresponding function is invoked as soon as possible. | No Content |
403 | Denied requests. Error code is AccessDenied, InvalidAccessKeyId, SignatureNotMatch, and RequestTimeTooSkewed. | Error |
404 | Service, function, version or alias does not exist. Error code is ServiceNotFound, FunctionNotFound, VersionNotFound, AliasNotFound. | Error |
500 | Internal server error. Error code is InternalServerError. | Error |
ListFunctions
GET /services/{serviceName}/functions
GET /services/{serviceName}.{qualifier}/functions
Description
Retrieve function records
Parameters
Type | Name | Description | Schema | Default |
---|---|---|---|---|
Header | Host required |
Host name, $account-id.$region.fc.aliyuncs.com | string | |
Path | serviceName required |
Service name | string | |
Path | qualifier optional |
service version, can be versionId or aliasName | string | |
Query | limit optional |
Limits the number of returned resource records. Defaults to 20 and cannot exceed 100. | integer (int32) | 20 |
Query | nextToken optional |
Is used to query more resource records. The token is included in the List API response. | string | |
Query | prefix optional |
Limits the resource names that begin with the specified prefix. | string | |
Query | startKey optional |
Specifies the resource name where to start the query. | string |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | Successfully retrieved functions | Response 200 |
400 | Invalid arguments. Error code is InvalidArgument. | Error |
403 | Denied requests. Error code is AccessDenied, InvalidAccessKeyId, SignatureNotMatch, and RequestTimeTooSkewed. | Error |
404 | Service, version or alias does not exist. Error code is ServiceNotFound, VersionNotFound and AliasNotFound. | Error |
500 | Internal server error. Error code is InternalServerError. | Error |
Name | Schema |
---|---|
functions optional |
< functions > array |
nextToken optional |
NextToken |
Name | Description | Schema |
---|---|---|
codeChecksum optional |
The checksum (crc64) of the function code. Example : "5434025278388143772" |
string |
codeSize optional |
The size of the function code, in bytes. Example : 1024 |
integer (int64) |
createdTime optional |
The UTC time string indicating the time the function was created Example : "2016-08-15T15:00:00.000+0000" |
string |
description optional |
Example : "This is a demo hello world function." |
string |
functionId optional |
A unique id generated by Function Compute to identify a function. Example : "2d28e0e9-9ba5-4eed-8b1a-d3d9cd24e737" |
string |
functionName optional |
Example : "helloworld" |
string |
handler optional |
The function execution entry point. Example : "hello_world.main" |
string |
lastModifiedTime optional |
The UTC time string indicating the last time the function was updated Example : "2016-08-15T17:00:00.000+0000" |
string |
memorySize optional |
The amount of memory that’s used to run function, in MB. Function Compute uses this value to allocate CPU resources proportionally. Example : 512 |
integer (int32) |
runtime optional |
The function runtime environment. Supporting nodejs6, nodejs8, python2.7, python3, java8 Example : "nodejs4.4" |
string |
timeout optional |
The maximum time duration a function can run, in seconds. After which Function Compute terminites the execution. Example : 10 |
integer (int32) |
ListServices
GET /services
Description
Retrieve service records
Parameters
Type | Name | Description | Schema | Default |
---|---|---|---|---|
Header | Host required |
Host name, $account-id.$region.fc.aliyuncs.com | string | |
Query | limit optional |
Limits the number of returned resource records. Defaults to 20 and cannot exceed 100. | integer (int32) | 20 |
Query | nextToken optional |
Is used to query more resource records. The token is included in the List API response. | string | |
Query | prefix optional |
Limits the resource names that begin with the specified prefix. | string | |
Query | startKey optional |
Specifies the resource name where to start the query. | string |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | Successfully retrieved services | Response 200 |
400 | Invalid arguments. Error code is InvalidArgument. | Error |
403 | Denied requests. Error code is AccessDenied, InvalidAccessKeyId, SignatureNotMatch, and RequestTimeTooSkewed. | Error |
500 | Internal server error. Error code is InternalServerError. | Error |
Name | Schema |
---|---|
nextToken optional |
NextToken |
services optional |
< services > array |
Name | Description | Schema |
---|---|---|
createdTime optional |
The UTC time string indicating the time the service was created. Example : "2016-08-15T16:06:05.000+0000" |
string |
description optional |
Service description Example : "This is a demo service." |
string |
internetAccess optional |
Set it to true to enable Internet access. Example : true |
boolean |
lastModifiedTime optional |
The UTC time string indicating the last time the function was updated Example : "2016-08-16T18:00:00.000+0000" |
string |
logConfig optional |
Log configuration. Function Compute pushes function execution logs to the configured log store. | LogConfig |
role optional |
The role grants Function Compute the permission to access user’s cloud resources, such as pushing logs to user’s log store. The temporary STS token generated from this role can be retrieved from function context and used to access cloud resources. Example : "acs:ram::1234567890:role/fc-test" |
string |
serviceId optional |
A unique id generated by Function Compute to identify a service. Example : "2d28e0e9-9ba5-4eed-8b1a-d3d9cd24e737" |
string |
serviceName optional |
Example : "demo-service" |
string |
vpcConfig optional |
VPC configuration. Function Compute uses the config to setup ENI in the specific VPC. | VPCConfig |
ListTriggers
GET /services/{serviceName}/functions/{functionName}/triggers
Description
Retrieve trigger records
Parameters
Type | Name | Description | Schema | Default |
---|---|---|---|---|
Header | Host required |
Host name, $account-id.$region.fc.aliyuncs.com | string | |
Path | functionName required |
Function name | string | |
Path | serviceName required |
Service name | string | |
Query | limit optional |
Limits the number of returned resource records. Defaults to 20 and cannot exceed 100. | integer (int32) | 20 |
Query | nextToken optional |
Is used to query more resource records. The token is included in the List API response. | string | |
Query | prefix optional |
Limits the resource names that begin with the specified prefix. | string | |
Query | startKey optional |
Specifies the resource name where to start the query. | string |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | Successfully retrieved functions | Response 200 |
400 | Invalid arguments. Error code is InvalidArgument. | Error |
403 | Denied requests. Error code is AccessDenied, InvalidAccessKeyId, SignatureNotMatch, and RequestTimeTooSkewed. | Error |
404 | Service or function does not exist. Error code is ServiceNotFound and FunctionNotFound. | Error |
500 | Internal server error. Error code is InternalServerError. | Error |
Name | Schema |
---|---|
nextToken optional |
NextToken |
triggers optional |
< TriggerResponse > array |
ListVersions
GET /services/{serviceName}/versions
Description
Retrieve version records
Parameters
Type | Name | Description | Schema | Default |
---|---|---|---|---|
Header | Host required |
Host name:$account-id.$region.fc.aliyuncs.com | string | |
Path | serviceName required |
service name | string | |
Query | limit optional |
Limits the number of returned resource records. Defaults to 20 and cannot exceed 100. | integer (int32) | 20 |
Query | nextToken optional |
Is used to query more resource records. The token is included in the List API response. | string | |
Query | startKey optional |
Specifies the version id where to start the query. | string | |
Query | direction optional |
Specifies list direction | string | BACKWARD |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | Successfully retrieved versions | Response 200 |
400 | Invalid arguments. Error code is InvalidArgument. | Error |
403 | Denied requests. Error code is AccessDenied, InvalidAccessKeyId, SignatureNotMatch, and RequestTimeTooSkewed. | Error |
404 | Service does not exist. Error code is ServiceNotFound. | Error |
500 | Internal server error. Error code is InternalServerError. | Error |
Name | Schema |
---|---|
nextToken optional |
NextToken |
versions optional |
< VersionResponse > array |
direction optional |
string |
ListAliases
GET /services/{serviceName}/aliases
Description
Retrieve alias records
Parameters
Type | Name | Description | Schema | Default |
---|---|---|---|---|
Header | Host required |
Host name:$account-id.$region.fc.aliyuncs.com | string | |
Path | serviceName required |
service name | string | |
Query | limit optional |
Limits the number of returned resource records. Defaults to 20 and cannot exceed 100. | integer (int32) | 20 |
Query | nextToken optional |
Is used to query more resource records. The token is included in the List API response. | string | |
Query | prefix optional |
Limits the resource names that begin with the specified prefix. | string | |
Query | startKey optional |
Specifies the resource name where to start the query. | string |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | Successfully retrieved aliases | Response 200 |
400 | Invalid arguments. Error code is InvalidArgument. | Error |
403 | Denied requests. Error code is AccessDenied, InvalidAccessKeyId, SignatureNotMatch, and RequestTimeTooSkewed. | Error |
404 | Service does not exist. Error code is ServiceNotFound. | Error |
500 | Internal server error. Error code is InternalServerError. | Error |
Name | Schema |
---|---|
nextToken optional |
NextToken |
aliases optional |
< AliasResponse > array |
UpdateFunction
PUT /services/{serviceName}/functions/{functionName}
Description
Update the function
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | Host required |
Host name, $account-id.$region.fc.aliyuncs.com | string |
Header | If-Match optional |
Guarantees the resource that’s to be updated is the requested one. The value is included in the Create/Get/Update Service/Function/Trigger API response. | string |
Path | functionName required |
Function name | string |
Path | serviceName required |
Service name | string |
Body | function required |
Function object that’s to be updated | FunctionUpdateFields |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | Successfully updated function Headers : ETag (string) : Guarantees that the function that is updated or deleted matches the etag. |
FunctionResponse |
400 | Invalid arguments. Error code is InvalidArgument. | Error |
403 | Denied requests. Error code is AccessDenied, InvalidAccessKeyId, SignatureNotMatch, and RequestTimeTooSkewed. | Error |
404 | Service or function does not exist. Error code is ServiceNotFound and FunctionNotFound. | Error |
500 | Internal server error. Error code is InternalServerError. | Error |
UpdateService
PUT /services/{serviceName}
Description
Update the service
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | Host required |
Host name, $account-id.$region.fc.aliyuncs.com | string |
Header | If-Match optional |
Guarantees the resource that’s to be updated is the requested one. The value is included in the Create/Get/Update Service/Function/Trigger API response. | string |
Path | serviceName required |
Service name | string |
Body | body required |
Service object that is to be updated. | ServiceUpdateFields |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | Successfully updated the service Headers : ETag (string) : Guarantees that the service that is updated or deleted matches the etag. |
ServiceResponse |
400 | Invalid arguments. Error code is InvalidArgument. | Error |
403 | Denied requests. Error code is AccessDenied, InvalidAccessKeyId, SignatureNotMatch, and RequestTimeTooSkewed. | Error |
404 | Service does not exist. Error code is ServiceNotFound. | Error |
500 | Internal server error. Error code is InternalServerError. | Error |
UpdateTrigger
PUT /services/{serviceName}/functions/{functionName}/triggers/{triggerName}
Description
Update the trigger
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | Host required |
Host name, $account-id.$region.fc.aliyuncs.com | string |
Header | If-Match optional |
Guarantees the resource that’s to be updated is the requested one. The value is included in the Create/Get/Update Service/Function/Trigger API response. | string |
Path | functionName required |
Function name | string |
Path | serviceName required |
Service name | string |
Path | triggerName required |
Trigger name | string |
Body | body required |
Trigger object that is to be updated. | TriggerUpdateFields |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | Successfully updated the trigger Headers : ETag (string) : Guarantees that the trigger that is updated or deleted matches the etag. |
TriggerResponse |
400 | Invalid arguments. Error code is InvalidArgument. | Error |
403 | Denied requests. Error code is AccessDenied, InvalidAccessKeyId, SignatureNotMatch, and RequestTimeTooSkewed. | Error |
404 | Service, function, or trigger does not exist. Error code is ServiceNotFound, FunctionNotFound, and TriggerNotFound. | Error |
500 | Internal server error. Error code is InternalServerError. | Error |
UpdateAlias
PUT /services/{serviceName}/aliases/{aliasName}
Description
Update the alias
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | Host required |
Host name:$account-id.$region.fc.aliyuncs.com | string |
Header | If-Match optional |
Guarantees the resource that’s to be updated is the requested one. The value is included in the Create/Get/Update Alias API response | string |
Path | serviceName required |
service name | string |
Path | aliasName required |
alias name | string |
Body | alias required |
alias object that is to be updated. | AliasUpdateFields |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | Successfully updated the alias Headers : ETag (string) : alias etag, Guarantees that the alias that is updated or deleted matches the etag. |
AliasResponse |
400 | Invalid arguments. Error code is InvalidArgument. | Error |
403 | Denied requests. Error code is AccessDenied, InvalidAccessKeyId, SignatureNotMatch, and RequestTimeTooSkewed. | Error |
404 | aliase or version does not exist,Error coase is AliasNotFound,VersionNotFound | Error |
409 | alias is operated by other thread,Error code is ConcurrentUpdateError | Error |
500 | Internal server error. Error code is InternalServerError. | Error |
createCustomDomain:
POST /custom-domains
Request:
Type | Name | Description | Schema |
---|---|---|---|
Header | Host(required) | Host name: $account-id.$region.fc.aliyuncs.com | string |
Body | body(required) | CustomDomainConfig object | CustomDomainConfig |
Response:
HTTP Code | Description | Schema |
---|---|---|
200 | Successful | CustomDomainResponse |
400 | Invalid arguments. Error code is in [ InvalidArgument, LimitExceededError, DomainNameNotResolved ]. | Error |
403 | AccessDenied, InvalidAccessKeyId, SignatureNotMatch | Error |
409 | CustomDomainAlreadyExists | Error |
500 | InternalServerError | Error |
updateCustomDomain
PUT /custom-domains/{CustomDomain}
Request:
Type | Name | Description | Schema |
---|---|---|---|
Header | Host(required) | Host name: $account-id.$region.fc.aliyuncs.com | string |
Path | CustomDomain(required) | domain name | string |
Body | body(required) | CustomDomainConfig object | CustomDomainConfig |
Response:
HTTP Code | Description | Schema |
---|---|---|
200 | Successful | CustomDomainResponse |
400 | InvalidArgument | Error |
403 | AccessDenied, InvalidAccessKeyId, SignatureNotMatch | Error |
404 | CustomDomainNotFound | Error |
409 | CustomDomainAlreadyExist, ConcurrentUpdateError | Error |
500 | InternalServerError | Error |
getCustomDomain
GET /custom-domains/{domainaName}
Request:
Type | Name | Description | Schema |
---|---|---|---|
Header | Host(required) | Host name: $account-id.$region.fc.aliyuncs.com | string |
Path | CustomDomain(required) | domain name | string |
Response:
HTTP Code | Description | Schema |
---|---|---|
200 | Successful | CustomDomainResponse |
400 | InvalidArgument | Error |
403 | AccessDenied, InvalidAccessKeyId, SignatureNotMatch | Error |
404 | CustomDomainNotFound | Error |
500 | InternalServerError | Error |
listCustomDomain
GET /custom-domains
Request:
Type | Name | Description | Schema |
---|---|---|---|
Header | Host(required) | Host name: $account-id.$region.fc.aliyuncs.com | string |
Query | limit(optional) | Limits the number of returned resource records. Defaults to 20 and cannot exceed 100. | integer (int32) |
Query | nextToken(optional) | Is used to query more resource records. The token is included in the List API response. | string |
Query | prefix(optional) | Limits the resource names that begin with the specified prefix. | string |
Query | startKey(optional) | Specifies the resource name where to start the query. | string |
Response:
HTTP Code | Description | Schema |
---|---|---|
200 | Successful | CustomDomainResponse |
400 | InvalidArgument | Error |
403 | AccessDenied, InvalidAccessKeyId, SignatureNotMatch | Error |
500 | InternalServerError | Error |
deleteCustomDomain
DELETE /custom-domains/{domainaName}
Request:
Type | Name | Description | Schema |
---|---|---|---|
Header | Host(required) | Host name: $account-id.$region.fc.aliyuncs.com | string |
Path | CustomDomain(required) | domain name | string |
Response:
HTTP Code | Description | Schema |
---|---|---|
204 | Successful | No Content |
400 | InvalidArgument | Error |
403 | AccessDenied, InvalidAccessKeyId, SignatureNotMatch | Error |
404 | CustomDomainNotFound | Error |
500 | InternalServerError | Error |
putProvisionConfig:
PUT /services/{ServiceName}.{Qualifier}/functions/{FunctionName}/provision-config
Request:
Type | Name | Description | Schema |
---|---|---|---|
Header | Host(required) | Host name: $account-id.$region.fc.aliyuncs.com | string |
Header | If-Match optional |
Guarantees the resource that’s to be updated is the requested one. The value is included in the Put/Get Provision Config API response. | string |
Path | serviceName required |
service name | string |
Path | qualifier required |
alias name | string |
Path | functionName required |
function name | string |
Body | body required |
put provision target fields | PutProvisionConfigFields |
Response:
HTTP Code | Description | Schema |
---|---|---|
200 | Success Headers : ETag (string) : provision config etag, Guarantees that the provision config that is updated matches the etag |
ProvisionTargetResponse |
400 | Invalid request,Error code:InvalidArgument | Error |
403 | Denied request. Error code: AccessDenied, InvalidAccessKeyId, SignatureNotMatch | Error |
412 | Unmatched Etag,Error code: PreconditionFailed | Error |
500 | Internal server error, Error code: InternalServerError | Error |
getProvisionConfig
GET /services/{ServiceName}.{Qualifier}/functions/{FunctionName}/provision-config
Request:
Type | Name | Description | Schema |
---|---|---|---|
Header | Host(required) | Host name: $account-id.$region.fc.aliyuncs.com | string |
Path | serviceName required |
service name | string |
Path | qualifier required |
alias name | string |
Path | functionName required |
function name | string |
Response:
HTTP Code | Description | Schema |
---|---|---|
200 | Success Headers : ETag (string) : provision config etag, Guarantees that the provision config that is get matches the etag |
ProvisionConfigResponse |
400 | Invalid request,Error code:InvalidArgument | Error |
403 | Denied request. Error code :AccessDenied, InvalidAccessKeyId, SignatureNotMatch | Error |
500 | Internal server error, Error code:InternalServerError | Error |
listProvisionConfigs
GET /provision-configs
Request:
Type | Name | Description | Schema |
---|---|---|---|
Header | Host(required) | Host name: $account-id.$region.fc.aliyuncs.com | string |
Query | limit(optional) | Limits the number of returned resource records. Defaults to 20 and cannot exceed 100. | integer (int32) |
Query | nextToken(optional) | Is used to query more resource records. The token is included in the List API response. | string |
Query | serviceName(optional) | Limits the resource names that belongs to the service name. | string |
Query | qualifier(optional) | Limits the resource names that belongs to the qualifier. Qualifier can only be aliasName,must provide serviceName if qualified is provided | string |
Response:
HTTP Code | Description | Schema |
---|---|---|
200 | Success | Response 200 |
400 | Invalid request,Error code:InvalidArgument | Error |
403 | Denied request,Error code:AccessDenied, InvalidAccessKeyId, SignatureNotMatch | Error |
500 | Internal server error,Error code:InternalServerError | Error |
Name | Schema |
---|---|
provisionConfigs optional |
< ProvisionConfigResponse > array |
nextToken optional |
NextToken |
Definitions
Code
Provides two ways to upload code 1. By specifying the OSS BucketName and ObjectName 2. By specifying zipFile with base64 encoded zip file content.
Name | Description | Schema |
---|---|---|
ossBucketName optional |
OSS bucket name | string |
ossObjectName optional |
OSS object name | string |
zipFile optional |
Base64 encoded zip file content | string |
Error
Error
Name | Description | Schema |
---|---|---|
errorCode optional |
Error code | string |
errorMessage optional |
Error message | string |
Function
Name | Description | Schema |
---|---|---|
code required |
The code that contains the function implementation. | Code |
description optional |
string | |
functionName required |
Function name | string |
handler required |
The function execution entry point. | string |
memorySize optional |
The amount of memory that’s used to run function, in MB. Function Compute uses this value to allocate CPU resources proportionally. Defaults to 128 MB. It can be multiple of 64 MB and between 128 MB and 3072 MB. | integer |
runtime required |
The function runtime environment. Supporting nodejs6, nodejs8, python2.7, python3, java8 | string |
timeout optional |
The maximum time duration a function can run, in seconds. After which Function Compute terminates the execution. Defaults to 3 seconds, and can be between 1 to 300 seconds. | integer |
FunctionCodeResponse
Name | Description | Schema |
---|---|---|
checksum optional |
crc64 checksum Example : "1234567890" |
string |
url optional |
A pre-signed OSS URL that can be used to download function code. Example : "http://func-code.oss-cn-shanghai.aliyuncs.com/1a2b3c4d5e6f" |
string |
FunctionResponse
Name | Description | Schema |
---|---|---|
codeChecksum optional |
The checksum (crc64) of the function code. Example : "5434025278388143772" |
string |
codeSize optional |
The size of the function code, in bytes. Example : 1024 |
integer (int64) |
createdTime optional |
The UTC time string indicating the time the function was created Example : "2016-08-15T15:00:00.000+0000" |
string |
description optional |
Example : "This is a demo hello world function." |
string |
functionId optional |
A unique id generated by Function Compute to identify a function. Example : "2d28e0e9-9ba5-4eed-8b1a-d3d9cd24e737" |
string |
functionName optional |
Function Name Example : "helloworld" |
string |
handler optional |
The function execution entry point. Example : "hello_world.main" |
string |
lastModifiedTime optional |
The UTC time string indicating the last time the function was updated Example : "2016-08-15T17:00:00.000+0000" |
string |
memorySize optional |
The amount of memory that’s used to run function, in MB. Function Compute uses this value to allocate CPU resources proportionally. Example : 512 |
integer (int32) |
runtime optional |
The function runtime environment. Supporting nodejs6, nodejs8, python2.7, python3, java8. Example : "nodejs4.4" |
string |
timeout optional |
The maximum time duration a function can run, in seconds. After which Function Compute terminates the execution. Example : 10 |
integer (int32) |
FunctionUpdateFields
Function update fields
Name | Description | Schema |
---|---|---|
code optional |
The code that contains the function implementation. | Code |
description optional |
string | |
handler optional |
The function execution entry point. | string |
memorySize optional |
The amount of memory that’s used to run function, in MB. Function Compute uses this value to allocate CPU resources proportionally. Defaults to 128 MB. It can be multiple of 64 MB and between 128 MB and 3072 MB. | integer |
runtime optional |
The function runtime environment. Supporting nodejs6, nodejs8, python2.7, python3, java8 | string |
timeout optional |
The maximum time duration function can run, in seconds. After which Function Compute terminates the execution. Defaults to 3 seconds, and can be between 1 to 300 seconds. | integer |
InvokeResponse
The response of run function. It’s in binary format. Users can interpret the data according to their function implementation.
Type : binary
LogConfig
Log configuration
Name | Description | Schema |
---|---|---|
logstore optional |
The log store name of Logs service | string |
project optional |
The project name of Logs service | string |
NextToken
Is used to query more resource records.
Type : string
Service
Service resource
Name | Description | Schema |
---|---|---|
description optional |
Service description | string |
internetAccess optional |
Set it to true to enable Internet access. Example : true |
Boolean |
logConfig optional |
Log configuration. Function Compute pushes function execution logs to the configured log store. | LogConfig |
role optional |
The role grants Function Compute the permission to access user’s cloud resources, such as pushing logs to user’s log store. The temporary STS token generated from this role can be retrieved from function context and used to access cloud resources. Example : "acs:ram::1234567890:role/fc-test" |
string |
serviceName required |
Service name | string |
vpcConfig optional |
VPC configuration. Function Compute uses the config to setup ENI in the specific VPC. | VPCConfig |
nasConfig optional |
NAS configuration. Function Compute uses a specified NAS configured on the service. | NASConfig |
ServiceResponse
Name | Description | Schema |
---|---|---|
createdTime optional |
The UTC time string indicating the time the service was created Example : "2016-08-15T16:06:05.000+0000" |
string |
description optional |
Service description Example : "This is a demo service." |
string |
internetAccess optional |
Set it to true to enable Internet access. Example : true |
Boolean |
lastModifiedTime optional |
The UTC time string indicating the last time the service was updated Example : "2016-08-16T18:00:00.000+0000" |
string |
logConfig optional |
Log configuration. Function Compute pushes function execution logs to the configured log store. | LogConfig |
role optional |
The role grants Function Compute the permission to access user’s cloud resources, such as pushing logs to user’s log store. The temporary STS token generated from this role can be retrieved from function context and used to access cloud resources. Example : "acs:ram::1234567890:role/fc-test" |
string |
serviceId optional |
A unique id generated by Function Compute to identify a service. Example : "2d28e0e9-9ba5-4eed-8b1a-d3d9cd24e737" |
string |
serviceName optional |
Example : "demo-service" |
string |
vpcConfig optional |
VPC configuration. Function Compute uses the config to setup ENI in the specific VPC. | VPCConfig |
nasConfig optional |
NAS configuration. Function Compute uses a specified NAS configured on the service. | NASConfig |
ServiceUpdateFields
Service resource that can be updated.
Name | Description | Schema |
---|---|---|
description optional |
string | |
internetAccess optional |
Set it to true to enable Internet access. Example : true |
boolean |
logConfig optional |
Log configuration. Function Compute pushes function execution logs to the configured log store. | LogConfig |
role optional |
The role grants Function Compute the permission to access user’s cloud resources, such as pushing logs to user’s log store. The temporary STS token generated from this role can be retrieved from function context and used to access cloud resources. Example : "acs:ram::1234567890:role/fc-test" |
string |
vpcConfig optional |
VPC configuration. Function Compute uses the config to setup ENI in the specific VPC. | VPCConfig |
nasConfig optional |
NAS configuration. Function Compute uses a specified NAS configured on the service. | NASConfig |
Trigger
Name | Description | Schema |
---|---|---|
invocationRole required |
The role grants event source the permission to run function on behalf of user. This is optional for some triggers. Example : "acs:ram::1234567890:role/fc-test" |
string |
sourceArn required |
The Aliyun Resource Name (ARN) of event source. This is optional for some triggers. Example : "acs:oss:cn-shanghai:12345:mybucket" |
string |
triggerConfig required |
Event source specific trigger configuration. The value is different according to trigger type. | object |
triggerName required |
Trigger name Example : "image_resize" |
string |
triggerType required |
Trigger type, e.g. oss, timer, logs. This determines how the trigger config is interpreted. Example : "oss" |
string |
qualifier optional |
service version or alias Example : "LATEST" |
string |
TriggerResponse
Name | Description | Schema |
---|---|---|
createdTime optional |
The UTC time string indicating the time the trigger was created Example : "2016-08-15T15:00:00.000+0000" |
string |
invocationRole optional |
string | |
lastModifiedTime optional |
The UTC time string indicating the last time the trigger was updated Example : "2016-08-15T17:00:00.000+0000" |
string |
sourceArn optional |
string | |
triggerConfig optional |
object | |
triggerName optional |
string | |
triggerType optional |
string | |
qualifier optional |
string |
TriggerUpdateFields
Name | Description | Schema |
---|---|---|
invocationRole optional |
The role grants event source the permission to run function on behalf of user. This is optional for some triggers. Example : "acs:ram::1234567890:role/fc-test" |
string |
triggerConfig optional |
Event source specific trigger configuration. The value is different according to trigger type. | object |
qualifier optional |
service version or alias Example : "LATEST" |
string |
VPCConfig
VPC configuration
Name | Description | Schema |
---|---|---|
securityGroupId required |
Security group ID | string |
vSwitchIds required |
List of VSwitch IDs | < string > array |
vpcId required |
VPC ID | string |
NASConfig
NAS configuration
Name | Description | Schema |
---|---|---|
userId required |
userID | string |
groupId required |
groupID | string |
mountPoints required |
A mount point | < MountPoint > array |
MountPoint
Mount point
Name | Description | Schema |
---|---|---|
serverAddr required |
The address of NAS instance. | string |
mountDir required |
A local mount point. | string |
CustomDomainConfig
Name | Description | Schema |
---|---|---|
DomainName(required) | domain name | string |
Protocol(required) | HTTP or HTTP,HTTPS | string |
ApiVersion(optional) | api version | string |
RouteConfig(optional) | Routing table: path to function mapping when a function is called with a custom domain name | RouteConfig |
CertConfig(optional) | certificate info | CertConfig |
RouteConfig
Name | Description | Schema |
---|---|---|
Routes(required) | PathConfig Array | PathConfig Array |
PathConfig
Name | Description | Schema |
---|---|---|
path(required) | HTTP request path when a function is called with a custom domain name, for example: “/login/*” | string |
serviceName(required) | Path to the service, for example: “blogService” | string |
functionName(required) | Path to the function, for example: “login” | string |
CertConfig
Name | Description | Schema |
---|---|---|
certName(required) | custom certificate name | string |
privateKey(required) | privateKey | string |
certificate(required) | certificate | string |
CustomDomainResponse
Name | Description | Schema |
---|---|---|
CreatedTime | The UTC time string indicating the time the domain was created | string |
LastModifiedTime | The UTC time string indicating the last time the domain was updated | string |
CustomDomain | domain name | string |
Protocol | protocol | string |
ApiVersion | api version | string |
RouteConfig | route config | RouteConfig |
CertConfig(optional) | certificate info | CertConfig |
Version
Name | Description | Schema |
---|---|---|
versionId required |
service version id Example : "1" |
string |
description optional |
version description Example : "my service version" |
string |
VersionResponse
Name | Description | Schema |
---|---|---|
createdTime optional |
The UTC time string indicating the time the version was published Example : "2016-08-15T15:00:00.000+0000" |
string |
lastModifiedTime optional |
The UTC time string indicating the last time the version was updated Example : "2016-08-15T17:00:00.000+0000" |
string |
versionId optional |
string | |
description optional |
string |
Alias
Name | Description | Schema |
---|---|---|
aliasName required |
alias name Example : "my-alias" |
string |
versionId required |
version id referred by alias Example : "1" |
string |
description optional |
alias description | object |
additionalVersionWeight optional |
additional version and traffic weight Example : "2:0.05" |
map |
AliasResponse
Name | Description | Schema |
---|---|---|
createdTime required |
The UTC time string indicating the time the alias was created Example : "2016-08-15T15:00:00.000+0000" |
string |
lastModifiedTime required |
The UTC time string indicating the last time the alias was updated Example : "2016-08-15T17:00:00.000+0000" |
string |
aliasName required |
string | |
versionId required |
string | |
description optional |
string | |
additionalVersionWeight optional |
map |
AliasUpdateFields
Name | Description | Schema |
---|---|---|
versionID required |
version id referred by alias Example : "1" |
string |
description optional |
alias description | object |
additionalVersionWeight optional |
additional version and traffic weight Example : "2:0.05" |
map |
PutProvisionConfigFields
Name | Description | Schema |
---|---|---|
target required |
provision config target count Example : "1" |
integer (int64) |
ProvisionTargetResponse
Name | Description | Schema |
---|---|---|
resource required |
provision config resource Example : "12345#servierName#qualifier#functionName" |
string |
target required |
provision config target count Example : "1" |
integer (int64) |
ProvisionConfigResponse
Name | Description | Schema |
---|---|---|
resource required |
provision config resource Example : "12345#servierName#qualifier#functionName" |
string |
target required |
provision config target count Example : "1" |
integer (int64) |
current required |
provision config current count Example : "1" |
integer (int64) |