全局搜索
功能介绍
全局搜索
调用方法
请参见如何调用API。
URI
GET /v2/{project_id}/factory/search
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
project_id |
是 |
String |
项目ID,获取方法请参见项目ID和账号ID。 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
workspace_id |
否 |
String |
搜索空间范围: 默认不传参,在全部空间内搜索。
|
search_text |
是 |
String |
全局搜索关键字,请输入至少两位字符。 |
job_type |
否 |
String |
作业类型: (多选)样例: job_type=BATCH 默认为全部。
|
script_type |
否 |
String |
脚本类型: (多选)样例: script_type=HIVE,DLI。 默认为全部,不过滤任何类型脚本。
|
node_type |
否 |
String |
节点类型: (多选)节点类型列表。样例: node_type=com.cloud.datacraft.processactivity.ExecuteHiveJob 默认为全部。
|
new_save_or_commit |
否 |
String |
最新修改: 样例: new_save_or_commit=save 默认为save: 最新保存
|
owners |
否 |
String |
责任人名称: (多选)人员列表或我的节点。样例: owners=dayu_wm 默认不过滤责任人。 |
doc_types |
否 |
String |
搜索范围: (多选)样例: doc_types=script 默认为全部。
|
begin_time |
否 |
Long |
开始时间,配合结束时间参数使用,默认没有时间范围。样例: begin_time=1746633600000 |
end_time |
否 |
Long |
结束时间,配合开始时间参数使用,默认没有时间范围。样例: endTime=1746806399999 |
limit |
否 |
Integer |
分页返回结果,指定每页最大记录数,范围[1,100]。样例: limit=10 默认值: 10。 |
offset |
否 |
Integer |
分页的起始页,取值范围大于等于0。样例: offset=0 默认值: 0。 |
if_query_parameters |
否 |
String |
是否搜索配置参数部分的内容: 样例: if_query_parameters=false 默认为false: 不搜索配置参数部分的内容
|
match_type |
否 |
Integer |
匹配方式: 样例: match_type=0 默认为0: 通用。
|
schedule_state |
否 |
String |
调度状态: 仅支持作业查找场景,需配置new_save_or_commit参数为commit 默认为全部。
|
is_exact |
否 |
String |
是否精确搜索: 开启后配合exact_field参数使用。 默认为false: 非精确搜索
|
exact_field |
否 |
String |
精确查询的字段, 开启精确搜索时生效:
|
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
workspace |
是 |
String |
工作空间ID,获取方法请参见实例ID和工作空间ID。 |
X-Auth-Token |
否 |
String |
IAM Token,通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值),使用Token认证时必选,最小长度:0,最大长度:4096。 |
响应参数
状态码:200
参数 |
参数类型 |
描述 |
---|---|---|
limit |
Integer |
分页大小限制。 取值范围[1,100]。 |
offset |
Integer |
当前所在分页。 |
search_details |
Array of SearchDetailV2 objects |
查询成功,返回搜索结果。 |
total_hits |
Integer |
成功命中数量。 |
参数 |
参数类型 |
描述 |
---|---|---|
id |
String |
唯一标识符 |
tenant_id |
String |
租户ID |
project_id |
String |
项目ID |
dgc_instance_id |
String |
DGC实例ID |
workspace |
String |
工作空间ID |
doc_type |
String |
搜索范围: (多选) 默认为全部。
|
owner |
String |
负责人 |
new_save_or_commit |
String |
最新修改: 默认为save: 最新保存
|
version |
Integer |
数字版本号或草稿标识 |
last_modified_time |
Long |
最后修改时间 |
job_name |
String |
作业名称 |
job_type |
String |
作业类型: (多选)样例: job_type=BATCH 默认为全部。
|
job_params |
String |
作业参数 |
node_name |
String |
节点名称 |
node_type |
String |
节点类型: (多选)节点类型列表。 默认为全部。
|
script_name |
String |
脚本名称 |
script_type |
String |
脚本类型: (多选)样例: script_type=HIVE,DLI。 默认为全部,不过滤任何类型脚本。
|
script_params |
String |
脚本参数 |
cdm_cluster_name |
String |
CDM集群名称 |
cdm_job_name |
String |
CDM作业名称 |
cdm_params |
String |
CDM参数 |
workspace_name |
String |
工作空间名称 |
job_id |
String |
作业ID |
script_id |
String |
脚本ID |
single_node_job_type |
String |
单节点作业类型 |
schedule_state |
String |
调度状态: 默认为全部。
|
状态码:400
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
错误码。 |
error_msg |
String |
错误描述。 |
请求示例
全局搜索关键字“select”,当前分页为第1页,单页最大数量限制为10。
GET /v2/62099355b894428e8916573ae635f1f9/search?search_text=select&offset=0&limit=10
响应示例
状态码:200
查询成功,返回搜索结果
{
"limit" : 10,
"offset" : 0,
"search_details" : [ {
"dgc_instance_id" : "9e763f354c6e46e1a87e2f63fc471d85",
"doc_type" : "node",
"id" : "ClvD7ZQBjnPSvBMriixA",
"job_id" : "549",
"job_name" : "job_9944",
"job_type" : "BATCH",
"last_modified_time" : 1739155370115,
"new_save_or_commit" : "save",
"node_name" : "DLI_SQL_4403",
"node_type" : "com.cloud.datacraft.activity.DLISQL",
"owner" : "ei_dlf_l00341563",
"project_id" : "62099355b894428e8916573ae635f1f9",
"tenant_id" : "61c2cde19d9c47cfb2123d4c8ec0d1e8",
"version" : 0,
"workspace" : "1390a9d8c7154126ad662be0f2ebe2e0",
"workspace_name" : "testRDS"
} ],
"total_hits" : 1
}
状态码:400
查询失败,返回错误信息。
{
"error_code" : "DLF.3051",
"error_msg" : "The request parameter is invalid."
}
SDK代码示例
SDK代码示例如下。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
package com.huaweicloud.sdk.test;
import com.huaweicloud.sdk.core.auth.ICredential;
import com.huaweicloud.sdk.core.auth.BasicCredentials;
import com.huaweicloud.sdk.core.exception.ConnectionException;
import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
import com.huaweicloud.sdk.core.exception.ServiceResponseException;
import com.huaweicloud.sdk.dataartsstudio.v1.region.DataArtsStudioRegion;
import com.huaweicloud.sdk.dataartsstudio.v1.*;
import com.huaweicloud.sdk.dataartsstudio.v1.model.*;
public class ShowFactoryFullTextSolution {
public static void main(String[] args) {
// The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
// In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
String ak = System.getenv("CLOUD_SDK_AK");
String sk = System.getenv("CLOUD_SDK_SK");
String projectId = "{project_id}";
ICredential auth = new BasicCredentials()
.withProjectId(projectId)
.withAk(ak)
.withSk(sk);
DataArtsStudioClient client = DataArtsStudioClient.newBuilder()
.withCredential(auth)
.withRegion(DataArtsStudioRegion.valueOf("<YOUR REGION>"))
.build();
ShowFactoryFullTextRequest request = new ShowFactoryFullTextRequest();
try {
ShowFactoryFullTextResponse response = client.showFactoryFullText(request);
System.out.println(response.toString());
} catch (ConnectionException e) {
e.printStackTrace();
} catch (RequestTimeoutException e) {
e.printStackTrace();
} catch (ServiceResponseException e) {
e.printStackTrace();
System.out.println(e.getHttpStatusCode());
System.out.println(e.getRequestId());
System.out.println(e.getErrorCode());
System.out.println(e.getErrorMsg());
}
}
}
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# coding: utf-8
import os
from huaweicloudsdkcore.auth.credentials import BasicCredentials
from huaweicloudsdkdataartsstudio.v1.region.dataartsstudio_region import DataArtsStudioRegion
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkdataartsstudio.v1 import *
if __name__ == "__main__":
# The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
# In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
ak = os.environ["CLOUD_SDK_AK"]
sk = os.environ["CLOUD_SDK_SK"]
projectId = "{project_id}"
credentials = BasicCredentials(ak, sk, projectId)
client = DataArtsStudioClient.new_builder() \
.with_credentials(credentials) \
.with_region(DataArtsStudioRegion.value_of("<YOUR REGION>")) \
.build()
try:
request = ShowFactoryFullTextRequest()
response = client.show_factory_full_text(request)
print(response)
except exceptions.ClientRequestException as e:
print(e.status_code)
print(e.request_id)
print(e.error_code)
print(e.error_msg)
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
package main
import (
"fmt"
"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
dataartsstudio "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dataartsstudio/v1"
"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dataartsstudio/v1/model"
region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dataartsstudio/v1/region"
)
func main() {
// The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
// In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
ak := os.Getenv("CLOUD_SDK_AK")
sk := os.Getenv("CLOUD_SDK_SK")
projectId := "{project_id}"
auth := basic.NewCredentialsBuilder().
WithAk(ak).
WithSk(sk).
WithProjectId(projectId).
Build()
client := dataartsstudio.NewDataArtsStudioClient(
dataartsstudio.DataArtsStudioClientBuilder().
WithRegion(region.ValueOf("<YOUR REGION>")).
WithCredential(auth).
Build())
request := &model.ShowFactoryFullTextRequest{}
response, err := client.ShowFactoryFullText(request)
if err == nil {
fmt.Printf("%+v\n", response)
} else {
fmt.Println(err)
}
}
|
更多编程语言的SDK代码示例,请参见API Explorer的代码示例页签,可生成自动对应的SDK代码示例。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
package com.huaweicloud.sdk.test;
import com.huaweicloud.sdk.core.auth.ICredential;
import com.huaweicloud.sdk.core.auth.BasicCredentials;
import com.huaweicloud.sdk.core.exception.ConnectionException;
import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
import com.huaweicloud.sdk.core.exception.ServiceResponseException;
import com.huaweicloud.sdk.dataartsstudio.v1.region.DataArtsStudioRegion;
import com.huaweicloud.sdk.dataartsstudio.v1.*;
import com.huaweicloud.sdk.dataartsstudio.v1.model.*;
public class ShowFactoryFullTextSolution {
public static void main(String[] args) {
// The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
// In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
String ak = System.getenv("CLOUD_SDK_AK");
String sk = System.getenv("CLOUD_SDK_SK");
String projectId = "{project_id}";
ICredential auth = new BasicCredentials()
.withProjectId(projectId)
.withAk(ak)
.withSk(sk);
DataArtsStudioClient client = DataArtsStudioClient.newBuilder()
.withCredential(auth)
.withRegion(DataArtsStudioRegion.valueOf("<YOUR REGION>"))
.build();
ShowFactoryFullTextRequest request = new ShowFactoryFullTextRequest();
try {
ShowFactoryFullTextResponse response = client.showFactoryFullText(request);
System.out.println(response.toString());
} catch (ConnectionException e) {
e.printStackTrace();
} catch (RequestTimeoutException e) {
e.printStackTrace();
} catch (ServiceResponseException e) {
e.printStackTrace();
System.out.println(e.getHttpStatusCode());
System.out.println(e.getRequestId());
System.out.println(e.getErrorCode());
System.out.println(e.getErrorMsg());
}
}
}
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# coding: utf-8
import os
from huaweicloudsdkcore.auth.credentials import BasicCredentials
from huaweicloudsdkdataartsstudio.v1.region.dataartsstudio_region import DataArtsStudioRegion
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkdataartsstudio.v1 import *
if __name__ == "__main__":
# The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
# In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
ak = os.environ["CLOUD_SDK_AK"]
sk = os.environ["CLOUD_SDK_SK"]
projectId = "{project_id}"
credentials = BasicCredentials(ak, sk, projectId)
client = DataArtsStudioClient.new_builder() \
.with_credentials(credentials) \
.with_region(DataArtsStudioRegion.value_of("<YOUR REGION>")) \
.build()
try:
request = ShowFactoryFullTextRequest()
response = client.show_factory_full_text(request)
print(response)
except exceptions.ClientRequestException as e:
print(e.status_code)
print(e.request_id)
print(e.error_code)
print(e.error_msg)
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
package main
import (
"fmt"
"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
dataartsstudio "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dataartsstudio/v1"
"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dataartsstudio/v1/model"
region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/dataartsstudio/v1/region"
)
func main() {
// The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
// In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
ak := os.Getenv("CLOUD_SDK_AK")
sk := os.Getenv("CLOUD_SDK_SK")
projectId := "{project_id}"
auth := basic.NewCredentialsBuilder().
WithAk(ak).
WithSk(sk).
WithProjectId(projectId).
Build()
client := dataartsstudio.NewDataArtsStudioClient(
dataartsstudio.DataArtsStudioClientBuilder().
WithRegion(region.ValueOf("<YOUR REGION>")).
WithCredential(auth).
Build())
request := &model.ShowFactoryFullTextRequest{}
response, err := client.ShowFactoryFullText(request)
if err == nil {
fmt.Printf("%+v\n", response)
} else {
fmt.Println(err)
}
}
|
更多编程语言的SDK代码示例,请参见API Explorer的代码示例页签,可生成自动对应的SDK代码示例。
状态码
状态码 |
描述 |
---|---|
200 |
查询成功,返回搜索结果 |
400 |
查询失败,返回错误信息。 |