{"base_path":null,"components":null,"consumes":"[\"application/json\",\"application/json;charset=utf-8\"]","definitions":{"AccessPolicyInfo":{"properties":{"access_control_type":{"description":"访问控制类型。默认为接入类型\n* ACCESS_TYPE: 接入类型\n* IP_WHITE_LIST: IP白名单","enum":["ACCESS_TYPE","IP_WHITE_LIST"],"example":"ACCESS_TYPE","type":"string"},"blacklist_type":{"description":"黑名单类型,当前黑名单只支持互联网。\n* INTERNET: 互联网","enum":["INTERNET"],"example":"INTERNET","maxLength":50,"minLength":0,"type":"string"},"ip_list":{"description":"策略的ip列表。","items":{"$ref":"#/definitions/IpInfo"},"maxItems":1000,"minItems":0,"type":"array"},"ip_total_count":{"description":"策略总数。","maximum":1000,"minimum":0,"readOnly":true,"type":"integer"},"is_block_all":{"default":false,"description":"IP白名单是否禁止所有Ip接入。is_enable为false时,无法修改此值。此值也只能单独更新。","type":"boolean"},"is_enable":{"default":false,"description":"IP白名单是否生效。只能单独更新,此值的优先级最高,传此值只修改该策略是否生效。","type":"boolean"},"policy_name":{"description":"策略名。","maxLength":50,"minLength":0,"type":"string"}}},"AccessPolicyObjectInfo":{"properties":{"object_id":{"description":"黑名单中的对象id。","maxLength":255,"minLength":0,"type":"string"},"object_name":{"description":"对象名。后续此参数不会校验。","maxLength":255,"minLength":0,"type":"string","x-isSensitive":true},"object_type":{"description":"对象类型。\n* USER: 用户\n* USERGROUP: 用户组","enum":["USER","USERGROUP"],"example":"USER","type":"string"}},"required":["object_id","object_type"]},"BaseResponse":{"description":"API响应基类。","properties":{"encoded_authorization_message":{"description":"加密后的详细拒绝原因,用户可以自行调用STS服务的decode-authorization-message接口进行解密。","readOnly":true,"type":"string"},"error_code":{"description":"错误码。","maxLength":12,"minLength":0,"type":"string"},"error_msg":{"description":"错误描述。","maxLength":1000,"minLength":0,"type":"string"}}},"CreateAccessPolicyReq":{"properties":{"policy":{"$ref":"#/definitions/AccessPolicyInfo","description":"接入策略信息。"},"policy_objects_list":{"description":"策略应用对象列表。","items":{"$ref":"#/definitions/AccessPolicyObjectInfo"},"maxItems":2000,"minItems":0,"type":"array","x-maxLength":2000,"x-minLength":0}},"required":["policy"]},"IpInfo":{"properties":{"ip_address":{"description":"ip地址。","maxLength":255,"minLength":0,"type":"string"},"subnet_mask":{"description":"子网掩码。","maxLength":255,"minLength":0,"type":"string"}},"required":["ip_address","subnet_mask"]}},"description":null,"group_id":"7383c32d5d5e4d0481c071faeb994404","host":"workspace.cn-north-4.myhuaweicloud.com","id":"7f195d820c124592a7bbc0856ead8534","info_version":"v2","method":"post","name":"CreateAccessPolicy","parameters":{"Content-Type":{"description":"发送的实体的MIME类型,如:application/json。","in":"header","maxLength":255,"minLength":1,"name":"Content-Type","required":true,"type":"string","x-example":"application/json"},"X-Auth-Token":{"description":"用户Token。\n通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。","in":"header","maxLength":64000,"minLength":1,"name":"X-Auth-Token","required":false,"type":"string","x-annotations":["@Size(max = 64000, min = 1)"],"x-example":"MIIDkgYJKoZIhvcNAQcCoIIDgzCCXXXXXX..."},"project_id":{"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"}},"paths":{"/v2/{project_id}/access-policy":{"post":{"consumes":["application/json"],"description":"该接口用于创建接入策略。","operationId":"CreateAccessPolicy","parameters":[{"$ref":"#/parameters/X-Auth-Token"},{"$ref":"#/parameters/Content-Type"},{"$ref":"#/parameters/project_id"},{"description":"创建请求体。","in":"body","name":"CreateAccessPolicyRequestBody","required":true,"schema":{"$ref":"#/definitions/CreateAccessPolicyReq"}}],"produces":["application/json"],"responses":{"200":{"description":"正常。"},"400":{"description":"由于包含语法错误,当前请求无法被服务器理解。","schema":{"$ref":"#/definitions/BaseResponse"}},"401":{"description":"鉴权失败。","schema":{"$ref":"#/definitions/BaseResponse"}},"403":{"description":"没有操作权限。","schema":{"$ref":"#/definitions/BaseResponse"}},"404":{"description":"找不到资源。","schema":{"$ref":"#/definitions/BaseResponse"}},"405":{"description":"请求中指定的方法不被允许。","schema":{"$ref":"#/definitions/BaseResponse"}},"500":{"description":"服务内部错误,具体返回错误码请参见错误码说明。","schema":{"$ref":"#/definitions/BaseResponse"}},"503":{"description":"服务不可用。","schema":{"$ref":"#/definitions/BaseResponse"}}},"schemes":["https"],"summary":"创建接入策略","tags":["AccessPolicy"],"x-addValid":true,"x-api-type":"open-api","x-apiexplorer-hide":"N","x-apig-group":"public,internal_token","x-apigateway-request-type":"public","x-imports":["com.huawei.clouds.wushan.auth.token.IamAuthMeta","com.huawei.clouds.wushan.auth.token.IamAuthLevel","com.huawei.clouds.wushan.integration.common.auth.EnableAuth","com.huawei.clouds.wushan.cts.meta.CtsMeta"],"x-is-registered":"Y","x-methodAnnotations":["@EnableAuth","@IamAuthMeta(authLevel = IamAuthLevel.PROJECT, abacAction = \"workspace:accessPolicies:create\", authContextInitializerName = \"workspaceCommonAuthContextInitializer\", needApigwJwtAuthCheck = false, needRbacCheck = false)","@CtsMeta(serviceType = \"Workspace\", resourceType = \"workspace\", traceName = \"createAccessPolicy\")"],"x-request-examples-1":{"policy":{"blacklist_type":"INTERNET","policy_name":"PRIVATE_ACCESS"}},"x-request-examples-url-1":"post /v2/{project_id}/access-policy","x-support-sdk":"Y"}}},"product_short":"Workspace","region_id":"cn-north-4","schemes":["HTTPS"],"security_definitions":{"apig-auth-app":{"in":"header","name":"Authorization","type":"apiKey","x-apigateway-auth-type":"AppSigv1"},"apig-auth-iam":{"in":"header","name":"unused","type":"apiKey","x-apigateway-auth-type":"IAM"},"apig-auth-iam-used-authn5":{"in":"header","name":"unused","type":"apiKey","x-apigateway-auth-opt":{"inner-auth-type":"iam_auth_n5"},"x-apigateway-auth-type":"IAM"}},"summary":"创建接入策略","tags":"策略组","uri":null,"version":"2.0"}