调用CreateMountTarget接口创建挂载点。

接口说明

  • 在使用CreateMountTarget接口创建挂载点时部分资源的生成是异步完成的。因此在执行CreateMountTarget接口成功后,请先调用DescribeMountTargets接口查询挂载点状态,当挂载点状态为Active后再执行挂载文件系统操作,否则可能会挂载失败。
  • 调用此接口将自动创建操作所需的NAS服务关联角色。更多信息,请参见管理NAS服务关联角色

调试

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

请求参数

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

接口名称。

固定取值:CreateMountTarget。

DryRun Boolean false

校验是否有存量挂载点。

在创建CPFS文件系统挂载点时必填,不实际产生挂载点。

默认值:false。

FileSystemId String 174494****

文件系统ID。

NetworkType String Vpc

挂载点网络类型。

取值:

  • Vpc:专有网络
  • Classic:经典网络
AccessGroupName String classic-test

权限组名称。

当目标文件系统为通用型NAS或极速型NAS时,此参数必填。

默认权限组:DEFAULT_VPC_GROUP_NAME(专有网络默认权限组)、DEFAULT_CLASSIC_GROUP_NAME(经典网络默认权限组)。

VpcId String vpc-2zesj9afh3y518k9o****

专有网络ID。

当网络类型是专有网络,此字段必填且有意义。

VSwitchId String vsw-2zevmwkwyztjuoffg****

交换机ID。

当网络类型是专有网络,此字段必填且有意义。

SecurityGroupId String sg-bp1fg655nh68xyz9****

安全组ID。

EnableIpv6 Boolean true

是否创建IPv6挂载点。

取值:

  • true:创建
  • false:不创建
说明 当前仅华北5(呼和浩特)地域的极速型NAS支持IPv6功能,且该文件系统需要开启IPv6功能。

返回数据

名称 类型 示例值 描述
MountTargetDomain String 174494b666-x****.cn-hangzhou.nas.aliyuncs.com

IPv4挂载点。

MountTargetExtra Struct

挂载点信息集合。

DualStackMountTargetDomain String 174494b666-x****.dualstack.cn-hangzhou.nas.aliyuncs.com

IPv4和IPv6双栈挂载点。

RequestId String 70EACC9C-D07A-4A34-ADA4-77506C42****

请求ID。

示例

请求示例

http(s)://[Endpoint]/?Action=CreateMountTarget
&DryRun=false
&FileSystemId=174494****
&NetworkType=Vpc
&<公共请求参数>

正常返回示例

XML格式

<RequestId>70EACC9C-D07A-4A34-ADA4-77506C42****</RequestId>
<MountTargetDomain>174494b666-x****.cn-hangzhou.nas.aliyuncs.com</MountTargetDomain>
<MountTargetExtra>
    <DualStackMountTargetDomain>174494b666-x****.dualstack.cn-hangzhou.nas.aliyuncs.com</DualStackMountTargetDomain>
</MountTargetExtra>

JSON格式

{
    "RequestId": "70EACC9C-D07A-4A34-ADA4-77506C42****",
    "MountTargetDomain": "174494b666-x****.cn-hangzhou.nas.aliyuncs.com",
    "MountTargetExtra": {
        "DualStackMountTargetDomain": "174494b666-x****.dualstack.cn-hangzhou.nas.aliyuncs.com"
    }
}

错误码

HttpCode 错误码 错误信息 描述
202 RequestAccepted The request has been accepted by the server. 请求已被后端接受。
400 InvalidFileSystem.NotsupportedIPv6 The file system does not support IPv6. 该文件系统不支持IPv6。
400 InvalidVSwitch.Ipv6NotTurnOn The VSwitch you are currently using has not enabled the IPv6 function. Please enable this function first and try again. 您当前使用的交换机不支持IPv6功能,请开启此功能后重试。
400 IdempotentParameterMismatch The same client token was passed in to different parameters. 相同的ClientToken传入了不同的参数。
400 MissingParameter.AccessGroupName You must specify AccessGroupName when you create a standard or extreme file system mount target. 创建通用型或极速型文件系统挂载点时权限组参数必填。
400 InvalidVSwitchId.IpNotEnough The number of the specified VSwitch IP address is insufficient. 指定的交换机IP数量不足。
400 InvalidParameter.ConflictVpcCidr The specified VPC CIDR conflicts with the server. 指定的VPC网段与服务端冲突。
400 DryRunOperation The request is validated with DryRun flag set. 请求校验通过。
400 SubAccount.NoStandardSLRPermission The RAM user does not have the permission to create service linked role AliyunServiceRoleForNasStandard. Please authorize the RAM user the permission ram:CreateServiceLinkedRole. 当前RAM用户没有权限创建AliyunServiceRoleForNasStandard SLR角色,请授权RAM用户ram:CreateServiceLinkedRole权限。
403 OperationDenied.InvalidState The operation is not permitted when the status is processing. 状态处理中不允许此操作。
403 InvalidRamRole.NotExist The specified RAM role does not exist. 指定的RAM角色不存在。
403 InvalidRamRole.NoPermission The specified RAM role does not have sufficient permission. 指定的RAM角色权限不足。
403 InvalidMountTarget.AlreadyExisted The specified mount target already exists. 指定的挂载点已经存在。
403 Resource.OutOfStock The inventory of the specified zone is insufficient. 指定的可用区库存不足。
403 OperationDenied.MountTargetExceedLimit The maximum number of mount target in the specified file system is exceeded. 当前文件系统的挂载点达到上限。
404 InvalidParameter.VswNotFound The specified VSwitch does not exist. 指定的虚拟交换机不存在。
404 InvalidParameter.VpcNotFound The specified VPC does not exist. 指定的VPC网络不存在。
404 InvalidFileSystem.NotFound The specified file system does not exist. 指定的文件系统不存在。

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