You need to enable JavaScript to run this app.
导航
ListRevisions
最近更新时间:2024.08.08 10:29:16首次发布时间:2024.08.08 10:29:16

批量获取函数的版本配置信息。

请求说明

  • 请求方式:POST
  • 请求地址:http://open.volcengineapi.com/?Action=ListRevisions&Version=2024-06-06 HTTP/1.1

请求参数

参数类型是否必选示例值描述
ActionStringListRevisions接口名称。当前 API 的名称为 ListRevisions
VersionString2024-06-06接口版本。当前 API 的版本为 2024-06-06
FunctionIdString函数 ID。
PageNumberInteger1分页参数,当前页码,默认为 1。
PageSizeInteger10分页参数,每页大小,默认为 10。
FiltersArray of Filter[{"Name": "RevisionNumber", "Value": ["2"]}]查询过滤条件。

Filter

参数类型是否必选示例值描述

Name

String

RevisionNumber

查询的筛选键名, 仅支持 RevisionNumber(版本号)。

说明

过滤值不支持模糊查询。

ValuesArray of String["2"]查询的筛选值,是一个数组。

请求示例

POST http://open.volcengineapi.com/?Action=ListRevisions&Version=2024-06-06 HTTP/1.1
Content-Type: application/json
{
    "FunctionId": "",
    "PageNumber": 1,
    "PageSize": 10,
    "Filters": [
        {
            "Name": "RevisionNumber",
            "Value": [
                "2"
            ]
        }
    ]
}

返回参数

参数类型示例值描述
ItemsArray of FunctionRevision函数版本详细信息列表。
TotalInteger1返回列表数据的总量。

FunctionRevision

参数类型示例值描述
IdStringnwwzoaq1函数 ID。
EnvsArray of EnvVar[{"Key": "ENV_NAME", "Value": "ENV_VALUE"}]函数环境变量。
NameStringofficial-site函数名字。
SourceStringtemplates/vefaas-python38-default.zip代码/镜像 Source。
RuntimeStringpython3.8/v1函数运行时。
CodeSizeInteger1024代码包大小。
MemoryMBInteger1024单实例最大内存。范围 512 - 4096, 取值以 512 为梯度。
TlsConfigObject of TlsConfig{"EnableLog": true, "TlsProjectId": "a40202c5-fe22-4ea7-a3a5-06d1bca77abcd", "TlsTopicId": "2ff955cb-1f03-4b9b-8982-306e98c27890"}函数 TLS 日志配置。
VpcConfigObject of VpcConfig{"EnableVpc":true,"VpcId":"vpc-rragpljjr9q8v0x57hsabcd","SubnetIds":["subnet-milbxl46sdfk5smt1aa8defg"],"SecurityGroupIds":["sg-rragprgn3fnkv0x584ghijk"],"EnableSharedInternetAccess":true}VPC 配置。
NasStorageObject of NasStorage{"EnableNas":true,"NasConfigs":[{"FileSystemId":"cnas-cnbjb37c2193e51234","MountPointId":"mount-bce15678","RemotePath":"/","LocalMountPath":"/mnt/nas","Uid":1000,"Gid":1000}]}文件存储 NAS 挂载配置。
SourceTypeStringtos代码 Source 类型。
DescriptionStringThis is a description函数描述。
MaxReplicasInteger10最大实例数量。
CreationTimeString2020-05-20T13:00:55Z函数创建时间。
CodeSizeLimitInteger64代码包大小上限,只暴露给管理员/开了白名单的用户。默认 64MB,Native 函数默认 256MB

ExclusiveMode

Boolean

false

独占模式开关。

  • true:关闭单实例多并发,即同一时刻单实例只能处理一个请求的独占模式。
  • false(默认):开启单实例多并发,即同一时刻单实例可处理多个请求的非独占模式,可通过 MaxConcurrency 设置单实例能够承载的最大并发请求数量。
