<spatialanalystJobs_uri>/topologyvalidator[.<format>]
拓扑检查作业资源根目录。通过对 topologyValidator 执行GET 请求,可获取当前系统的拓扑检查作业列表。通过 POST 请求可创建一个分析任务。
支持的方法:
支持的表述格式:RJSON、JSON、HTML、XML。
对如下 URI 执行 HTTP 请求,以 rjson 输出格式为例加以说明,其中,supermapiserver 是服务器名。
http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/topologyvalidator.rjson
获取拓扑检查作业列表。
对 topologyValidator 资源执行 GET 请求,在响应消息的实体主体里是一个拓扑检查资源描述集,其中单个资源描述的结构如下:
字段 | 类型 | 说明 |
id | String | 应用ID。 |
state | SparkJobState | 该任务的状态。包括执行状态、起止时间、耗时等。 |
setting | SparkJobSetting | 列举了任务配置的详细信息。 |
对 topologyValidator 资源执行 GET 请求,返回 rjson 格式的资源描述如下:
{
"id": "64e3f1e9_8e4f_42b5_9f98_af204be77880",
"setting": {
"DEFAULT_MASTER_ADRESS": "local[*] ",
"analyst": {
"datasetTopology": "smtiles_Jingjin_New_Region_1",
"inputValidating": "{\"type\":\"udb\",\"info\":[{\"server\":\"F:\\\\4.datastore\\\\Data\\\\data\\\\City - 副本 - 副本\\\\Jingjin.udb\",\"datasetNames\":[\"New_Region_1\"]}]}",
"rule": "RegionContainedByRegion",
"tolerance": ""
},
"appName": "topologyValidator",
"args": [
"--inputSource",
"{\"sliceNum\":20,\"type\":\"udb\",\"info\":[{\"server\":\"F:\\\\4.datastore\\\\Data\\\\data\\\\City - 副本 - 副本\\\\Jingjin.udb\",\"datasetNames\":[\"New_Region\"]}]}",
"--inputValidating",
"{\"type\":\"udb\",\"info\":[{\"server\":\"F:\\\\4.datastore\\\\Data\\\\data\\\\City - 副本 - 副本\\\\Jingjin.udb\",\"datasetNames\":[\"New_Region_1\"]}]}",
"--rule",
"RegionContainedByRegion",
"--output",
"{\"server\":\"192.168.120.21\",\"password\":\"supermap\",\"database\":\"supermap1\",\"datasetName\":\"analystResult_1597348849\",\"blockingWrite\":null,\"type\":\"pg\",\"user\":\"postgres\"}"
],
"contextSetting": null,
"input": {
"datasetInfo": {
"available": true,
"bounds": "Left=-97.1879129784341,Bottom=38.379098407748195,Right=749.938641932885,Top=433.65169599572",
"datasetName": "New_Region",
"datasetType": "REGION",
"epsgCode": -1000,
"name": "smtiles_Jingjin_New_Region",
"readOnly": false,
"type": "UDB",
"url": "F:\\4.datastore\\Data\\data\\City - 副本 - 副本\\Jingjin.udb"
},
"datasetName": "smtiles_Jingjin_New_Region",
"numSlices": 0,
"specField": null
},
"mainClass": "com.supermap.bdt.main.TopologyValidatorMain",
"output": {
"datasetName": "analystResult_1597348849",
"datasourceInfo": {
"alias": "supermap1_pg",
"connect": true,
"dataBase": "supermap1",
"driver": "PostgreSQL ANSI",
"engineType": "POSTGRESQL",
"exclusive": false,
"openLinkTable": false,
"password": "supermap",
"readOnly": false,
"server": "192.168.120.21",
"user": "postgres"
},
"outputPath": "F:\\1.package\\20171021\\supermap_iserver_901_15420_4680_win64_zip\\webapps\\iserver\\processingResultData\\Analyst\\64e3f1e9_8e4f_42b5_9f98_af204be77880\\topology.smwu",
"type": "pg"
},
"serviceInfo": {
"targetDataPath": "F:\\1.package\\20171021\\supermap_iserver_901_15420_4680_win64_zip\\webapps\\iserver\\processingResultData\\Analyst\\64e3f1e9_8e4f_42b5_9f98_af204be77880\\topology.smwu",
"targetServiceInfos": [
{
"serviceAddress": "http://supermapiserver:8090/iserver/services/map-topology22/rest",
"serviceType": "RESTMAP"
},
{
"serviceAddress": "http://supermapiserver:8090/iserver/services/data-topology22/rest",
"serviceType": "RESTDATA"
}
]
},
"serviceRoot": "http://supermapiserver:8090/iserver/services/",
"sparkLogFile": null
},
"state": {
"elapsedTime": 12651,
"endState": true,
"endTime": 1508833694778,
"errorMsg": null,
"errorStackTrace": null,
"publisherelapsedTime": 8446,
"runState": "FINISHED",
"startTime": 1508833669915
}
}
创建一个拓扑检查任务。
对 topologyValidator 资源执行 POST 请求,创建一个 拓扑检查作业任务,请求体需包含参数如下:
名称 | 类型 | 含义 |
input 【必填参数】 |
DatasetInputDataSetting |
|
analyst |
topologyValidatorAnalystSetting | 【必填参数】分析配置。传入时,需指定:
|
output 【选填参数】 |
FileSystemOutputSetting |
|
DatabaseOutputSetting |
|
对示例 topologyValidator 资源:http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/topologyvalidator.rjson 以输入形式为数据集名称,该数据集已注册到iServer。方式执行POST 请求,创建一个拓扑检查任务。请求体中的参数如下:
{
"input": {
"datasetName": "samples_processing_newyorkZone_R"
},
"analyst": {
"rule": "REGIONNOOVERLAPWITH",
"datasetTopology": "samples_processing_singleRegion_R",
"tolerance": ""
}
}
返回 rjson 格式的操作结果表述如下:
{
"newResourceID": "6d3baaab_1486_4a6d_b90d_f0ca51132dc2",
"newResourceLocation":"http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/topologyvalidator/6d3baaab_1486_4a6d_b90d_f0ca51132dc2",
"postResultType": "CreateChild",
"succeed": true
}
对示例 topologyValidator 资源:http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/topologyvalidator.rjson 执行 POST 请求,输入数据为存储于PostgreSQL 数据库的数据。 创建一个拓扑检查任务。请求体中的参数如下:
{
"input": {
"datasetInfo": {
"type": "REGION",
"name": "newyorkZone_R_41691623",
"datasourceConnectionInfo": {
"engineType": "POSTGRESQL",
"dataBase": "supermap",
"password": "supermap",
"user": "postgres",
"server": "192.168.120.21"
}
}
},
"analyst": {
"rule": "REGIONNOOVERLAPWITH",
"inputValidating": "{\"type\":\"pg\",\"info\":[{\"server\":\"192.168.120.21\",\"datasetNames\":[\"singleRegion_R_2022747537\"],\"database\":\"supermap\",\"user\":\"postgres\",\"password\":\"supermap\"}]}",
"tolerance": "0.001"
}
}
返回 rjson 格式的操作结果表述如下:
{
"newResourceID": "04483bb2_e9b1_4fe3_aa3d_39c4fdb84416",
"newResourceLocation": "http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/topologyvalidator/04483bb2_e9b1_4fe3_aa3d_39c4fdb84416",
"postResultType": "CreateChild",
"succeed": true
}
返回跟 GET 请求一样的 HTTP 响应头,但是没有响应实体。可以在不必传输整个响应内容的情况下,获取包含在响应消息头中的元数据信息。元数据信息包括媒体类型,字符编码,压缩编码,实体内容长度等。
HEAD 请求可以用来判断 topologyValidator 资源是否存在,或者客户端是否有权限访问 topologyValidator 资源。通过对加.<format>的 URI 执行 HEAD 请求,还可以快速判断 topologyValidator 资源是否支持<format>格式的表述。