{"base_path":"/","components":null,"consumes":"[\"application/json;charset=UTF-8\"]","definitions":{"Api":{"example":{"backend_config":{"backend_paras":[{"backend_para_name":"d","name":"a","position":"REQUEST_PARAMETER_POSITION_PATH"},{"backend_para_name":"e","name":"b","position":"REQUEST_PARAMETER_POSITION_QUERY"},{"backend_para_name":"f","name":"c","position":"REQUEST_PARAMETER_POSITION_HEADER"}],"constant_paras":[{"description":"","name":"g","position":"REQUEST_PARAMETER_POSITION_PATH","type":"REQUEST_PARAMETER_TYPE_NUMBER","value":"1"},{"description":"","name":"h","position":"REQUEST_PARAMETER_POSITION_QUERY","type":"REQUEST_PARAMETER_TYPE_NUMBER","value":"1"},{"description":"","name":"j","position":"REQUEST_PARAMETER_POSITION_HEADER","type":"REQUEST_PARAMETER_TYPE_NUMBER","value":"1"}],"host":"www.baidu.com","path":"/testApi/{d}/{g}","protocol":"PROTOCOL_TYPE_HTTP","timeout":"100","type":"REQUEST_TYPE_GET"},"description":"","group_id":"677932edca42b85d82fcef909d8345f4","log_flag":false,"manager":"admin","name":"testApi","path":"/testApi/{a}","protocol":"PROTOCOL_TYPE_HTTP","publish_type":"PUBLISH_TYPE_PRIVATE","request_paras":[{"default_value":"","description":"","example_value":"","name":"a","necessary":false,"position":"REQUEST_PARAMETER_POSITION_PATH","type":"REQUEST_PARAMETER_TYPE_NUMBER"},{"default_value":"","description":"","example_value":"","name":"b","necessary":false,"position":"REQUEST_PARAMETER_POSITION_HEADER","type":"REQUEST_PARAMETER_TYPE_NUMBER"},{"default_value":"","description":"","example_value":"","name":"c","necessary":false,"position":"REQUEST_PARAMETER_POSITION_QUERY","type":"REQUEST_PARAMETER_TYPE_NUMBER"}],"request_type":"REQUEST_TYPE_GET","tags":["标签1","标签2"],"visibility":"WORKSPACE"},"properties":{"api_type":{"enum":["API_SPECIFIC_TYPE_CONFIGURATION","API_SPECIFIC_TYPE_SCRIPT","API_SPECIFIC_TYPE_MYBATIS","API_SPECIFIC_TYPE_GROOVY","API_SPECIFIC_TYPE_REGISTER","API_SPECIFIC_TYPE_ORCHESTRATE","API_TYPE_CREATE","API_TYPE_REGISTER"],"type":"string"},"auth_type":{"enum":["APP","IAM","NONE"],"type":"string"},"backend_config":{"$ref":"#/definitions/BackendConfig","description":"API后端配置。仅注册类API使用","type":"object"},"body":{"description":"请求体内容描述,仅注册类API使用。","type":"string"},"catalog_id":{"description":"目录ID","type":"string"},"data_mask_paras":{"description":"数据脱敏配置。","items":{"$ref":"#/definitions/DataMaskParas"},"type":"array"},"data_mask_switch":{"description":"数据脱敏开关。","type":"boolean"},"datasource_config":{"$ref":"#/definitions/DatasourceConfig","description":"API数据源配置。","type":"object"},"datasource_config_list":{"description":"多数据源配置信息,仅Groovy类API使用。","items":{"$ref":"#/definitions/DatasourceConfig"},"type":"array"},"description":{"description":"api 描述","type":"string"},"groovy_content":{"description":"Groovy文本,仅Groovy类API使用。","type":"string"},"log_flag":{"description":"是否启用访问日志","type":"boolean"},"manager":{"description":"API审核人。","type":"string"},"name":{"description":"api 名称","type":"string"},"path":{"description":"API路径。","type":"string"},"protocol":{"enum":["PROTOCOL_TYPE_HTTP","PROTOCOL_TYPE_HTTPS"],"type":"string"},"publish_type":{"enum":["PUBLISH_TYPE_PUBLIC","PUBLISH_TYPE_PRIVATE"],"type":"string"},"request_paras":{"description":"API请求参数列表。","items":{"$ref":"#/definitions/RequestPara"},"type":"array"},"request_type":{"enum":["REQUEST_TYPE_POST","REQUEST_TYPE_GET"],"type":"string"},"retention_period":{"description":"最低保留期限,单位小时。","type":"integer"},"tags":{"description":"标签。","example":["标签1","标签2"],"items":{"type":"string"},"type":"array"},"visibility":{"enum":["WORKSPACE","PROJECT","DOMAIN"],"type":"string"}},"type":"object"},"ApiRegisterResult":{"example":{"id":"6b9e682fd6d0ef7c0f674701adb20762"},"properties":{"id":{"description":"创建成功的API ID","type":"string"}},"type":"object"},"ApiRequestPara":{"properties":{"condition":{"description":"操作符","enum":["CONDITION_TYPE_EQ","CONDITION_TYPE_NE","CONDITION_TYPE_GT","CONDITION_TYPE_GE","CONDITION_TYPE_LT","CONDITION_TYPE_LE","CONDITION_TYPE_LIKE","CONDITION_TYPE_LIKE_L","CONDITION_TYPE_LIKE_R"],"type":"string"},"mapping":{"description":"映射字段","type":"string"},"name":{"description":"参数名称","type":"string"}},"type":"object"},"ApiResponsePara":{"properties":{"description":{"description":"参数描述","type":"string"},"example_value":{"description":"参数示例值","type":"string"},"field":{"description":"绑定的表字段","type":"string"},"name":{"description":"参数名","type":"string"},"type":{"description":"参数类型","enum":["REQUEST_PARAMETER_TYPE_NUMBER","REQUEST_PARAMETER_TYPE_STRING"],"type":"string"}},"type":"object"},"BackendConfig":{"properties":{"backend_paras":{"description":"API后端参数","items":{"$ref":"#/definitions/BackendRequestPara"},"type":"array"},"constant_paras":{"description":"后端常量参数","items":{"$ref":"#/definitions/BackendConstant"},"type":"array"},"host":{"description":"后端host","type":"string"},"path":{"description":"后端请求Path","type":"string"},"protocol":{"description":"后端请求协议类型","enum":["PROTOCOL_TYPE_HTTP","PROTOCOL_TYPE_HTTPS"],"type":"string"},"timeout":{"description":"后端超时时间","format":"int32","type":"integer"},"type":{"description":"后端请求类型","enum":["REQUEST_TYPE_POST","REQUEST_TYPE_GET"],"type":"string"}},"type":"object"},"BackendConstant":{"properties":{"description":{"description":"常量参数描述","type":"string"},"name":{"description":"常量参数名","type":"string"},"position":{"description":"常量参数位置","enum":["REQUEST_PARAMETER_POSITION_PATH","REQUEST_PARAMETER_POSITION_HEADER","REQUEST_PARAMETER_POSITION_QUERY"],"type":"string"},"type":{"description":"常量参数类型","enum":["REQUEST_PARAMETER_TYPE_NUMBER","REQUEST_PARAMETER_TYPE_STRING"],"type":"string"},"value":{"description":"常量参数值","type":"string"}},"type":"object"},"BackendRequestPara":{"properties":{"backend_para_name":{"description":"对应的后端参数","type":"string"},"name":{"description":"api请求参数名称","type":"string"},"position":{"description":"参数位置","enum":["REQUEST_PARAMETER_POSITION_PATH","REQUEST_PARAMETER_POSITION_HEADER","REQUEST_PARAMETER_POSITION_QUERY"],"type":"string"}},"type":"object"},"DataMaskParas":{"properties":{"algorithm_name":{"description":"算法名称。","type":"string"},"algorithm_parameters":{"description":"参数。","type":"string"},"algorithm_type":{"description":"算法类型。","type":"string"},"column_name":{"description":"敏感字段。","type":"string"},"en_name":{"description":"算法名称。","type":"string"},"failure_policy":{"enum":["SKIP","INTERRUPT_AND_EXCEPTION","SET_NULL","DEFAULT_VALUE"],"type":"string"}},"type":"object"},"DatasourceConfig":{"properties":{"access_mode":{"description":"获取数据的模式","enum":["SQL","ROW_KEY","PREFIX_FILTER"],"type":"string"},"access_type":{"description":"取数方式","enum":["SCRIPT","CONFIGURAITON"],"type":"string"},"backend_paras":{"description":"API后端参数","items":{"$ref":"#/definitions/ApiRequestPara"},"type":"array"},"connection_id":{"description":"数据连接ID","type":"string"},"connection_name":{"description":"数据连接名称","type":"string"},"database":{"description":"数据库名","type":"string"},"datatable":{"description":"数据表名称","type":"string"},"order_paras":{"description":"排序参数","items":{"$ref":"#/definitions/DatasourceOrderPara"},"type":"array"},"pagination":{"enum":["DEFAULT","CUSTOM"],"type":"string"},"queue":{"description":"DLI的队列名称","type":"string"},"response_paras":{"description":"配置类API返回参数","items":{"$ref":"#/definitions/ApiResponsePara"},"type":"array"},"sql":{"description":"脚本模式下的sql语句","type":"string"},"table_id":{"description":"数据表ID","type":"string"},"total_size_sql":{"description":"总条数计算脚本SQL。","type":"string"},"type":{"description":"数据源的类型","enum":["MYSQL","DLI","DWS","HIVE","HBASE"],"type":"string"}},"type":"object"},"DatasourceOrderPara":{"properties":{"description":{"description":"排序参数描述信息。","type":"string"},"field":{"description":"对应的参数字段","type":"string"},"name":{"description":"排序参数名称","type":"string"},"optional":{"description":"是否可选","type":"boolean"},"order":{"description":"排序参数顺序","format":"int32","type":"integer"},"sort":{"description":"排序方式","enum":["ASC","DESC","CUSTOM"],"type":"string"}},"type":"object"},"ErrorResponse":{"properties":{"error_code":{"description":"错误码","example":"DLS.1000","maxLength":128,"minLength":1,"type":"string"},"error_msg":{"description":"错误描述","example":"process failed","maxLength":10240,"minLength":1,"type":"string"}},"type":"object"},"RequestPara":{"properties":{"default_value":{"description":"默认值","type":"string"},"description":{"description":"参数的描述","type":"string"},"example_value":{"description":"实例值","type":"string"},"name":{"description":"参数名","type":"string"},"necessary":{"description":"参数是否必填","type":"boolean"},"position":{"description":"参数的位置","enum":["REQUEST_PARAMETER_POSITION_PATH","REQUEST_PARAMETER_POSITION_HEADER","REQUEST_PARAMETER_POSITION_QUERY"],"type":"string"},"support_null":{"description":"支持NULL值。","type":"boolean"},"type":{"description":"参数的类型","enum":["REQUEST_PARAMETER_TYPE_NUMBER","REQUEST_PARAMETER_TYPE_STRING"],"type":"string"}},"type":"object"}},"description":null,"group_id":"23bb69798aaf409da161a43a90617121","host":"dayu.cn-north-4.myhuaweicloud.com","id":"c303f6182fc84a4ca5736c7bbd573513","info_version":"v1","method":"post","name":"CreateApi","parameters":{},"paths":{"/v1/{project_id}/service/apis":{"post":{"description":"创建API。","operationId":"CreateApi","parameters":[{"description":"用户Token,使用[Token认证](dataartsstudio_02_0010.xml)时必选。通过调用“获取用户Token”接口获取响应消息头中X-Subject-Token的值。","in":"header","name":"X-Auth-Token","required":true,"type":"string"},{"description":"工作空间ID,获取方法请参见[实例ID和工作空间ID](dataartsstudio_02_0350.xml)。","in":"header","name":"workspace","required":true,"type":"string"},{"description":"数据服务的版本类型,指定SHARED共享版或EXCLUSIVE专享版。","enum":["SHARED","EXCLUSIVE"],"in":"header","name":"Dlm-Type","required":false,"type":"string"},{"default":"application/json","description":"消息体的类型(格式),有Body体的情况下必选,没有Body体无需填写。如果请求消息体中含有中文字符,则需要通过charset=utf8指定中文字符集,例如取值为:application/json;charset=utf8。","in":"header","name":"Content-Type","required":true,"type":"string"},{"description":"项目ID,获取方法请参见[项目ID和账号ID](projectid_accountid.xml)。","in":"path","name":"project_id","required":true,"type":"string"},{"description":"API 信息。","in":"body","name":"CreateApiRequestBody","required":true,"schema":{"$ref":"#/definitions/Api"}}],"produces":["application/json"],"responses":{"200":{"description":"Success。","examples":{"application/json":{"id":"6b9e682fd6d0ef7c0f67470124b20762"}},"schema":{"$ref":"#/definitions/ApiRegisterResult"}},"400":{"description":"BadRequest。","schema":{"$ref":"#/definitions/ErrorResponse"}}},"summary":"创建API","tags":["API管理接口"],"x-api-type":"dataservice-openapi","x-is-registered":"Y","x-support-sdk":"Y"}}},"product_short":"DataArtsStudio","region_id":"cn-north-4","schemes":["HTTPS"],"security_definitions":null,"summary":"创建API","tags":"API管理接口","uri":null,"version":"2.0"}