InitializerSecInteger30函数初始化超时配置。
MaxConcurrencyInteger100单实例最大并发。ExclusiveMode=false 时, 范围 10-1000。
RequestTimeoutInteger30请求超时(单位 秒)。范围 1 - 900, 默认 30。
RevisionNumberInteger1函数版本号。
SourceLocationStringtos://tos-cn-beijing.volces.com/test.zip代码/镜像的来源地址。
TosMountConfigObject of TosMountConfig{"EnableTos":true,"MountPoints":[{"BucketPath":"/","LocalMountPath":"/mnt/tos","ReadOnly":false,"BucketName":"ai-models","Endpoint":"http://tos-cn-beijing.ivolces.com"}],"Credentials":{"AccessKeyId": "TZTJjfewfweiFJIEFLDMFDKFabcd", "SecretAccessKey": "FweiffJEFJEWFJWERYTKRVFJlewjfwelFslfjsdflsjdfl=="}}对象存储 TOS 挂载配置。
RevisionDescriptionStringThis is a revision description函数版本描述。
RevisionCreationTimeString2020-05-20T13:00:55Z版本创建时间。

EnvVar

参数类型示例值描述
KeyStringbusiness_type环境变量的 Key。1 ~ 63 个字符,字符中可包含英文、数字以及下划线(_),并且不能以数字开头。同一函数下 Key 唯一。
ValueStringfree环境变量的 Value。

TlsConfig

参数类型示例值描述

EnableLog

Boolean

false

TlS 日志功能开关。

  • true:开启,函数的 stdout/stderr 日志将被采集至日志服务的指定日志项目和日志主题中。
  • false:关闭。不采集日志。
TlsTopicIdStringtls-vefaas-logstoreTLS 日志主题 ID。
TlsProjectIdStringtls-vefaasTLS 日志项目 ID。

VpcConfig

参数类型示例值描述
VpcIdStringvpc-3rf87yoa8yn0g5zsk2hfevabcdVPC ID。如果 VPC ID 为空字符串,代表删除当前 VPC 配置。
EnableVpcBooleanfalse函数是否开启私有网络访问。
SubnetIdsArray of Stringsubnet-mj1lxywnkq2o5smt1bhyefghVPC 子网 ID。
SecurityGroupIdsArray of Stringsg-rs6schq63nk0v0x57j4wxyz安全组 ID。

EnableSharedInternetAccess

Boolean

false

函数访问公网开关。在用户绑定自己 VPC 的情况下,是否通过 vefaas VPC 共享 NAT 网关访问公网。

  • true:开启,通过默认网卡访问公网,会产生公网出流量费用。
  • false:关闭,函数无法通过默认网卡访问公网。

NasStorage

参数类型示例值描述
EnableNasBooleanfalse是否开启 NAS 存储挂载。
NasConfigsArray of NasConfig[{"FileSystemId": "enas-cnsha0a8842997abcd", "MountPointId": "mount-6303defg", "RemotePath": "/", "LocalMountPath": "/mnt/nas", "Uid": "1000", "Gid": "1000"}]Nas 存储配置。

TosMountConfig

参数类型示例值描述
EnableTosBooleanfalse是否开启 TOS 存储挂载。
CredentialsObject of Credentials{"AccessKeyId": "TZTJjfewfweiFJIEFLDMFDKFabcd", "SecretAccessKey": "FweiffJEFJEWFJWERYTKRVFJlewjfwelFslfjsdflsjdfl=="}开启 TOS 后需要提供具有 TOS 域名访问权限的 AKSK。
MountPointsArray of TosMountPoint[{"Endpoint": "http://tos-cn-beijing.ivolces.com", "BucketName": "ai-model", "BucketPath": "/", "LocalMountPath": "/mnt/tos", "ReadOnly": "true"}]开启 TOS 后需要提供 TOS 存储配置列表,最多不超过 5 个。

NasConfig

