Project
From ToxBank API Wiki
(Difference between revisions)
(added operations for project resource) |
m (Added operatins and examples for the project resource) |
||
Line 1: | Line 1: | ||
{{REST_resource}} | {{REST_resource}} | ||
+ | A project is a REST resource,representing projects from SEURAT cluster, or external projects. A project 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 projects may or may not be assigned an LDAP group. | ||
+ | |||
+ | A [[Protocol]] is always associated with a project,and the protocol representation includes a link to a Project. | ||
+ | |||
+ | == REST Operations == | ||
+ | |||
+ | === GET === | ||
{{REST Operations | {{REST Operations | ||
− | |REST_op_description=Retrieves | + | |REST_op_description=Retrieves available projects |
|REST_resource=Project | |REST_resource=Project | ||
|REST_op_method=GET | |REST_op_method=GET | ||
Line 13: | Line 21: | ||
|REST_op_status=200,400,401,402,403 | |REST_op_status=200,400,401,402,403 | ||
}} | }} | ||
+ | Example: [http://toxbanktest1.opentox.org:8080/toxbank/project http://toxbanktest1.opentox.org:8080/toxbank/project] | ||
+ | curl -X GET -H 'Accept:text/uri-list' -H 'subjectid:TOKEN' http://toxbanktest1.opentox.org:8080/toxbank/project | ||
+ | |||
+ | curl -X GET -H 'Accept:application/rdf+xml' -H 'subjectid:TOKEN' http://toxbanktest1.opentox.org:8080/toxbank/project?search=Tox | ||
+ | |||
+ | ===POST === | ||
{{REST Operations | {{REST Operations | ||
|REST_op_description=Creates a project | |REST_op_description=Creates a project | ||
Line 26: | Line 40: | ||
|REST_op_status=200,202,400,401,402,403,500 | |REST_op_status=200,202,400,401,402,403,500 | ||
}} | }} | ||
+ | Example: [http://toxbanktest1.opentox.org:8080/toxbank/project?new=true http://toxbanktest1.opentox.org:8080/toxbank/project] | ||
+ | |||
+ | 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/project | ||
{{REST Operations | {{REST Operations | ||
Line 38: | Line 56: | ||
|REST_op_status=200,202,400,401,402,403,500 | |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/project/P3 | ||
{{REST Operations | {{REST Operations | ||
Line 50: | Line 73: | ||
|REST_op_status=200,202,400,401,402,403,500 | |REST_op_status=200,202,400,401,402,403,500 | ||
}} | }} | ||
+ | |||
+ | Example: | ||
+ | |||
+ | curl -X DELETE -H 'subjectid:TOKEN' http://toxbanktest1.opentox.org:8080/toxbank/project/P3 | ||
+ | |||
+ | == RDF representation == | ||
+ | |||
+ | [http://jenkins.toxbank.net/job/toxbank-api-beans/ws/target/test-classes/net.toxbank.client.resource.Project.7.n3 N3] |
Revision as of 12:07, 14 December 2011
Project |
---|
A project is a REST resource,representing projects from SEURAT cluster, or external projects. A project 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 projects may or may not be assigned an LDAP group.
A Protocol is always associated with a project,and the protocol representation includes a link to a Project.
Contents |
REST Operations
GET
Description | Retrieves available projects |
---|---|
Resource | Project |
Method | GET |
URI | /project/{id} |
Parameters | none, or ?search=name |
Header Parameters | subjectid:SECURITY-TOKEN |
Media Type (input) | none |
Results | The project 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/project
curl -X GET -H 'Accept:text/uri-list' -H 'subjectid:TOKEN' http://toxbanktest1.opentox.org:8080/toxbank/project
curl -X GET -H 'Accept:application/rdf+xml' -H 'subjectid:TOKEN' http://toxbanktest1.opentox.org:8080/toxbank/project?search=Tox
POST
Description | Creates a project |
---|---|
Resource | Project |
Method | POST |
URI | /project |
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/project
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/project
Description | Updates the project metadata |
---|---|
Resource | [[]] |
Method | PUT |
URI | /project/{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/project/P3
Description | Removes an existing project |
---|---|
Resource | [[]] |
Method | DELETE |
URI | /project/{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/project/P3
RDF representation
Facts about ProjectRDF 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 + |