调用CreateProtocolService创建CPFS文件系统的协议服务,创建协议服务过程大约需要5~10分钟。

接口说明

  • 该接口仅适用于中国站。
  • 仅CPFS 2.3.0及以上版本支持协议服务。您可以通过调用DescribeFileSystems接口查询目标文件系统的版本号。
  • 协议服务规格

    协议服务包括两种协议类型:通用型和缓存型。缓存型相比通用型,提供热点数据缓存能力。在命中缓存的情况下,缓存型协议服务的带宽可超过CPFS文件系统的带宽,达到协议服务设定的最大带宽值。

    • 通用型:为CPFS提供NFS协议访问能力和目录级挂载点,用户无需配置POSIX客户端管理集群。该功能免费。
    • 缓存型:在通用型基础上提供基于LRU策略的服务端内存缓存。当数据缓存于内存中时,CPFS可提供更高的内网带宽。缓存型协议服务分为缓存1型和缓存2型两种协议服务规格,差异点为内网带宽大小和内存缓存大小。

      缓存型协议服务为收费服务,正在邀测。有关缓存型协议服务的付费方式,请参见计费项。如果您有任何反馈或疑问,欢迎加入钉钉用户群(钉钉群号:31045006299)与CPFS工程师进行交流讨论。

  • 协议类型

    仅支持NFSv3协议。

  • 其它
    • 一个CPFS文件系统只能创建一个协议服务。
    • 创建协议服务会消耗指定vSwitch上的IP地址(最多消耗32个IP地址),请确保目标vSwitch IP资源充足。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String CreateProtocolService

接口名称。固定取值:CreateProtocolService。

FileSystemId String cpfs-099394bd928c****

文件系统ID。

ProtocolSpec String General

协议服务的规格。

取值范围:

  • General

默认值:General。

Throughput Integer 8000

协议服务的带宽。

单位:MB/s。

ProtocolType String NFS

协议服务的协议类型。

取值范围:

  • NFS:协议服务支持NFS协议访问。

默认值:NFS。

Description String 此协议服务的描述。

协议服务的描述。控制台中显示为“协议服务名称”。

限制:

  • 长度为2~128个英文或中文字符。
  • 必须以大小写字母或中文开头,不能以http://https://开头。
  • 可以包含数字、半角冒号(:)、下划线(_)或者短划线(-)。
VpcId String vpc-2vct297b8157bth9z****

协议服务VpcId,需与文件系统VPC保持一致。

VSwitchId String vsw-2vc3c2lybvdllxyq4****

协议服务VSwitchId。

DryRun Boolean false

是否对此次创建请求执行预检。

预检操作会帮助您检查参数有效性、依赖条件等,并不会实际创建实例,也不会产生费用。

取值:

  • true:发送检查请求,不会创建协议服务。检查项包括是否填写了必需参数、请求格式、业务限制依赖条件。如果检查不通过,则返回对应错误。如果检查通过,则返回200 HttpCode,但ProtocolServiceId为空。
  • false(默认):发送正常请求,通过检查后直接创建实例。
ClientToken String 123e4567-e89b-12d3-a456-42665544****

保证请求幂等性,从您的客户端生成一个参数值,确保不同请求间该参数值唯一。

ClientToken只支持ASCII字符,且不能超过64个字符。更多信息,请参见如何保证幂等性

说明 若用户未指定,则系统自动使用API请求的RequestId作为ClientToken标识。每次API请求的RequestId可能不一样。

返回数据

名称 类型 示例值 描述
RequestId String 98696EF0-1607-4E9D-B01D-F20930B6****

请求ID。

ProtocolServiceId String ptc-197ed6a00f2b****

协议机集群ID。

示例

请求示例

http(s)://[Endpoint]/?Action=CreateProtocolService
&FileSystemId=cpfs-123****
&ProtocolSpec=General
&Throughput=8000
&ProtocolType=NFS
&Description=此协议服务的描述。
&VpcId=vpc-123****
&VSwitchId=vsw-123****
&DryRun=false
&ClientToken=123e4567-e89b-12d3-a456-42665544****
&公共请求参数

正常返回示例

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateProtocolServiceResponse>
    <RequestId>98696EF0-1607-4E9D-B01D-F20930B6****</RequestId>
    <ProtocolServiceId>ptc-123****</ProtocolServiceId>