参数类型示例值描述
GidLong1000文件系统中的用户组,暂时不支持自定义,如果提供该参数,参数值 1000(和函数 run user gid 保持一致)。
UidLong1000文件系统中的用户,暂时不支持自定义,如果提供该参数,参数值只能为 1000(和函数 run user uid 保持一致)。
RemotePathString/文件系统远端目录。长度 1-128 个字符,只能以“/”开头,支持大小写字母、数字和特殊字符(- . _ ~ / : @ = + ? # )。
FileSystemIdStringenas-cnsha0a8842997abcdNAS 文件系统 ID。
MountPointIdStringmount-6303defgNAS 挂载点 ID。
LocalMountPathString/mnt/nas函数本地挂载目录。长度 1-128 个字符,只能以“/”开头,支持大小写字母、数字和特殊字符(- . _ ~ / : @ = + ? # )。

Credentials

参数类型示例值描述
AccessKeyIdStringTZTJjfewfweiFJIEFLDMFDKFabcdAccess Key ID。
SecretAccessKeyStringFweiffJEFJEWFJWERYTKRVFJlewjfwelFslfjsdflsjdfl==Secret Access Key。

TosMountPoint

参数类型示例值描述
EndpointStringhttp://tos-cn-beijing.ivolces.comTOS 访问域名。

ReadOnly

Boolean

true

函数本地目录访问权限,挂载 TOS Bucket后,函数本地挂载目录的访问权限是否为只读。

  • true:只读
  • false(默认):读写
BucketNameStringai-modelTOS 存储桶。
BucketPathString/挂载的 TOS Bucket 路径。
LocalMountPathString/mnt/tos函数本地挂载目录。

返回示例

HTTP/1.1 200 OK
Content-Type: application/json
{
    "ResponseMetadata": {
        "RequestId": "20230604110420****100232280022D31",
        "Action": "ListRevisions",
        "Version": "2024-06-06",
        "Service": "vefaas",
        "Region": "cn-beijing"
    },
    "Result": {
        "Items": [
            {
                "Id": "nwwzoaq1",
                "Envs": [
                    {
                        "Key": "ENV_NAME",
                        "Value": "ENV_VALUE"
                    }
                ],
                "Name": "official-site",
                "Source": "templates/vefaas-python38-default.zip",
                "Runtime": "python3.8/v1",
                "CodeSize": 1024,
                "MemoryMB": 1024,
                "TlsConfig": {
                    "EnableLog": true,
                    "TlsProjectId": "a40202c5-fe22-4ea7-a3a5-06d1bca77abcd",
                    "TlsTopicId": "2ff955cb-1f03-4b9b-8982-306e98c27890"
                },
                "VpcConfig": {
                    "EnableVpc": true,
                    "VpcId": "vpc-rragpljjr9q8v0x57hsabcd",
                    "SubnetIds": [
                        "subnet-milbxl46sdfk5smt1aa8defg"
                    ],
                    "SecurityGroupIds": [
                        "sg-rragprgn3fnkv0x584ghijk"
                    ],
                    "EnableSharedInternetAccess": true
                },
                "NasStorage": {
                    "EnableNas": true,
                    "NasConfigs": [
                        {
                            "FileSystemId": "cnas-cnbjb37c2193e51234",
                            "MountPointId": "mount-bce15678",
                            "RemotePath": "/",
                            "LocalMountPath": "/mnt/nas",
                            "Uid": 1000,
                            "Gid": 1000
                        }
                    ]
                },
                "SourceType": "tos",
                "Description": "This is a description",
                "MaxReplicas": 10,
                "CreationTime": "2020-05-20T13:00:55Z",
                "CodeSizeLimit": 64,
                "ExclusiveMode": true,
                "InitializerSec": 30,
                "MaxConcurrency": 100,
                "RequestTimeout": 30,
                "RevisionNumber": 1,
                "SourceLocation": "tos://tos-cn-beijing.volces.com/test.zip",
                "TosMountConfig": {
                    "EnableTos": true,
                    "MountPoints": [
                        {
                            "BucketPath": "/",
                            "LocalMountPath": "/mnt/tos",
                            "ReadOnly": false,
                            "BucketName": "ai-models",
                            "Endpoint": "http://tos-cn-beijing.ivolces.com"
                        }
                    ],
                    "Credentials": {
                        "AccessKeyId": "TZTJjfewfweiFJIEFLDMFDKFabcd",
                        "SecretAccessKey": "FweiffJEFJEWFJWERYTKRVFJlewjfwelFslfjsdflsjdfl=="
                    }
                },
                "RevisionDescription": "This is a revision description",
                "RevisionCreationTime": "2020-05-20T13:00:55Z"
            }
        ],
        "Total": 1
    }
}

错误码

当前接口暂无独立错误码,若接口调用返回异常,可参考 公共错误码 进行故障排查。