{"base_path":null,"components":null,"consumes":"[\"application/json\"]","definitions":{"AttachInstancesDesktopInfo":{"description":"分配用户请求桌面信息。","properties":{"attach_user_infos":{"description":"待分配的用户信息列表。","items":{"$ref":"#/definitions/AttachInstancesUserInfo"},"maxItems":500,"minItems":0,"type":"array","x-maxLength":500,"x-minLength":0},"computer_name":{"description":"桌面名,桌面名必须保证唯一。只允许输入大写字母、小写字母、数字、中划线(-)和下划线(_);以字母开头且不允许以中划线(-)结尾;长度范围为[1-15]。","maxLength":15,"minLength":1,"type":"string"},"desktop_id":{"description":"待分配的桌面ID。","maxLength":255,"minLength":0,"type":"string"},"is_clear_data":{"default":true,"description":"该字段只有当解绑和绑定为同一个用户时生效。表示绑定时是否清理桌面数据,true:清理,false:不清理,默认值为true。","type":"boolean"},"user_email":{"description":"合法用户邮箱,桌面分配成功后系统会通过发送邮件的方式通知用户","maxLength":255,"minLength":0,"type":"string","x-isSensitive":true},"user_group":{"description":"桌面用户所属的用户组。\n\n- sudo:Linux管理员组。\n- default:Linux默认用户组。\n- administrators:Windows管理员组。管理员拥有对该桌面的完全访问权,可以做任何需要的更改(禁用操作除外)。\n- users:Windows标准用户组。标准用户可以使用大多数软件,并可以更改不影响其他用户的系统设置。","maxLength":255,"minLength":1,"type":"string"},"user_name":{"description":"桌面所属的用户,当桌面分配成功后此用户可以登录该桌面。只允许输入大写字母、小写字母、数字、中划线(-)和下划线(_)。域类型为LITE_AD时,使用小写字母或者大写字母开头,长度范围为[1-20]。当域类型为LOCAL_AD时,用户名可以使用小写字母或者大写字母或者数字开头,长度范围为[1-32]。Windows桌面用户最长支持20个字符,Linux桌面用户最长支持32个字符。","maxLength":32,"minLength":1,"type":"string","x-isSensitive":true}},"required":["desktop_id"]},"AttachInstancesReq":{"description":"分配用户请求。","properties":{"desktop_name_policy_id":{"description":"策略id,用于指定生成桌面名称策略,如果指定了桌面名称则优先使用指定的桌面名称。","maxLength":36,"minLength":0,"type":"string"},"desktops":{"description":"桌面信息列表。","items":{"$ref":"#/definitions/AttachInstancesDesktopInfo"},"maxItems":50,"minItems":1,"type":"array","x-maxLength":50,"x-minLength":1},"enterprise_project_id":{"default":"0","description":"企业项目ID,默认\"0\"","maxLength":36,"minLength":0,"type":"string"},"image_id":{"description":"模板ID,涉及变更镜像时需传(可选)","maxLength":255,"minLength":1,"type":"string"},"image_type":{"description":"镜像类型,涉及变更镜像时需传(可选)","maxLength":255,"minLength":0,"type":"string"},"os_type":{"description":"os类型,涉及变更镜像时需传(可选)","maxLength":255,"minLength":0,"type":"string"}},"required":["desktops"]},"AttachInstancesRsp":{"description":"分配用户响应。","properties":{"job_id":{"description":"创建分配桌面总任务id。","maxLength":255,"minLength":1,"type":"string"}}},"AttachInstancesUserInfo":{"description":"分配桌面用户信息。","properties":{"type":{"default":"USER","description":"对象类型,可选值为:\n- USER:用户。\n- GROUP:用户组。","enum":["USER","GROUP"],"maxLength":20,"minLength":1,"type":"string"},"user_group":{"description":"桌面用户所属的用户组。\n- sudo:Linux管理员组。\n- default:Linux默认用户组。\n- administrators:Windows管理员组。管理员拥有对该桌面的完全访问权,可以做任何需要的更改(禁用操作除外)。\n- users:Windows标准用户组。标准用户可以使用大多数软件,并可以更改不影响其他用户的系统设置。","maxLength":255,"minLength":1,"type":"string"},"user_id":{"description":"用户id","maxLength":255,"minLength":1,"type":"string"},"user_name":{"description":"桌面所属的用户,当桌面分配成功后此用户可以登录该桌面。只允许输入大写字母、小写字母、数字、中划线(-)和下划线(_)。域类型为LITE_AD时,使用小写字母或者大写字母开头,长度范围为[1-20]。当域类型为LOCAL_AD时,用户名可以使用小写字母或者大写字母或者数字开头,长度范围为[1-32]。Windows桌面用户最长支持20个字符,Linux桌面用户最长支持32个字符。","maxLength":32,"minLength":1,"type":"string","x-isSensitive":true}}},"BaseResponse":{"description":"API响应基类","properties":{"error_code":{"description":"错误码。","maxLength":12,"minLength":0,"type":"string"},"error_msg":{"description":"错误描述。","maxLength":1000,"minLength":0,"type":"string"}}}},"description":null,"group_id":"7383c32d5d5e4d0481c071faeb994404","host":"workspace.cn-north-4.myhuaweicloud.com","id":"ef151ca9ed6045c2ae088dc153b7b725","info_version":"v2","method":"post","name":"AttachInstances","parameters":{},"paths":{"/v2/{project_id}/desktops/attach":{"post":{"description":"将桌面分配给用户","operationId":"AttachInstances","parameters":[{"description":"用户Token。\n\n通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。","in":"header","maxLength":40000,"minLength":1,"name":"X-Auth-Token","required":true,"type":"string","x-annotations":"@Size(max = 40000, min = 1)","x-example":"MIIDkgYJKoZIhvcNAQcCoIIDgzCCXXXXXX...","x-is-registered":"N"},{"description":"发送的实体的MIME类型。","in":"header","maxLength":255,"minLength":1,"name":"Content-Type","required":false,"type":"string","x-annotations":"@Size(max = 255, min = 1)","x-example":"application/json"},{"description":"项目ID。","in":"path","maxLength":255,"minLength":1,"name":"project_id","required":true,"type":"string","x-annotations":"@Size(max = 255, min = 1)","x-example":"2b31ed520xxxxxxebedb6e57xxxxxxxx"},{"description":"分配用户的请求","in":"body","name":"AttachInstancesRequestBody","required":true,"schema":{"$ref":"#/definitions/AttachInstancesReq"}}],"responses":{"200":{"description":"正常","schema":{"$ref":"#/definitions/AttachInstancesRsp"}},"400":{"description":"由于包含语法错误,当前请求无法被服务器理解。","schema":{"$ref":"#/definitions/BaseResponse"}},"401":{"description":"鉴权失败。","schema":{"$ref":"#/definitions/BaseResponse"}},"403":{"description":"没有操作权限。","schema":{"$ref":"#/definitions/BaseResponse"}},"404":{"description":"找不到资源。","schema":{"$ref":"#/definitions/BaseResponse"}},"409":{"description":"操作冲突。","schema":{"$ref":"#/definitions/BaseResponse"}},"500":{"description":"服务内部错误,具体返回错误码请参见错误码说明。","schema":{"$ref":"#/definitions/BaseResponse"}}},"summary":"分配用户","tags":["Desktop"],"x-apiexplorer-hide":"N","x-apig-group":"internal_token,internal_appcode,public","x-apigateway-request-type":"public","x-is-registered":"Y","x-request-examples-1":{"desktops":{"computer_name":"string","desktop_id":"string","user_email":"string","user_group":"string","user_name":"string"},"image_id":"string","image_type":"string","os_type":"string"},"x-request-examples-text-1":{"desktops":{"computer_name":"string","desktop_id":"string","user_email":"string","user_group":"string","user_name":"string"},"image_id":"string","image_type":"string","os_type":"string"},"x-support-sdk":"Y","x-workspace-api-auth":"CBC"}}},"product_short":"Workspace","region_id":"cn-north-4","schemes":["HTTPS"],"security_definitions":null,"summary":"分配用户","tags":"桌面","uri":null,"version":"2.0"}