</CreateProtocolServiceResponse>

JSON格式

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "98696EF0-1607-4E9D-B01D-F20930B6****",
  "ProtocolServiceId" : "ptc-123****"
}

错误码

HttpCode 错误码 错误信息 描述
400 MissingFileSystemId FileSystemId is mandatory for this action. 未指定FileSystemId参数。
400 MissingVpcId VpcId is mandatory for this action. 未指定VPC ID参数。
400 MissingVSwitchId VSwitchId is mandatory for this action. 未指定vSwitch ID参数。
403 InvalidProtocolSpec.NotSupported The specified protocol spec does not supported. 指定的ProtocolSpec不支持。
403 InvalidNetworkType.NotSupported The specified network type does not supported. 指定的网络类型不支持。
403 Instance.IncorrectStatus The specified instance is in an incorrect status. 当前状态不允许操作。
403 OperationDenied.ProtocolServiceExceedLimit The protocol service amount exceed file system limit. 协议服务数量超过文件系统限制。
403 PermissionDenied.CapacityTooLow Capacity of file system too low to subscribe protocol service. 容量低于10800GiB不允许开通协议服务。
403 PermissionDenied.ThroughputInvalid Standard protocol service should not specified throughput. 通用型协议服务不允许指定服务带宽。
403 PermissionDenied.ThroughputTooSmall Throughput of protocol service too small. 协议服务带宽太小,不满足开通条件。
403 PermissionDenied.ThroughputExceed Throughput of protocol service must less than throughput of file system. 协议服务的带宽不允许超过文件系统的带宽。
403 InvalidProtocolType.NotSupported The specified protocol type does not supported. 指定的协议类型不支持。
403 InvalidVSwitchId.IpShortage The specified vswitch ip shortage. 指定的vSwitch可用IP不足。
403 InvalidFset.InUse Fset already used by other export. 指定的Fileset已被使用。
403 InvalidFileSystemPath.InvalidCharacters The specified filesystem path contains invalid characters. 指定的文件系统路径包含非法字符。
403 MntPathConflict.InvalidParam FilesetId and Path must and can only be specified one. Fileset和Path只能且必须指定一个。
403 OperationDenied.TooManyDepth The operation is denied due to Fsets path too deep. 文件系统路径深度超过阈值。
403 OperationDenied.InvalidState The operation is denied due to invalid file system state. 当前文件系统状态不支持该操作。
403 OperationDenied.NoProtocolServiceQuota No protocol service quota. 当前文件系统协议服务配额用尽。
403 OperationDenied.NotSupported The operation is denied due to not supported. 文件系统不支持协议机服务。
403 PermissionDenied.CLThroughputInvalid Throughput of caching protocol service is invalid. 缓存型协议服务带宽无效。
403 InvalidVpcId.CrossVpcNotSupport. Cross VPC not support. 不支持协议服务和文件系统跨VPC。
404 InvalidParameter.VpcNotFound The specified VPC does not exist. 指定的VPC网络不存在。
404 InvalidParameter.VswNotFound The specified VSwitch does not exist. 指定的虚拟交换机不存在。
404 InvalidFileSystem.NotFound The specified file system does not exist. 指定的文件系统不存在。
404 InvalidDescription.InvalidFormat Description format is invalid. 指定的描述格式非法。
404 InvalidVpcId.ConflictVpcCidr Vpc cidr conflict with file system 指定VPC与文件系统VPC网段重叠。
404 InvalidAccessGroupName.NotFound The specified access group does not exist. 指定的权限组不存在。
404 InvalidAccessGroupName.NotAccessRule There has no rule in access group. 指定的权限组中无规则。
404 OperationDenied.NoStock The operation is denied due to no stock. 文件系统无库存。
404 PathNotExistInFileSystem.InvalidParam Given path does not exist in file system. 文件系统中不存在指定的路径。
404 InvalidFsetId.NotFound The specified Fileset ID does not exist. 指定的Fileset不存在。
404 InvalidParameter.VpcVswitchMismatch Given vSwitch mismatch with given VPC. 指定的VPC和vSwitch不匹配。

访问错误中心查看更多错误码。