Skip to content

Commit 1ee57f4

Browse files
authored
Merge pull request #531 from UMass-Amherst-Libraries/mod-cricStoreage-604
add raml and json for requests anonymization
2 parents 43aa1c3 + dfe018a commit 1ee57f4

3 files changed

Lines changed: 87 additions & 0 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#%RAML 1.0
2+
title: Anonymize requests
3+
version: v0.1
4+
protocols: [ HTTP, HTTPS ]
5+
baseUri: http://localhost:9130
6+
7+
documentation:
8+
- title: Anonymize requests API
9+
content: <b>Anonymize requests API</b>
10+
11+
types:
12+
errors: !include raml-util/schemas/errors.schema
13+
anonymize-storage-requests-response: !include anonymize-storage-requests-response.json
14+
anonymize-storage-requests-request: !include anonymize-storage-requests-request.json
15+
16+
traits:
17+
validate: !include raml-util/traits/validation.raml
18+
19+
/anonymize-storage-requests:
20+
post:
21+
is: [validate]
22+
body:
23+
application/json:
24+
type: anonymize-storage-requests-request
25+
responses:
26+
200:
27+
description: "requests that have been anonymized"
28+
body:
29+
application/json:
30+
type: anonymize-storage-requests-response
31+
500:
32+
description: "Internal server error, e.g. due to misconfiguration"
33+
body:
34+
text/plain:
35+
example: "Internal server error, contact administrator"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"description": "Request schema for anonymize requests",
4+
"type": "object",
5+
"properties": {
6+
"requestIds": {
7+
"description": "request ids to be anonymized",
8+
"type": "array",
9+
"items": {
10+
"type": "string"
11+
}
12+
}
13+
},
14+
"additionalProperties": false
15+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"description": "Response schema for anonymize requests request",
4+
"type": "object",
5+
"properties": {
6+
"anonymizedRequests": {
7+
"description": "Successfully anonymized request ids",
8+
"type": "array",
9+
"items":{
10+
"type": "string"
11+
}
12+
},
13+
"notAnonymizedRequests": {
14+
"description": "Not anonymized request IDs",
15+
"type": "array",
16+
"items": {
17+
"description": "Collection of requests",
18+
"type": "object",
19+
"properties": {
20+
"reason": {
21+
"description": "Reason of failure",
22+
"type": "string"
23+
},
24+
"requestIds": {
25+
"description": "List of request IDs that have not been anonymized",
26+
"type": "array",
27+
"items": {
28+
"type": "string"
29+
}
30+
}
31+
},
32+
"additionalProperties": false
33+
}
34+
}
35+
},
36+
"additionalProperties": false
37+
}

0 commit comments

Comments
 (0)