Details of the functionality of the archive-service endpoints.
Example resources suitable for minimal testing (Mandatory properties only).
Example Simple Observation
Namespace details must conform with the current vo-dml model used.
<SimpleObservation xmlns : caom2 =" http://ivoa.net/dm/models/vo-dml/experiment/caom2" xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : type =" caom2:caom2.SimpleObservation" >
<id >988</id >
<collection >e-merlin</collection >
<uri >auri</uri >
<intent >science</intent >
</SimpleObservation >
@type has to be set for JSON
{
"@type" : " caom2:caom2.SimpleObservation" ,
"id" : " myData12345" ,
"collection" : " test" ,
"uri" : " auri" ,
"intent" : " science"
}
Example Derived Observation
<DerivedObservation xmlns : caom2 =" http://ivoa.net/dm/models/vo-dml/experiment/caom2" xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : type =" caom2:caom2.DerivedObservation" >
<id >10</id >
<collection >test</collection >
<uri >auri</uri >
<intent >science</intent >
<members >jbo-simple1</members >
<members >jbo-simple2</members >
</DerivedObservation >
Endpoints available for interaction with the archive-service.
GET
/observations
(Returns either all of the observations OR a paginated subset if optional page and size parameters supplied)
name
type
data type
description
collectionId
optional
String
Filter by collection Id if required (not supplying will return all).
page
optional
integer
The page index, zero-indexed
size
optional
integer
The number of observations to return for each page, must be greater than zero.
http code
content-type
response
200
application/xml
Returned successfully
400
text/plain
{"code":"400","message":"Bad Request"}
curl -X 'GET' -H 'accept: application/xml' 'http://localhost:8080/observations'
GET
/observations/{observationId}
(Returns an Observation with the supplied ID, if found)
name
type
data type
description
observationId
required
String
The unique identifier of a specific Observation (Simple or Derived)
http code
content-type
response
201
application/xml
Observation found and returned successfully
400
text/plain
{"code":"400","message":"Bad Request"}
404
text/plain
Observation not found
curl -X 'GET' 'http://localhost:8080/observations/23456' -H 'accept: application/xml'
POST
/observations
(Add a new observation)
http code
content-type
response
201
application/xml
Observation added successfully, body contains new Observation
400
text/plain
{"code":"400","message":"Bad Request"}
curl -X 'POST' -H 'Content-Type: application/xml' -H 'accept: application/xml' --data "@observation2.json" http://localhost:8080/observations
with JSON response also
curl -X 'POST' -H 'Content-Type: application/json' -H 'accept: application/json' --data "@observation2.json" http://localhost:8080/observations
UPDATE
/observations/{observationId}
(Updates an observation (Simple or Derived) with the same observationId)
name
type
data type
description
observationId
required
String
The unique identifier of a specific observation to update
http code
content-type
response
200
application/xml
Observation updated successfully
400
text/plain
{"code":"400","message":"Bad Request"}
404
text/plain
Observation not found
curl -X 'PUT' -H 'Content-Type: application/xml' -H 'Accept: application/xml' -T observation2.xml http://localhost:8080/observations/988
DELETE
/observations/{observationId}
(Delete an Observation with the supplied ID, if found)
name
type
data type
description
observationId
required
String
The unique identifier of a specific Observation (Simple or Derived)
http code
content-type
response
204
application/xml
Observation deleted
400
text/plain
{"code":"400","message":"Bad Request"}
404
text/plain
Observation not found
curl -X 'DELETE' 'http://localhost:8080/observations/delete/123' -H 'accept: */*'
GET
/collections
(Returns the names of all the collections as a TSV (Tab Separated List))
http code
content-type
response
200
text/plain
Returned successfully
400
text/plain
{"code":"400","message":"Bad Request"}
curl -X 'GET' -H 'accept: application/xml' 'http://localhost:8080/collections'