Organisation
From ToxBank API Wiki
(Difference between revisions)
m (Created page with "{{REST_resource}}") |
m (Added operations and examples) |
||
Line 1: | Line 1: | ||
{{REST_resource}} | {{REST_resource}} | ||
+ | |||
+ | An organisation is a REST resource,representing SEURAT cluster partners, or external organisations. An organisation is identified by its URI, has a name and may be assigned an LDAP group. The LDAP group should be one of the existing ToxBank LDAP groups and accessible via ToxBank OpenAM. External organisations may or may not be assigned an LDAP group. | ||
+ | |||
+ | A [[Protocol]] is always associated with an organisation,and the protocol representation includes a link to an Organisation. | ||
+ | |||
+ | == REST Operations == | ||
+ | |||
+ | === GET === | ||
+ | {{REST Operations | ||
+ | |REST_op_description=Retrieves available organisations | ||
+ | |REST_resource=Organisation | ||
+ | |REST_op_method=GET | ||
+ | |REST_op_uri=/organisation/{id} | ||
+ | |REST_op_params=none, or ?search=name | ||
+ | |REST_header_param=subjectid:SECURITY-TOKEN | ||
+ | |REST_op_mime_input=none | ||
+ | |REST_op_result=The organisation representation in supported media type | ||
+ | |REST_op_mime_output=application/rdf+xml;text/n3;text/uri-list | ||
+ | |REST_op_status=200,400,401,402,403 | ||
+ | }} | ||
+ | Example: [http://toxbanktest1.opentox.org:8080/toxbank/organisation http://toxbanktest1.opentox.org:8080/toxbank/organisation] | ||
+ | |||
+ | curl -X GET -H 'Accept:text/uri-list' -H 'subjectid:TOKEN' http://toxbanktest1.opentox.org:8080/toxbank/organisation | ||
+ | |||
+ | curl -X GET -H 'Accept:application/rdf+xml' -H 'subjectid:TOKEN' \ | ||
+ | http://toxbanktest1.opentox.org:8080/toxbank/organisation?search=Douglas+Connect | ||
+ | |||
+ | ===POST === | ||
+ | {{REST Operations | ||
+ | |REST_op_description=Creates an organisation | ||
+ | |REST_resource=Organisation | ||
+ | |REST_op_method=POST | ||
+ | |REST_op_uri=/organisation | ||
+ | |REST_op_params=Any combination of name,ldapgroup | ||
+ | |REST_header_param=subjectid:SECURITY-TOKEN | ||
+ | |REST_op_mime_input=application/x-www-form-urlencoded | ||
+ | |REST_op_result=Task representation in supported MIME formats | ||
+ | |REST_op_mime_output=application/rdf+xml;text/n3;text/uri-list | ||
+ | |REST_op_status=200,202,400,401,402,403,500 | ||
+ | }} | ||
+ | Example: [http://toxbanktest1.opentox.org:8080/toxbank/organisation?new=true http://toxbanktest1.opentox.org:8080/toxbank/organisation] | ||
+ | |||
+ | curl -X POST -H 'subjectid:TOKEN' -H 'Content-Type:application/x-www-form-urlencoded' \ | ||
+ | -d 'title=MANDATORY_VALUE' -d 'ldapgroup=OPTIONAL_VALUE' http://toxbanktest1.opentox.org:8080/toxbank/organisation | ||
+ | |||
+ | === PUT === | ||
+ | {{REST Operations | ||
+ | |REST_op_description=Updates the organisation metadata | ||
+ | |REST_op_method=PUT | ||
+ | |REST_op_uri=/organisation/{id} | ||
+ | |REST_op_params=Any combination of name,ldapgroup | ||
+ | |REST_header_param=subjectid:SECURITY-TOKEN | ||
+ | |REST_op_mime_input=application/x-www-form-urlencoded | ||
+ | |REST_op_result=Task representation in supported MIME formats | ||
+ | |REST_op_mime_output=application/rdf+xml;text/n3;text/uri-list | ||
+ | |REST_op_status=200,202,400,401,402,403,500 | ||
+ | }} | ||
+ | |||
+ | Example: | ||
+ | |||
+ | curl -X PUT -H 'subjectid:TOKEN' -H 'Content-Type:application/x-www-form-urlencoded' \ | ||
+ | -d 'title=MANDATORY_VALUE' -d 'ldapgroup=OPTIONAL_VALUE' http://toxbanktest1.opentox.org:8080/toxbank/organisation/G3 | ||
+ | |||
+ | === DELETE === | ||
+ | {{REST Operations | ||
+ | |REST_op_description=Removes an existing organisation | ||
+ | |REST_op_method=DELETE | ||
+ | |REST_op_uri=/organisation/{id} | ||
+ | |REST_op_params=none | ||
+ | |REST_header_param=subjectid:SECURITY-TOKEN | ||
+ | |REST_op_mime_input=none | ||
+ | |REST_op_result=Task representation in supported MIME formats | ||
+ | |REST_op_mime_output=application/rdf+xml;text/n3;text/uri-list | ||
+ | |REST_op_status=200,202,400,401,402,403,500 | ||
+ | }} | ||
+ | |||
+ | Example: | ||
+ | |||
+ | curl -X DELETE -H 'subjectid:TOKEN' http://toxbanktest1.opentox.org:8080/toxbank/organisation/G3 | ||
+ | |||
+ | == RDF representation == | ||
+ | |||
+ | [http://jenkins.toxbank.net/job/toxbank-api-beans/ws/target/test-classes/net.toxbank.client.resource.Organisation.30.n3 RDF N3] | ||
+ | |||
+ | This RDF representation is automatically generated by the latesr version of the [https://github.com/ToxBank/toxbank-api-beans Toxbank Java client library] |
Revision as of 12:15, 14 December 2011
Organisation |
---|
An organisation is a REST resource,representing SEURAT cluster partners, or external organisations. An organisation is identified by its URI, has a name and may be assigned an LDAP group. The LDAP group should be one of the existing ToxBank LDAP groups and accessible via ToxBank OpenAM. External organisations may or may not be assigned an LDAP group.
A Protocol is always associated with an organisation,and the protocol representation includes a link to an Organisation.
Contents |
REST Operations
GET
Description | Retrieves available organisations |
---|---|
Resource | Organisation |
Method | GET |
URI | /organisation/{id} |
Parameters | none, or ?search=name |
Header Parameters | subjectid:SECURITY-TOKEN |
Media Type (input) | none |
Results | The organisation representation in supported media type |
Media Type (output) | application/rdf+xml;text/n3;text/uri-list |
Status code | 200,400,401,402,403 |
Example: http://toxbanktest1.opentox.org:8080/toxbank/organisation
curl -X GET -H 'Accept:text/uri-list' -H 'subjectid:TOKEN' http://toxbanktest1.opentox.org:8080/toxbank/organisation
curl -X GET -H 'Accept:application/rdf+xml' -H 'subjectid:TOKEN' \ http://toxbanktest1.opentox.org:8080/toxbank/organisation?search=Douglas+Connect
POST
Description | Creates an organisation |
---|---|
Resource | Organisation |
Method | POST |
URI | /organisation |
Parameters | Any combination of name,ldapgroup |
Header Parameters | subjectid:SECURITY-TOKEN |
Media Type (input) | application/x-www-form-urlencoded |
Results | Task representation in supported MIME formats |
Media Type (output) | application/rdf+xml;text/n3;text/uri-list |
Status code | 200,202,400,401,402,403,500 |
Example: http://toxbanktest1.opentox.org:8080/toxbank/organisation
curl -X POST -H 'subjectid:TOKEN' -H 'Content-Type:application/x-www-form-urlencoded' \ -d 'title=MANDATORY_VALUE' -d 'ldapgroup=OPTIONAL_VALUE' http://toxbanktest1.opentox.org:8080/toxbank/organisation
PUT
Description | Updates the organisation metadata |
---|---|
Resource | [[]] |
Method | PUT |
URI | /organisation/{id} |
Parameters | Any combination of name,ldapgroup |
Header Parameters | subjectid:SECURITY-TOKEN |
Media Type (input) | application/x-www-form-urlencoded |
Results | Task representation in supported MIME formats |
Media Type (output) | application/rdf+xml;text/n3;text/uri-list |
Status code | 200,202,400,401,402,403,500 |
Example:
curl -X PUT -H 'subjectid:TOKEN' -H 'Content-Type:application/x-www-form-urlencoded' \ -d 'title=MANDATORY_VALUE' -d 'ldapgroup=OPTIONAL_VALUE' http://toxbanktest1.opentox.org:8080/toxbank/organisation/G3
DELETE
Description | Removes an existing organisation |
---|---|
Resource | [[]] |
Method | DELETE |
URI | /organisation/{id} |
Parameters | none |
Header Parameters | subjectid:SECURITY-TOKEN |
Media Type (input) | none |
Results | Task representation in supported MIME formats |
Media Type (output) | application/rdf+xml;text/n3;text/uri-list |
Status code | 200,202,400,401,402,403,500 |
Example:
curl -X DELETE -H 'subjectid:TOKEN' http://toxbanktest1.opentox.org:8080/toxbank/organisation/G3
RDF representation
This RDF representation is automatically generated by the latesr version of the Toxbank Java client library
Facts about OrganisationRDF feed
Acts on | |
Has output media type | application/rdf+xml;text/n3;text/uri-list + |
Has status code | 200,202,400,401,402,403,500 + |