Commit df46f60c authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Added resources

parent 45c7bb84
......@@ -96,9 +96,9 @@ On successful deletion, return HTTP status 200 (OK).
## OPTIONS
The OPTIONS method is used for introspection. This allows for introspection of collection methods available.
The OPTIONS method is used for introspection. This allows for introspection of collection or resources and methods available.
Using the OPTIONS method on the root path of the URI followed by a \* should provide a list of collections available.
Using the OPTIONS method on the root path of the URI followed by a \* should provide a list of collections and resources available.
The 204 error code should be returned if OPTIONS is not implemented for the requested resource.
......@@ -121,6 +121,8 @@ Using the PROPFIND method on the root path of the URI should return information
Using the PROPFIND method on a collection path should provide information on the record structure.
Using the PROPFIND method on a resource path should provide information on the resource structure.
The 204 error code should be returned if OPTIONS is not implemented for the requested resource.
### Return Codes
......@@ -281,7 +283,7 @@ Using the PROPFIND method response to http://www.example.com may look like this.
}
```
### Collection list using path /*
### Endpoint list using path /*
An OPTIONS method response to http://www.example.com/\* may look like this...
```jsonnet
......@@ -290,6 +292,9 @@ An OPTIONS method response to http://www.example.com/\* may look like this...
"data": {
"collections": [
"/issues"
],
"resources": [
"/system/hostname"
]
}
}
......@@ -555,6 +560,167 @@ A OPTIONS method response to http://www.example.com/issues may look like this...
}
```
### Resource information
A OPTIONS method response to http://www.example.com/system/hostname may look like this...
```jsonnet
{
"status":"success",
"data":{
"methods":{
"PATCH":{
"returns":{
"status":{
"type":"status",
"description":"Result of request"
},
"data":{
"description":"Hash containing result of action, returned only on success",
"children":{
"resource":{
"type":"hash",
"description":"Modified resource hash"
}
},
"type":"hash"
}
},
"payload":{
"Hostname":{
"description":"System hostname (FQDN)",
"type":"domain"
}
},
"path":"/system/hostname"
},
"PUT":{
"payload":{
"Hostname":{
"type":"domain",
"description":"System hostname (FQDN)"
}
},
"path":"/system/hostname",
"returns":{
"status":{
"description":"Result of request",
"type":"status"
},
"data":{
"description":"Hash containing result of action, returned only on success",
"children":{
"resource":{
"type":"hash",
"description":"Replaced resource hash"
}
},
"type":"hash"
}
}
},
"POST":{
"path":"/system/hostname",
"payload":{
"Hostname":{
"type":"domain",
"required":true,
"description":"System hostname (FQDN)"
}
},
"example":{
"Hostname":"test.example.net"
},
"returns":{
"status":{
"type":"status",
"description":"Result of request"
},
"data":{
"type":"hash",
"description":"Hash containing result of action, returned only on success",
"children":{
"resource":{
"type":"hash",
"description":"Created record hash"
}
}
}
}
},
"PROPFIND":{
"path":"/system/hostname",
"returns":{
"data":{
"description":"Hash containing result of action, returned only on success",
"children":{
"definition":{
"description":"Record definition hash",
"type":"hash"
}
},
"type":"hash"
},
"status":{
"type":"status",
"description":"Result of request"
}
}
},
"GET":{
"returns":{
"data":{
"children":{
"resource":{
"type":"hash",
"description":"Resource hash"
}
},
"description":"Hash containing result of action, returned only on success",
"type":"hash"
},
"status":{
"type":"status",
"description":"Result of request"
}
},
"path":"/system/hostname"
},
"DELETE":{
"returns":{
"status":{
"type":"status",
"description":"Result of request"
},
"data":{
"type":"hash",
"description":"Hash containing result of action, returned only on success"
}
},
"path":"/system/hostname"
},
"OPTIONS":{
"path":"/system/hostname",
"returns":{
"status":{
"description":"Result of request",
"type":"status"
},
"data":{
"description":"Hash containing result of action, returned only on success",
"children":{
"methods":{
"type":"hash",
"description":"Method information hash"
}
},
"type":"hash"
}
}
}
}
}
}
```
# Acknoledgements
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment