开发者社区> 问答> 正文

函数计算的API 定义有哪些?

函数计算的API 定义有哪些?

展开
收起
小天使爱美 2020-03-27 17:49:31 1170 0
1 条回答
写回答
取消 提交回答
  • Aliyun Function Compute API Specification

    Overview Version information Version : 0.1

    URI scheme Host : $account-id.$region.fc.aliyuncs.com

    BasePath : /version,

    version 是指函数计算提供的 api 的版本,即 api-version; 目前的 api-version 为 2016-08-15 。 Schemes : HTTP, HTTPS

    Tags Service : Service相关的操作 Function : Function相关的操作 Trigger : Trigger相关的操作 Version : Version相关的操作 Alias :Alias相关的操作 CustomDomain: CustomDomain相关的操作 ProvisionConfig: ProvisionConfig相关的操作 Consumes application/json Produces application/json

    Resources

    Service Service相关的操作

    CreateService

    ListServices

    GetService

    UpdateService

    DeleteService

    Function Function相关的操作

    CreateFunction

    ListFunctions

    GetFunction

    UpdateFunction

    DeleteFunction

    GetFunctionCode

    InvokeFunction

    Trigger Trigger相关的操作

    CreateTrigger

    ListTriggers

    GetTrigger

    UpdateTrigger

    DeleteTrigger

    Version Version相关的操作

    PublishVersion

    ListVersions

    DeleteVersion

    Alias Alias相关的操作

    CreateAlias

    ListAliases

    GetAlias

    UpdateAlias

    DeleteAlias

    CustomDomain CustomDomain 相关的操作

    CreateCustomDomain

    ListCustomDomain

    GetCustomDomain

    UpdateCustomDomain

    DeleteCustomDomain

    ProvisionConfig ProvisionConfig 相关的操作

    PutProvisionConfig

    GetProvisionConfig

    ListProvisionConfigs

    Tag Tag 相关的操作

    TagResource

    UntagResource

    GetResourceTags

    Operations

    CreateFunction POST /services/{serviceName}/functions Description 创建function

    Parameters Type Name Description Schema Header Host required 访问域名:$account-id.$region.fc.aliyuncs.com string Path serviceName required service名称 string Body body required function对象描述 Function Responses HTTP Code Description Schema 200 创建成功 Headers : ETag (string) : function etag,用于更改function。以确保实际更改的function和期望更改的function是一致的. FunctionResponse 400 请求无效,错误码:InvalidArgument Error 403 拒绝请求,错误码:AccessDenied,InvalidAccessKeyId,SignatureNotMatch,RequestTimeTooSkewed Error 404 service不存在,错误码:ServiceNotFound Error 409 function已存在,错误码:FunctionAlreadyExists Error 500 服务内部错误,错误码:InternalServerError Error

    CreateService POST /services Description 创建service

    Parameters Type Name Description Schema Header Host required 访问域名:$account-id.$region.fc.aliyuncs.com string Body body required service对象描述 Service Responses HTTP Code Description Schema 200 创建成功 Headers : ETag (string) : service etag,用于更改service。以确保实际更改的service和期望更改的service是一致的. ServiceResponse 400 请求无效,错误码:InvalidArgument Error 403 拒绝请求,错误码:AccessDenied,InvalidAccessKeyId,SignatureNotMatch,RequestTimeTooSkewed Error 409 service已存在,错误码:ServiceAlreadyExists Error 500 服务内部错误,错误码:InternalServerError Error

    CreateTrigger POST /services/{serviceName}/functions/{functionName}/triggers Description 创建trigger

    Parameters Type Name Description Schema Header Host required 访问域名:$account-id.$region.fc.aliyuncs.com string Path functionName required function名称 string Path serviceName required service名称 string Body body required trigger对象 Trigger Responses HTTP Code Description Schema 200 创建成功 Headers : ETag (string) : trigger etag,用于更改trigger。以确保实际更改的trigger和期望更改的trigger是一致的. TriggerResponse 400 请求无效,错误码:InvalidArgument Error 403 拒绝请求,错误码:AccessDenied,InvalidAccessKeyId,SignatureNotMatch,RequestTimeTooSkewed Error 404 service或function不存在,错误码:ServiceNotFound,FunctionNotFound Error 409 Trigger already exists. Error code is TriggerAlreadyExists. Error 500 服务内部错误,错误码:InternalServerError Error

    PublishVersion POST /services/{serviceName}/versions Description 发布version

    Parameters Type Name Description Schema Header Host required 访问域名:$account-id.$region.fc.aliyuncs.com string Header If-Match optional 用于确保实际更改的资源和期望更改的资源是一致的,该值来自Create,Get和Update Service API的响应 string Path serviceName required service名称 string Body body optional version描述 string Responses HTTP Code Description Schema 200 发布成功 Headers : ETag (string) : version etag,用以确保实际发布的service和期望发布的version是一致的. VersionResponse 400 请求无效,错误码:InvalidArgument Error 403 拒绝请求,错误码:AccessDenied,InvalidAccessKeyId,SignatureNotMatch,RequestTimeTooSkewed Error 404 service不存在,错误码:ServiceNotFound Error 409 service发布失败,错误码:VersionPublishError, ConcurrentUpdateError Error 500 服务内部错误,错误码:InternalServerError Error

    CreateAlias POST /services/{serviceName}/aliases Description 创建alias

    Parameters Type Name Description Schema Header Host required 访问域名:$account-id.$region.fc.aliyuncs.com string Path serviceName required service名称 string Body body required alias名称 string Body body required versionId string Body body optional alias描述 string Body body optional 灰度发布的版本,以及对应的流量权重 map Responses HTTP Code Description Schema 200 创建成功 Headers : ETag (string) : alias etag,用以确保实际更改的alias和期望更改的alias是一致的. ||400|请求无效,错误码:InvalidArgument|Error||403|拒绝请求,错误码:AccessDenied,InvalidAccessKeyId,SignatureNotMatch,RequestTimeTooSkewed|Error||404|service或者version不存在,错误码:ServiceNotFound,VersionNotFound|Error||409|alias已经存在,错误码:AliasAlreadyExists.|Error||500|服务内部错误,错误码:InternalServerError|Error|

    DeleteFunction DELETE /services/{serviceName}/functions/{functionName} Description 删除function

    Parameters Type Name Description Schema Header Host required 访问域名:$account-id.$region.fc.aliyuncs.com string Header If-Match optional 用于确保实际更改的资源和期望更改的资源是一致的,该值来自Create,Get和Update API的响应 string Path functionName required function名称 string Path serviceName required service名称 string Responses HTTP Code Description Schema 204 删除成功 No Content 400 请求无效,错误码:InvalidArgument Error 403 拒绝请求,错误码:AccessDenied,InvalidAccessKeyId,SignatureNotMatch,RequestTimeTooSkewed Error 404 service或function不存在,错误码:ServiceNotFound,FunctionNotFound Error 409 function非空,包含至少一个trigger,错误码:FunctionNotEmpty; 多个线程同时删除,错误码:ConcurrentUpdateError Error 500 服务内部错误,错误码:InternalServerError Error

    DeleteService DELETE /services/{serviceName} Description 删除service

    Parameters Type Name Description Schema Header Host required 访问域名:$account-id.$region.fc.aliyuncs.com string Header If-Match optional 用于确保实际更改的资源和期望更改的资源是一致的,该值来自Create,Get和Update API的响应 string Path serviceName required service名称 string Responses HTTP Code Description Schema 204 删除成功 No Content 400 请求无效,错误码:InvalidArgument Error 403 拒绝请求,错误码:AccessDenied,InvalidAccessKeyId,SignatureNotMatch,RequestTimeTooSkewed Error 404 service不存在,错误码:ServiceNotFound Error 409 service非空,错误码:ServiceNotEmpty; 多个线程同时删除,错误码:ConcurrentUpdateError Error 500 服务内部错误,错误码:InternalServerError Error

    DeleteTrigger DELETE /services/{serviceName}/functions/{functionName}/triggers/{triggerName} Description 删除trigger

    Parameters Type Name Description Schema Header Host required 访问域名:$account-id.$region.fc.aliyuncs.com string Header If-Match optional 用于确保实际更改的资源和期望更改的资源是一致的,该值来自Create,Get和Update API的响应 string Path functionName required function名称 string Path serviceName required service名称 string Path triggerName required trigger名称 string Responses HTTP Code Description Schema 204 删除成功 No Content 400 请求无效,错误码:InvalidArgument Error 403 拒绝请求,错误码:AccessDenied,InvalidAccessKeyId,SignatureNotMatch,RequestTimeTooSkewed Error 404 service,function,trigger不存在,错误码:ServiceNotFound,FunctionNotFound,TriggerNotFound Error 409 多个线程同时删除,错误码:ConcurrentUpdateError Error 500 服务内部错误,错误码:InternalServerError Error

    DeleteVersion DELETE /services/{serviceName}/versions/{versionId} Description 删除version

    Parameters Type Name Description Schema Header Host required 访问域名:$account-id.$region.fc.aliyuncs.com string Path serviceName required service名称 string Path versionId required versionId string Responses HTTP Code Description Schema 204 删除成功 No Content 400 请求无效,错误码:InvalidArgument Error 403 拒绝请求,错误码:AccessDenied,InvalidAccessKeyId,SignatureNotMatch,RequestTimeTooSkewed Error 404 version不存在,错误码:VersionNotFound Error 409 多个线程同时删除,错误码:ConcurrentUpdateError Error 500 服务内部错误,错误码:InternalServerError Error

    DeleteAlias DELETE /services/{serviceName}/aliases/{aliasName} Description 删除alias

    Parameters Type Name Description Schema Header Host required 访问域名:$account-id.$region.fc.aliyuncs.com string Header If-Match optional 用于确保实际更改的资源和期望更改的资源是一致的,该值来自Create,Get和Update Alias API的响应 string Path serviceName required service名称 string Path aliasName required alias名称 string Responses HTTP Code Description Schema 204 删除成功 No Content 400 请求无效,错误码:InvalidArgument Error 403 拒绝请求,错误码:AccessDenied,InvalidAccessKeyId,SignatureNotMatch,RequestTimeTooSkewed Error 404 alias不存在,错误码:AliasNotFound Error 409 多个线程同时删除,错误码:ConcurrentUpdateError Error 500 服务内部错误,错误码:InternalServerError Error

    GetFunction GET /services/{serviceName}/functions/{functionName} GET /services/{serviceName}.{qualifier}/functions/{functionName} Description 获取function信息

    Parameters Type Name Description Schema Header Host required 访问域名:$account-id.$region.fc.aliyuncs.com string Path functionName required function名称 string Path serviceName required service名称 string Path qualifier optional service版本, 可以是versionId或者aliasName string Responses HTTP Code Description Schema 200 请求成功 Headers : ETag (string) : function etag,用于更改function。以确保实际更改的function和期望更改的function是一致的. FunctionResponse 400 请求无效,错误码:InvalidArgument Error 403 拒绝请求,错误码:AccessDenied,InvalidAccessKeyId,SignatureNotMatch,RequestTimeTooSkewed Error 404 service,function,alias或者version不存在,错误码:ServiceNotFound,FunctionNotFound,VersionNotFound,AliasNotFound Error 500 服务内部错误,错误码:InternalServerError Error

    GetFunctionCode GET /services/{serviceName}/functions/{functionName}/code GET /services/{serviceName}.{qualifier}/functions/{functionName}/code Description 获取Function代码

    Parameters Type Name Description Schema Header Host required 访问域名:$account-id.$region.fc.aliyuncs.com string Path functionName required function名称 string Path serviceName required service名称 string Path qualifier optional service版本, 可以是versionId或者aliasName string Responses HTTP Code Description Schema 200 请求成功 FunctionCodeResponse 403 拒绝请求,错误码:AccessDenied,InvalidAccessKeyId,SignatureNotMatch,RequestTimeTooSkewed Error 404 service,function,alias或者version不存在,错误码:ServiceNotFound,FunctionNotFound,VersionNotFound,AliasNotFound Error 500 服务内部错误,错误码:InternalServerError Error

    GetService GET /services/{serviceName} GET /services/{serviceName}.{qualifier} Description 获取service信息

    Parameters Type Name Description Schema Header Host required 访问域名:$account-id.$region.fc.aliyuncs.com string Path serviceName required service名称 string Path qualifier optional service版本, 可以是versionId或者aliasName string Responses HTTP Code Description Schema 200 请求成功 Headers : ETag (string) : service etag,用于更改service。以确保实际更改的service和期望更改的service是一致的. ServiceResponse 400 请求无效,错误码:InvalidArgument Error 403 拒绝请求,错误码:AccessDenied,InvalidAccessKeyId,SignatureNotMatch,RequestTimeTooSkewed Error 404 service,alias或者version不存在,错误码:ServiceNotFound,VersionNotFound,AliasNotFound Error 500 服务内部错误,错误码:InternalServerError Error

    GetAlias GET /services/{serviceName}/aliases/{aliasName} Description 获取alias信息

    Parameters Type Name Description Schema Header Host required 访问域名:$account-id.$region.fc.aliyuncs.com string Header If-Match optional 用于确保实际更改的资源和期望更改的资源是一致的,该值来自Create,Get和Update Alias API的响应 string Path serviceName required service名称 string Path aliasName required alias名称 string Responses HTTP Code Description Schema 200 请求成功 Headers : ETag (string) : alias etag,用于更改alias。以确保实际更改的alias和期望更改的alias是一致的. AliasResponse 400 请求无效,错误码:InvalidArgument Error 403 拒绝请求,错误码:AccessDenied,InvalidAccessKeyId,SignatureNotMatch,RequestTimeTooSkewed Error 404 alias不存在,错误码:AliasNotFound Error 409 多个线程同时更新,错误码:ConcurrentUpdateError Error 500 服务内部错误,错误码:InternalServerError Error

    GetTrigger GET /services/{serviceName}/functions/{functionName}/triggers/{triggerName} Description 获取trigger信息

    Parameters Type Name Description Schema Header Host required 访问域名:$account-id.$region.fc.aliyuncs.com string Path functionName required function名称 string Path serviceName required service名称 string Path triggerName required trigger名称 string Responses HTTP Code Description Schema 200 请求成功 Headers : ETag (string) : trigger etag,用于更改trigger。以确保实际更改的trigger和期望更改的trigger是一致的. TriggerResponse 400 请求无效,错误码:InvalidArgument Error 403 拒绝请求,错误码:AccessDenied,InvalidAccessKeyId,SignatureNotMatch,RequestTimeTooSkewed Error 404 service,function,trigger不存在,错误码:ServiceNotFound,FunctionNotFound,TriggerNotFound Error 500 服务内部错误,错误码:InternalServerError Error

    InvokeFunction POST /services/{serviceName}/functions/{functionName}/invocations POST /services/{serviceName}.{qualifier}/functions/{functionName}/invocations Description 同步或异步调用function

    Parameters Type Name Description Schema Default Header Host required 访问域名:$account-id.$region.fc.aliyuncs.com string Header X-Fc-Invocation-Type optional 调用方式:Sync或者Async string "Sync" Path functionName required function名称 string Path serviceName required service名称 string Path qualifier optional service版本, 可以是versionId或者aliasName string Body body required 事件(event),binary type。函数计算服务将event传递给用户function来处理 object Responses HTTP Code Description Schema 200 同步调用成功,返回函数结果 Headers : X-Fc-Error-Type (string) : 调用function的错误类型,分为HandledInvocationError和UnhandledInvocationError两种。. InvokeResponse 202 异步调用,服务器已接受请求但可能尚未处理 No Content 403 拒绝请求,错误码:AccessDenied,InvalidAccessKeyId,SignatureNotMatch,RequestTimeTooSkewed Error 404 service,function,alias或者version不存在,错误码:ServiceNotFound,FunctionNotFound,VersionNotFound,AliasNotFound Error 500 服务内部错误,错误码:InternalServerError Error

    ListFunctions GET /services/{serviceName}/functions GET /services/{serviceName}.{qualifier}/functions Description 获取function列表

    Parameters Type Name Description Schema Default Header Host required 访问域名:$account-id.$region.fc.aliyuncs.com string Path serviceName required service名称 string Path qualifier optional service版本, 可以是versionId或者aliasName string Query limit optional 限定此次返回资源的数量。如果不设定,默认返回20,最大不能超过100。返回结果可能小于指定的数量,但不会多于指定的数量 integer (int32) 20 Query nextToken optional 用来返回更多结果。第一次查询不需要提供这个参数,后续查询的token从返回结果中获取 string Query prefix optional 限定返回的资源名称必须以prefix作为前缀 string Query startKey optional 设定结果从startKey之后(包括startKey)按字母排序的第一个开始返回 string Responses HTTP Code Description Schema 200 请求成功 Response 200 400 请求无效,错误码:InvalidArgument Error 403 拒绝请求,错误码:AccessDenied,InvalidAccessKeyId,SignatureNotMatch,RequestTimeTooSkewed Error 404 service,alias或者version不存在,错误码:ServiceNotFound,VersionNotFound,AliasNotFound Error 500 服务内部错误,错误码:InternalServerError Error Response 200

    Name Schema functions optional < functions > array nextToken optional NextToken functions

    Name Description Schema codeChecksum optional function code包的CRC64值 Example : "5434025278388143772" string codeSize optional 系统返回的function的code包大小,单位为byte Example : 1024 integer (int64) createdTime optional function创建时间 Example : "2016-08-15T15:00:00.000+0000" string description optional Example : "This is a demo hello world function." string functionId optional 系统为每个function生成的唯一ID Example : "2d28e0e9-9ba5-4eed-8b1a-d3d9cd24e737" string functionName optional Example : "helloworld" string handler optional function的执行入口 Example : "hello_world.main" string lastModifiedTime optional function上次修改时间 Example : "2016-08-15T17:00:00.000+0000" string memorySize optional function设置的内存大小,单位为MB Example : 512 integer (int32) runtime optional function运行的语言环境,目前支持nodejs6, nodejs8, python2.7, python3, java8 Example : "nodejs4.4" string timeout optional 运行的超时时间,单位为秒 Example : 10 integer (int32)

    ListServices GET /services Description 获取service列表

    Parameters Type Name Description Schema Default Header Host required 访问域名:$account-id.$region.fc.aliyuncs.com string Query limit optional 限定此次返回资源的数量。如果不设定,默认返回20,最大不能超过100。返回结果可能小于指定的数量,但不会多于指定的数量 integer (int32) 20 Query nextToken optional 用来返回更多结果。第一次查询不需要提供这个参数,后续查询的token从返回结果中获取 string Query prefix optional 限定返回的资源名称必须以prefix作为前缀 string Query startKey optional 设定结果从startKey之后(包括startKey)按字母排序的第一个开始返回 string Responses HTTP Code Description Schema 200 请求成功 Response 200 400 请求无效,错误码:InvalidArgument Error 403 拒绝请求,错误码:AccessDenied,InvalidAccessKeyId,SignatureNotMatch,RequestTimeTooSkewed Error 500 服务内部错误,错误码:InternalServerError Error Response 200

    Name Schema nextToken optional NextToken services optional < services > array services

    Name Description Schema createdTime optional service的创建时间 Example : "2016-08-15T16:06:05.000+0000" string description optional service的简短描述信息 Example : "This is a demo service." string internetAccess optional 设为true让function可以访问公网 Example : true boolean lastModifiedTime optional service上次更新时间 Example : "2016-08-16T18:00:00.000+0000" string logConfig optional log配置,function产生的log会写入这里配置的logstore LogConfig role optional 授予函数计算所需权限的RAM role, 使用场景包含 1. 从用户 bucket 中 copy function code 2. 把 function产生的 log 发送到用户的 logstore 中 3. 为function 在执行中访问其它云资源生成 token Example : "acs:ram::1234567890:role/fc-test" string serviceId optional 系统为每个service生成的唯一ID Example : "2d28e0e9-9ba5-4eed-8b1a-d3d9cd24e737" string serviceName optional Example : "demo-service" string vpcConfig optional vpc配置, 配置后function可以访问指定VPC VPCConfig

    ListTriggers GET /services/{serviceName}/functions/{functionName}/triggers Description 获取trigger列表

    Parameters Type Name Description Schema Default Header Host required 访问域名:$account-id.$region.fc.aliyuncs.com string Path functionName required function名称 string Path serviceName required service名称 string Query limit optional 限定此次返回资源的数量。如果不设定,默认返回20,最大不能超过100。返回结果可能小于指定的数量,但不会多于指定的数量 integer (int32) 20 Query nextToken optional 用来返回更多结果。第一次查询不需要提供这个参数,后续查询的token从返回结果中获取 string Query prefix optional 限定返回的资源名称必须以prefix作为前缀 string Query startKey optional 设定结果从startKey之后(包括startKey)按字母排序的第一个开始返回 string Responses HTTP Code Description Schema 200 请求成功 Response 200 400 请求无效,错误码:InvalidArgument Error 403 拒绝请求,错误码:AccessDenied,InvalidAccessKeyId,SignatureNotMatch,RequestTimeTooSkewed Error 404 service或function不存在,错误码:ServiceNotFound,FunctionNotFound Error 500 服务内部错误,错误码:InternalServerError Error Response 200

    Name Schema nextToken optional NextToken triggers optional < TriggerResponse > array

    ListVersions GET /services/{serviceName}/versions Description 获取version列表

    Parameters Type Name Description Schema Default Header Host required 访问域名:$account-id.$region.fc.aliyuncs.com string Path serviceName required service名称 string Query limit optional 限定此次返回资源的数量。如果不设定,默认返回20,最大不能超过100。返回结果可能小于指定的数量,但不会多于指定的数量 integer (int32) 20 Query nextToken optional 用来返回更多结果。第一次查询不需要提供这个参数,后续查询的token从返回结果中获取 string Query startKey optional 设定结果从startKey之后(包括startKey)按版本号排序的第一个开始返回 string Query direction optional 限定返回的资源排序方向 string BACKWARD Responses HTTP Code Description Schema 200 请求成功 Response 200 400 请求无效,错误码:InvalidArgument Error 403 拒绝请求,错误码:AccessDenied,InvalidAccessKeyId,SignatureNotMatch,RequestTimeTooSkewed Error 404 service不存在,错误码:ServiceNotFound Error 500 服务内部错误,错误码:InternalServerError Error Response 200

    Name Schema nextToken optional NextToken versions optional < VersionResponse > array direction optional string

    ListAliases GET /services/{serviceName}/aliases Description 获取alias列表

    Parameters Type Name Description Schema Default Header Host required 访问域名:$account-id.$region.fc.aliyuncs.com string Path serviceName required service名称 string Query limit optional 限定此次返回资源的数量。如果不设定,默认返回20,最大不能超过100。返回结果可能小于指定的数量,但不会多于指定的数量 integer (int32) 20 Query nextToken optional 用来返回更多结果。第一次查询不需要提供这个参数,后续查询的token从返回结果中获取 string Query prefix optional 限定返回的资源名称必须以prefix作为前缀 string Query startKey optional 设定结果从startKey之后(包括startKey)按字母排序的第一个开始返回 string Responses HTTP Code Description Schema 200 请求成功 Response 200 400 请求无效,错误码:InvalidArgument Error 403 拒绝请求,错误码:AccessDenied,InvalidAccessKeyId,SignatureNotMatch,RequestTimeTooSkewed Error 404 service不存在,错误码:ServiceNotFound Error 500 服务内部错误,错误码:InternalServerError Error Response 200

    Name Schema nextToken optional NextToken aliases optional < AliasResponse > array

    UpdateFunction PUT /services/{serviceName}/functions/{functionName} Description 更新function

    Parameters Type Name Description Schema Header Host required 访问域名:$account-id.$region.fc.aliyuncs.com string Header If-Match optional 用于确保实际更改的资源和期望更改的资源是一致的,该值来自Create,Get和Update API的响应 string Path functionName required function名称 string Path serviceName required service名称 string Body function required function更新对象描述 FunctionUpdateFields Responses HTTP Code Description Schema 200 请求成功 Headers : ETag (string) : function etag,用于更改function。以确保实际更改的function和期望更改的function是一致的. FunctionResponse 400 请求无效,错误码:InvalidArgument Error 403 拒绝请求,错误码:AccessDenied,InvalidAccessKeyId,SignatureNotMatch,RequestTimeTooSkewed Error 404 service或function不存在,错误码:ServiceNotFound,FunctionNotFound Error 409 多个线程同时更新,错误码:ConcurrentUpdateError Error 500 服务内部错误,错误码:InternalServerError Error

    UpdateService PUT /services/{serviceName} Description 更新service

    Parameters Type Name Description Schema Header Host required 访问域名:$account-id.$region.fc.aliyuncs.com string Header If-Match optional 用于确保实际更改的资源和期望更改的资源是一致的,该值来自Create,Get和Update API的响应 string Path serviceName required service名称 string Body body required service更新描述 ServiceUpdateFields Responses HTTP Code Description Schema 200 请求成功 Headers : ETag (string) : service etag,用于更改service。以确保实际更改的service和期望更改的service是一致的. ServiceResponse 400 请求无效,错误码:InvalidArgument Error 403 拒绝请求,错误码:AccessDenied,InvalidAccessKeyId,SignatureNotMatch,RequestTimeTooSkewed Error 404 service不存在,错误码:ServiceNotFound Error 409 多个线程同时更新,错误码:ConcurrentUpdateError Error 500 服务内部错误,错误码:InternalServerError Error

    UpdateTrigger PUT /services/{serviceName}/functions/{functionName}/triggers/{triggerName} Description 更新trigger

    Parameters Type Name Description Schema Header Host required 访问域名:$account-id.$region.fc.aliyuncs.com string Header If-Match optional 用于确保实际更改的资源和期望更改的资源是一致的,该值来自Create,Get和Update API的响应 string Path functionName required function名称 string Path serviceName required service名称 string Path triggerName required trigger名称 string Body body required 更新字段描述 TriggerUpdateFields Responses HTTP Code Description Schema 200 请求成功 Headers : ETag (string) : trigger etag,用于更改trigger。以确保实际更改的trigger和期望更改的trigger是一致的. TriggerResponse 400 请求无效,错误码:InvalidArgument Error 403 拒绝请求,错误码:AccessDenied,InvalidAccessKeyId,SignatureNotMatch,RequestTimeTooSkewed Error 404 service,function,trigger不存在,错误码:ServiceNotFound,FunctionNotFound,TriggerNotFound Error 409 多个线程同时更新,错误码:ConcurrentUpdateError Error 500 服务内部错误,错误码:InternalServerError Error

    UpdateAlias PUT /services/{serviceName}/aliases/{aliasName} Description 更新alias

    Parameters Type Name Description Schema Header Host required 访问域名:$account-id.$region.fc.aliyuncs.com string Header If-Match optional 用于确保实际更改的资源和期望更改的资源是一致的,该值来自Create,Get和Update Alias API的响应 string Path serviceName required service名称 string Path aliasName required alias名称 string Body alias required alias更新对象描述 AliasUpdateFields Responses HTTP Code Description Schema 200 请求成功 Headers : ETag (string) : alias etag,用于更改alias。以确保实际更改的alias和期望更改的alias是一致的. AliasResponse 400 请求无效,错误码:InvalidArgument Error 403 拒绝请求,错误码:AccessDenied,InvalidAccessKeyId,SignatureNotMatch,RequestTimeTooSkewed Error 404 aliase或version不存在,错误码:AliasNotFound,VersionNotFound Error 409 多个线程同时更新,错误码:ConcurrentUpdateError Error 500 服务内部错误,错误码:InternalServerError Error

    createCustomDomain: POST /custom-domains

    Request: Type Name Description Schema Header Host(required) 用户 endpoint: $account-id.$region.fc.aliyuncs.com string Body body(required) CustomDomainConfig 对象 CustomDomainConfig Response: HTTP Code Description Schema 200 请求成功 CustomDomainResponse 400 请求无效,错误码: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) 用户 endpoint: $account-id.$region.fc.aliyuncs.com string Path CustomDomain(required) 域名 string Body body(required) CustomDomainConfig 对象 CustomDomainConfig Response: HTTP Code Description Schema 200 请求成功 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) 用户endpoint: $account-id.$region.fc.aliyuncs.com string Path CustomDomain(required) 域名 string Response: HTTP Code Description Schema 200 请求成功 CustomDomainResponse 400 请求无效,错误码:InvalidArgument Error 403 拒绝请求,错误码:AccessDenied, InvalidAccessKeyId, SignatureNotMatch Error 404 CustomDomain 不存在,错误码:CustomDomainNotFound Error 500 服务内部错误,错误码:InternalServerError Error

    listCustomDomain GET /custom-domains

    Request: Type Name Description Schema Header Host(required) 用户endpoint: $account-id.$region.fc.aliyuncs.com string Query limit(optional) 限定此次返回资源的数量。如果不设定,默认返回20,最大不能超过100。返回结果可能小于指定的数量,但不会多于指定的数量 integer (int32) Query nextToken(optional) 用来返回更多结果。第一次查询不需要提供这个参数,后续查询的token从返回结果中获取。 string Query prefix(optional) 限定返回的资源名称必须以prefix作为前缀。 string Query startKey(optional) 设定结果从 startKey 之后(包括startKey)按字母排序的第一个开始返回 string Response: HTTP Code Description Schema 200 请求成功 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) 用户endpoint: $account-id.$region.fc.aliyuncs.com string Path CustomDomain(required) 域名名称 string Response: HTTP Code Description Schema 204 请求成功 No Content 400 请求无效,错误码:InvalidArgument Error 403 拒绝请求,错误码:AccessDenied, InvalidAccessKeyId, SignatureNotMatch Error 404 CustomDomain 不存在,错误码:CustomDomainNotFound Error 500 服务内部错误,错误码:InternalServerError Error

    putProvisionConfig: PUT /services/{ServiceName}.{Qualifier}/functions/{FunctionName}/provision-config

    Request: Type Name Description Schema Header Host(required) 用户 endpoint: $account-id.$region.fc.aliyuncs.com string Header If-Match optional 用于确保实际更改的资源和期望更改的资源是一致的,该值来自Get和Put API的响应 string Path serviceName required service名称 string Path qualifier required alias名称 string Path functionName required function名称 string Body body required put provision target描述 PutProvisionConfigFields Response: HTTP Code Description Schema 200 请求成功 Headers : ETag (string) : provision config etag, 以确保实际更改的provision config和期望更改的provision config是一致的。 ProvisionTargetResponse 400 请求无效,错误码:InvalidArgument Error 403 AccessDenied, InvalidAccessKeyId, SignatureNotMatch Error 412 Etag不匹配,错误码:PreconditionFailed Error 500 服务内部错误,错误码:InternalServerError Error

    getProvisionConfig GET /services/{ServiceName}.{Qualifier}/functions/{FunctionName}/provision-config

    Request: Type Name Description Schema Header Host(required) 用户endpoint: $account-id.$region.fc.aliyuncs.com string Path serviceName required service名称 string Path qualifier required alias名称 string Path functionName required function名称 string Response: HTTP Code Description Schema 200 请求成功 Headers : ETag (string) : provision config etag, 以确保实际更改的provision config和期望更改的provision config是一致的。 ProvisionConfigResponse 400 请求无效,错误码:InvalidArgument Error 403 拒绝请求,错误码:AccessDenied, InvalidAccessKeyId, SignatureNotMatch Error 500 服务内部错误,错误码:InternalServerError Error

    listProvisionConfigs GET /provision-configs

    Request: Type Name Description Schema Header Host(required) 用户endpoint: $account-id.$region.fc.aliyuncs.com string Query limit(optional) 限定此次返回资源的数量。如果不设定,默认返回20,最大不能超过100。返回结果可能小于指定的数量,但不会多于指定的数量 integer (int32) Query nextToken(optional) 用来返回更多结果。第一次查询不需要提供这个参数,后续查询的token从返回结果中获取。 string Query serviceName(optional) 限定返回的资源名称必须属于该service。 string Query qualifier(optional) 限定返回的资源名称必须属于该qualifier。qualifier只能是aliasName,且必须和serviceName共同使用 string Response: HTTP Code Description Schema 200 请求成功 Response 200 400 请求无效,错误码:InvalidArgument Error 403 拒绝请求,错误码:AccessDenied, InvalidAccessKeyId, SignatureNotMatch Error 500 服务内部错误,错误码:InternalServerError Error Response 200

    Name Schema provisionConfigs optional < ProvisionConfigResponse > array nextToken optional NextToken

    Definitions

    Code 支持两种方式提供 code 的 zip 包

    指定存储code zip包的ossBucketName和ossObjectName 指定zipFile为zip包的base64编码内容, 在一次请求中必须且只能使用其中的一种。 Name Description Schema ossBucketName optional function code包的bucket name string ossObjectName optional code zip包的object name string zipFile optional 直接在request body中上传code zip包的base64编码 string

    Error 系统返回的error对象

    Name Description Schema errorCode optional 错误码 string errorMessage optional 详细的错误信息描述 string

    Function Name Description Schema code required 指定code zip包 Code description optional string functionName required function名称 string handler required function执行的入口,具体格式和语言相关 string memorySize optional function的内存规格,单位为MB,最小为128MB,最大1536MB,为64MB的倍数 integer runtime required function的运行环境,目前支持nodejs6, nodejs8, python2.7, python3, java8 string EnvironmentVariables optional 为函数设置的环境变量,可以在函数中获取环境变量的值 map timeout optional function运行的超时时间,单位为秒,最小1秒,最长5分钟,默认3秒。function超过这个时间后会被终止执行 integer initializer optional 初始化 function 执行的入口,具体格式和语言相关 string initializationTimeout optional 初始化 function 运行的超时时间,单位为秒,最小1秒,最长5分钟,默认3秒。初始化 function 超过这个时间后会被终止执行 integer

    FunctionCodeResponse Name Description Schema checksum optional crc64 checksum Example : "1234567890" string url optional Example : "http://func-code.oss-cn-shanghai.aliyuncs.com/1a2b3c4d5e6f" string

    FunctionResponse Name Description Schema codeChecksum optional function code包的CRC64值 Example : "5434025278388143772" string codeSize optional 系统返回的function的code包大小,单位为byte Example : 1024 integer (int64) createdTime optional function创建时间 Example : "2016-08-15T15:00:00.000+0000" string description optional Example : "This is a demo hello world function." string functionId optional 系统为每个function生成的唯一ID Example : "2d28e0e9-9ba5-4eed-8b1a-d3d9cd24e737" string functionName optional Example : "helloworld" string handler optional function的执行入口 Example : "hello_world.main" string lastModifiedTime optional function上次修改时间 Example : "2016-08-15T17:00:00.000+0000" string memorySize optional function设置的内存大小,单位为MB Example : 512 integer (int32) runtime optional function运行的语言环境,目前支持nodejs6, nodejs8, python2.7, python3, java8 Example : "nodejs4.4" string EnvironmentVariables optional 为函数设置的环境变量,可以在函数中获取环境变量的值 map timeout optional 运行的超时时间,单位为秒 Example : 10 integer (int32)

    FunctionUpdateFields function可以更新的字段描述

    Name Description Schema code optional 指定code zip包 Code description optional string handler optional function执行的入口,具体格式和语言相关 string memorySize optional function的内存规格,单位为MB,最小为128MB,最大1536MB,为64MB的倍数,默认128MB integer runtime optional function的运行环境,目前支持nodejs6, nodejs8, python2.7, python3, java8 string EnvironmentVariables optional 为函数设置的环境变量,可以在函数中获取环境变量的值 map timeout optional function运行的超时时间,单位为秒,最小1秒,最长5分钟,默认3秒。function超过这个时间后会被终止执行 integer

    InvokeResponse invoke function返回的结果,函数具体的返回内容由用户解释

    Type : binary

    LogConfig logging 配置

    Name Description Schema logstore optional loghub中的logstore名称 string project optional loghub中的project名称 string

    NextToken 用来返回更多的查询结果。如果这个值没有返回,则说明没有更多结果

    Type : string

    Service service对象描述

    Name Description Schema description optional service的简短描述 string internetAccess optional 设为true让function可以访问公网 Example : true boolean logConfig optional log配置,function产生的log会写入这里配置的logstore LogConfig role optional 授予函数计算所需权限的RAM role, 使用场景包含 1. 把 function产生的 log 发送到用户的 logstore 中 2. 为function 在执行中访问其它云资源生成 token Example : "acs:ram::1234567890:role/fc-test" string serviceName required service名称 string vpcConfig optional vpc配置, 配置后function可以访问指定VPC VPCConfig nasConfig optional NAS配置, 配置后function可以访问指定NAS NASConfig

    ServiceResponse Name Description Schema createdTime optional service的创建时间 Example : "2016-08-15T16:06:05.000+0000" string description optional service的简短描述信息 Example : "This is a demo service." string internetAccess optional 设为true让function可以访问公网 Example : true boolean lastModifiedTime optional service上次更新时间 Example : "2016-08-16T18:00:00.000+0000" string logConfig optional logging 配置,function产生的log会写入这里配置的logstore LogConfig role optional 授予函数计算所需权限的RAM role, 使用场景包含 1. 把 function产生的 log 发送到用户的 logstore 中 2. 为function 在执行中访问其它云资源生成 token Example : "acs:ram::1234567890:role/fc-test" string serviceId optional 系统为每个service生成的唯一ID Example : "2d28e0e9-9ba5-4eed-8b1a-d3d9cd24e737" string serviceName optional Example : "demo-service" string vpcConfig optional vpc配置, 配置后function可以访问指定VPC VPCConfig nasConfig optional NAS配置, 配置后function可以访问指定NAS NASConfig

    ServiceUpdateFields service可更新字段描述

    Name Description Schema description optional string internetAccess optional 设为true让function可以访问公网 Example : true boolean logConfig optional log配置,function产生的log会写入这里配置的logstore LogConfig role optional 授予函数计算所需权限的RAM role, 使用场景包含 1. 把 function产生的 log 发送到用户的 logstore 中 2. 为function 在执行中访问其它云资源生成 token Example : "acs:ram::1234567890:role/fc-test" string vpcConfig optional vpc配置, 配置后function可以访问指定VPC VPCConfig nasConfig optional NAS配置, 配置后function可以访问指定NAS NASConfig

    Trigger Name Description Schema invocationRole required event source,如OSS,使用该role去invoke function Example : "acs:ram::1234567890:role/fc-test" string sourceArn required event source的Aliyun Resource Name(ARN) Example : "acs:oss:cn-shanghai:12345:mybucket" string triggerConfig required trigger配置,针对不同的trigger类型,trigger配置会有所不同 object triggerName required trigger名称 Example : "image_resize" string triggerType required trigger类型 Example : "oss" string qualifier optional service版本 Example : "LATEST" string

    TriggerResponse Name Description Schema createdTime optional 创建时间 Example : "2016-08-15T15:00:00.000+0000" string invocationRole optional string lastModifiedTime optional 上次修改时间 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 event source,如OSS,使用该role去invoke function Example : "acs:ram::1234567890:role/fc-test" string triggerConfig optional trigger配置,针对不同的trigger类型,trigger配置会有所不同 object qualifier optional service版本 Example : "LATEST" string

    VPCConfig VPC 配置

    Name Description Schema securityGroupId required 安全组ID string vSwitchIds required 一个或多个VSwitch ID < string > array vpcId required VPC ID string

    NASConfig NAS 配置

    Name Description Schema userId required userID string groupId required groupID string mountPoints required 挂载点 < MountPoint > array

    MountPoint 挂载点

    Name Description Schema serverAddr required NAS 服务器地址 string mountDir required 本地挂载目录 string

    CustomDomainConfig 对象描述 Name Description Schema DomainName(required) 域名 string Protocol(required) HTTP 或 HTTP,HTTPS string ApiVersion(optional) api_version string RouteConfig(optional) 路由表:自定义域名访问时的 path 到 function 的映射 RouteConfig CertConfig(optional) https证书信息 CertConfig

    RouteConfig 对象描述 Name Description Schema Routes(required) 是路由的数组 PathConfig Array

    PathConfig 对象描述 Name Description Schema path(required) 自定义域名 request 的路径,例如:”/login/*” string serviceName(required) path 对应的 function 所在的 service,例如:”blogService” string functionName(required) path 对应的 function ,例如:”login” string

    CertConfig 对象描述 Name Description Schema certName(required) 证书的自定义名字 string privateKey(required) 私钥 string certificate(required) 证书 string

    CustomDomainResponse 对象描述 Name Description Schema CreatedTime 绑定域名的时间 string LastModifiedTime 更新域名信息的时间 string CustomDomain 用户域名 string Protocol 协议类型 string ApiVersion api 版本 string RouteConfig 路由表配置 RouteConfig CertConfig(optional) https证书信息 CertConfig

    Version Name Description Schema versionId required service版本号 Example : "1" string description optional service版本描述 Example : "my service version" string

    VersionResponse Name Description Schema createdTime optional 创建时间 Example : "2016-08-15T15:00:00.000+0000" string lastModifiedTime optional 上次修改时间 Example : "2016-08-15T17:00:00.000+0000" string versionId optional string description optional string

    Alias Name Description Schema aliasName required service版本别名 Example : "my-alias" string versionId required alias指向的版本 Example : "1" string description optional alias的描述 object additionalVersionWeight optional 灰度发布的版本,以及对应的流量权重 Example : "2:0.05" map

    AliasResponse Name Description Schema createdTime required 创建时间 Example : "2016-08-15T15:00:00.000+0000" string lastModifiedTime required 上次修改时间 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 alias指向的版本 Example : "1" string description optional alias的描述 object additionalVersionWeight optional 灰度发布的版本,以及对应的流量权重 Example : "2:0.05" map

    PutProvisionConfigFields Name Description Schema target required 目标资源个数 Example : "1" integer (int64)

    ProvisionTargetResponse Name Description Schema resource required 资源描述 Example : "12345#servierName#qualifier#functionName" string target required 目标资源个数 Example : "1" integer (int64)

    ProvisionConfigResponse Name Description Schema resource required 资源描述 Example : "12345#servierName#qualifier#functionName" string target required 目标资源个数 Example : "1" integer (int64) current required 实际资源个数 Example : "1" integer (int64)

    TagResource POST /tag Description 给资源打标签

    Parameters Type Name Description Schema Header Host required 访问域名:$account-id.$region.fc.aliyuncs.com string Body body required tagResourceBody json Responses HTTP Code Description Schema 200 给指定的资源打标签成功 无 400 请求无效,错误码: InvalidArgument Error 403 拒绝请求,错误码: AccessDenied,InvalidAccessKeyId,SignatureNotMatch,RequestTimeTooSkewed Error 404 资源不存在,错误码: ServiceNotFound Error 500 服务内部错误,错误码: InternalServerError Error

    tagResourceBody Argument Type Required Description resourceArn string yes Resource ARN. ARN 全称或者简称 tags string to string map yes tag 字典, length 至少为 1, 最大为 20 注:目前只能给 top level 资源 service 进行标签的相关操作, ARN 可以是类似 services/foo 或者 acs:fc:cn-shanghai:123456789:services/foo

    UntagResource DELETE /tag Description 给资源取消标签

    Parameters Type Name Description Schema Header Host required 访问域名:$account-id.$region.fc.aliyuncs.com string Body body required unTagResourceBody json Responses HTTP Code Description Schema 200 取消指定资源标签成功 无 400 请求无效,错误码: InvalidArgument Error 403 拒绝请求,错误码: AccessDenied,InvalidAccessKeyId,SignatureNotMatch,RequestTimeTooSkewed Error 404 资源不存在,错误码: ServiceNotFound Error 500 服务内部错误,错误码: InternalServerError Error

    unTagResourceBody Argument Type Required Description resourceArn string yes Resource ARN. ARN 全称或者简称 tagKeys string array no tag key 值列表, 最大为20,当 all=false, length 至少为 1. 当 length 大于 1 时, 可以忽略 all 值 all bool no 删除所有 tag,默认值为 false

    GetResourceTags GET /tag Description 获取资源所有的标签信息

    Parameters Type Name Description Schema Header Host required 访问域名:$account-id.$region.fc.aliyuncs.com string Query resourceArn required Resource ARN. ARN 全称或者简称 string Responses HTTP Code Description Schema 200 获取指定资源标签成功 GetResourceTagsResponse 400 请求无效,错误码: InvalidArgument Error 403 拒绝请求,错误码: AccessDenied,InvalidAccessKeyId,SignatureNotMatch,RequestTimeTooSkewed Error 404 资源不存在,错误码: ServiceNotFound Error 500 服务内部错误,错误码: InternalServerError Error GetResourceTagsResponse Argument Type Description resourceArn string Resource ARN 全称 tags string to string map tag 字典

    2020-03-27 17:57:19
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
All in Serverless 阿里云核心产品全面升级 立即下载
AIGC 浪潮之上,森马的 Serverless 实践之旅 立即下载
极氪大数据 Serverless 应用实践 立即下载