/
api.txt
272 lines (224 loc) · 12.2 KB
/
api.txt
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
Geoportal Server API
HTTP [any] geoportal/elastic/*
HTTP GET geoportal/rest/geoportal
HTTP DELETE/PUT geoportal/rest/metadata/deleteItems
HTTP GET geoportal/rest/metadata/item/{id}
HTTP GET geoportal/rest/metadata/item/{id}/xml
HTTP GET geoportal/rest/metadata/item/{id}/html
HTTP PUT geoportal/rest/metadata/item
HTTP PUT geoportal/rest/metadata/item/{id}
HTTP DELETE geoportal/rest/metadata/item/{id}
HTTP GET geoportal/rest/metadata/realias
HTTP GET geoportal/rest/metadata/reindex
HTTP GET/POST geoportal/rest/metadata/search
HTTP PUT geoportal/rest/metadata/setAccess
HTTP PUT geoportal/rest/metadata/setApprovalStatus
HTTP PUT geoportal/rest/metadata/setOwner
HTTP POST/PUT geoportal/rest/metadata/transform
HTTP POST/PUT geoportal/rest/metadata/validate
HTTP GET geoportal/opensearch
HTTP GET geoportal/opensearch/description
HTTP GET/POST geoportal/csw
HTTP POST geoportal/oauth/token
DEPRECATED: HTTP PUT geoportal/rest/metadata/bulk/changeOwner - use geoportal/rest/metadata/setOwner
DEPRECATED: HTTP PUT geoportal/rest/metadata/item/{id}/owner/{newOwner}- use geoportal/rest/metadata/setOwner
------------------------------------------------------------------------------------------
geoportal/elastic/*
HTTP requests to these endpoints are proxied to the Elasticsearch cluster.
See: WEB-INF/classes/app-context.html for cluster configuration
See: WEB-INF/classes/app-security.html for securing these endpoints
Example: http://localhost:8080/geoportal/elastic/metadata/_mappings?pretty=true
Example: http://localhost:8080/geoportal/elastic/metadata/item/item/_search?pretty=true
Example: http://localhost:8080/geoportal/elastic/metadata/xml/item/_search?pretty=true
When using /elastic/metadata/item/item/_search, POST your query using the
Elasticsearch Query DSL (aggregations requests are also supported).
------------------------------------------------------------------------------------------
HTTP GET geoportal/rest/geoportal
Provides information on the Geoportal application itself.
Response Content Type: application/json
Optional Query Parameters:
pretty - for an indented response (default=false)
------------------------------------------------------------------------------------------
HTTP DELETE/PUT geoportal/rest/metadata/deleteItems
Delete one or more items.
Response Content Type: application/json
Optional Query Parameters:
id - delete this item id only (field: _id)
owner - delete all items owned by this user (field: sys_owner_s)
sourceUri - delete all items associated with this harvesting uri (field: src_source_uri_s)
sourceRef - delete all items associated with this harvesting reference (field: src_source_ref_s)
taskRef - delete all items associated with this harvesting task reference (field: src_task_ref_s)
pretty - for an indented response (default=false)
Optional Request Body (application/json - Elasticsearch Query DSL):
Apply delete all items matching the supplied query
Example: {"query":{"term":{"fileid":"myfileid"}}}
HTTP GET geoportal/rest/metadata/item/{id}
Gets the item associated with the supplied identifier.
Response Content Type: application/json
Optional Query Parameters:
includeMetadata - boolean indicating whether the metadata xml should be included (default=false)
pretty - for an indented response (default=false)
HTTP GET geoportal/rest/metadata/item/{id}/xml
Gets the metadata document associated with the supplied identifier.
Response Content Type: application/xml
HTTP GET geoportal/rest/metadata/item/{id}/html
Gets the metadata details (xml transformation) associated with the supplied identifier.
Response Content Type: text/html
HTTP PUT geoportal/rest/metadata/item
Publishes a metadata document.
Available only to users with a Publisher role.
Request Content Type: application/xml
Response Content Type: application/json
Optional Query Parameters:
pretty - for an indented response (default=false)
HTTP PUT geoportal/rest/metadata/item/{id}
Publishes a metadata document using the supplied identifier.
Available only to users with a Publisher role.
Request Content Type: application/xml
Response Content Type: application/json
Optional Query Parameters:
pretty - for an indented response (default=false)
HTTP DELETE geoportal/rest/metadata/item/{id}
Delete the item associated with the supplied identifier.
Only the item owner (or an Admin) can delete and item.
Response Content Type: application/json
Optional Query Parameters:
pretty - for an indented response (default=false)
HTTP GET geoportal/rest/metadata/realias
Reset the index associated with the metadata alias.
Required Query Parameters:
indexName - the index to associate with the metadata alias
HTTP GET geoportal/rest/metadata/reindex
Re-index content.
Required Query Parameters:
fromIndexName - the source
toIndexName - the destination
HTTP GET/POST geoportal/rest/metadata/search
Search for items.
See geoportal/opensearch below for a list of parameters.
Example: http://localhost:8080/geoportal/rest/metadata/search?q=*:*
HTTP PUT geoportal/rest/metadata/setAccess
Set the access level for one or more items (fields: sys_access_s and sys_access_groups_s).
Only available if supportsGroupBasedAccess is set to true within app-context.xml.
Response Content Type: application/json
Required Query Parameters:
access - the access level: public or private
group - the group key,
can be supplied multiple times (e.g. ?access=private&group=a&group=b&group=c)
Optional Query Parameters:
id - apply change to this item id only (field: _id)
owner - apply change to all items owned by this user (field: sys_owner_s)
sourceUri - apply change to all items associated with this harvesting uri (field: src_source_uri_s)
sourceRef - apply change to all items associated with this harvesting reference (field: src_source_ref_s)
taskRef - apply change to all items associated with this harvesting task reference (field: src_task_ref_s)
pretty - for an indented response (default=false)
Optional Request Body (application/json - Elasticsearch Query DSL):
Apply change to all items matching the supplied query
Example: {"query":{"term":{"fileid":"myfileid"}}}
HTTP PUT geoportal/rest/metadata/setApprovalStatus
Set the approval status for one or more items (field: sys_approval_status_s).
Only an Admin can change approval status.
Only available if supportsApprovalStatus is set to true within app-context.xml.
Response Content Type: application/json
Required Query Parameters:
approvalStatus - the new approval status: approved, reviewed, disapproved, incomplete, posted or draft
Optional Query Parameters:
id - apply change to this item id only (field: _id)
owner - apply change to all items owned by this user (field: sys_owner_s)
sourceUri - apply change to all items associated with this harvesting uri (field: src_source_uri_s)
sourceRef - apply change to all items associated with this harvesting reference (field: src_source_ref_s)
taskRef - apply change to all items associated with this harvesting task reference (field: src_task_ref_s)
pretty - for an indented response (default=false)
Optional Request Body (application/json - Elasticsearch Query DSL):
Apply change to all items matching the supplied query
Example: {"query":{"term":{"fileid":"myfileid"}}}
HTTP PUT geoportal/rest/metadata/setOwner
Set the owner for one or more items (field: sys_owner_s).
Only an Admin can change ownership.
Response Content Type: application/json
Required Query Parameters:
newOwner - the new owner
Optional Query Parameters:
id - apply change to this item id only (field: _id)
owner - apply change to all items owned by this user (field: sys_owner_s)
sourceUri - apply change to all items associated with this harvesting uri (field: src_source_uri_s)
sourceRef - apply change to all items associated with this harvesting reference (field: src_source_ref_s)
taskRef - apply change to all items associated with this harvesting task reference (field: src_task_ref_s)
pretty - for an indented response (default=false)
Optional Request Body (application/json - Elasticsearch Query DSL):
Apply change to all items matching the supplied query
Example: {"query":{"term":{"fileid":"myfileid"}}}
HTTP POST geoportal/rest/metadata/transform
Transform an xml document.
Request Content Type: application/xml
Response Content Type: varies
Required Query Parameters:
xslt - the name of the xslt
HTTP POST geoportal/rest/metadata/validate
Validate a metadata document.
Request Content Type: application/xml
Response Content Type: application/json
Optional Query Parameters:
pretty - for an indented response (default=false)
------------------------------------------------------------------------------------------
HTTP GET geoportal/opensearch/description
The Opensearch description file.
HTTP GET geoportal/opensearch
The Opensearch implementation.
Query parameter support will depend on the type of target.
Optional Query Parameters:
f - the response format (atom|json|csw|rss|csv|kml|eros|json-source)
q - the search terms
start - the starting index (1 is the first)
num - the number of items to return
bbox - the bounding envelope WGS84 (bbox=xmin,ymin,xmax,ymax)
time - the time period for the resource (time=start/end) (ISO 8601)
id - an item id (multiples allowed: id=&id=&id=)
modified - the modified date for the item (modified=start/end) (ISO 8601)
filter - a secondary filter (search terms)
type - an item type (multiples allowed: type=&type=&type=)
sort - the sort option (e.g. sort=title:asc&sort=modified:desc)
target - the target catalog (see below)
pretty - for an indented response (default=false)
Optional Query Parameters (ArcGIS target):
orgid - an organization id (multiples allowed: orgid=&orgid=&orgid=)
group - a group id (multiples allowed: group=&group=&group=)
Optional Query Parameters (Elasticsearch target):
spatialRel - applies to a bbox filter (intersects|within)
Optional Request Body (Elasticsearch target - application/json - Elasticsearch Query DSL):
Example: {"query":{"term":{"sys_owner_s":"me"}},"aggregations":{"myKey":{"terms":{"field":"keywords_s"}}}}
Target:
A target is a JSON structure (object or array) with the following properties:
url - the target url
type - the type (geoportal|portal|csw2|csw3)
profile - the profile, current profiles: CSW2_Geoportal1
Examples:
http://localhost:8080/geoportal/opensearch?q=map
http://localhost:8080/geoportal/opensearch?f=json&pretty=true&q=roads&target={"type":"portal","url":"https://www.arcgis.com"}
http://localhost:8080/geoportal/opensearch?f=json&target=[{"key":"a","type":"portal","url":"https://www.arcgis.com"},{"key":"b","type":"geoportal","url":"http://gptdb1:8080/geoportal/elastic/metadata/item/item/_search"},{"key":"c","type":"csw2","url":"https%3A%2F%2Fgptogc.esri.com%2Fgeoportal%2Fcsw%3Fservice%3DCSW%26request%3DGetRecords","profile":"CSW2_Geoportal1"}]
-------------------------------------------------------------------------------------------
HTTP GET geoportal/csw
The CSW implementation.
See geoportal/opensearch above for a list of parameters.
Example: http://localhost:8080/geoportal/csw
Example: http://localhost:8080/geoportal/csw?service=CSW&request=GetCapabilities&version=3.0.0
Example: http://localhost:8080/geoportal/csw?service=CSW&request=GetRecords&q=*:*
Example: http://localhost:8080/geoportal/csw?service=CSW&request=GetRecordById&id=e5d10bc3269b496da3557e0964429ccd
Example: http://localhost:8080/geoportal/csw?service=CSW&request=GetCapabilities&version=2.0.2
-------------------------------------------------------------------------------------------
HTTP POST geoportal/oauth/token
Generates an OAuth access token.
The token can be supplied to subsequent requests as a query parameter: access_token=
The request should be POSTed via https using form-urlencoded parameters within the body.
Response Content Type: application/json
Required Query Parameters:
grant_type: password
client_id: geoportal-client
username: the username
password: the password
-------------------------------------------------------------------------------------------
Website
Example: http://localhost:8080/geoportal/index.html
Example: http://localhost:8080/geoportal/index.html?filter=oceans
Optional Query Parameters:
filter - a filter to be applied to all searches