120 likes | 327 Vues
Tag. Retrieves all public tags for a project Retrieves all private tags for logged in user. Get All tags for project. Example Resource retrieved. <?xml version=”1.0” encoding=”UTF-8”?> <tags xmlns="http://jazz.net/xmlns/alm/rdm/v0.1/"> <tag> <name>tag1</name>
E N D
Retrieves all public tags for a project Retrieves all private tags for logged in user Get All tags for project Example Resource retrieved <?xml version=”1.0” encoding=”UTF-8”?> <tags xmlns="http://jazz.net/xmlns/alm/rdm/v0.1/"> <tag> <name>tag1</name> <description>this is tag1</description> <tagURI>/project/tags/T1<tagURI> <visibility restricted=“true”> <userid>john</userid> <userid>dparikh</userid> </visibility> <count>5</count> <taggedResources href=“http://someurl”/> </tag> <tag> <name>tag2</name> <description>this is tag2</description> <tagURI>/project/tags/T5<tagURI> <visibility restricted=“false”/> <count>9</count> <taggedResources href=“http://someurl”/> </tag> </tags>
Retrieves tagged resources for a tag Get tagged resource for Tag Example Resource retrieved <?xml version=”1.0” encoding=”UTF-8”?> <taggedResources> <pagination> <link rel="self" href=“taggedresourceuri" /> <link rel="first" href=" taggedresourceuri" /> <link rel="next" href=“taggedresourceuri?page=1&token=sometoken"/> <link rel="last" href=" taggedresourceuri?page=3&token=sometoken" /> </pagination> <url>http://finance.yahoo.com</url> <url>http://finance.google.com</url> </taggedResources>
Add new public or private tag to project If successful returns tagURI Optionally tag resources with newly created tag Default visibility of tag resource is restricted = “false” Create new tag Example POST Resource <?xml version=”1.0” encoding=”UTF-8”?> <tag xmlns="http://jazz.net/xmlns/alm/rdm/v0.1/"> <name>stock</name> <description>this is stock related</description> <visibility restricted=“false”/> <taggedResources> <url>http://finance.yahoo.com</url> <url>http://finance.google.com</url> </taggedResources> </tag>
Get Information about the tag resource ETag and Last-Modified HTTP headers available Get tag Example Resource retrieved <?xml version=”1.0” encoding=”UTF-8”?> <tag xmlns=http://jazz.net/xmlns/alm/rdm/v0.1/ uri=”/project/tags/T1”> <name>tag1</name> <description>this is tag1</description> <visibility restricted=“false”/> <count>2</count> <taggedResources href=“http://someurl”/> </tag>
Delete tag identified by {tag-id} the request must include specific If- Match or If-Unmodified-Since headers Delete tag
Update Information about the tag resource the request must include specific If- Match or If-Unmodified-Since headers Update tag Example Resource retrieved <?xml version=”1.0” encoding=”UTF-8”?> <tag xmlns="http://jazz.net/xmlns/alm/rdm/v0.1/"> <name>tag1</name> <description>this is tag1</description> <visibility restricted=“false”/> </tag>
Tag new resource url with the tag Tag new resource Example POST Resource <?xml version=”1.0” encoding=”UTF-8”?> <tag xmlns="http://jazz.net/xmlns/alm/rdm/v0.1/"> <taggedResources> <url>http://finance.yahoo.com</url> <url>http://finance.google.com</url> </taggedResources> </tag>
untag resource untag resource
Parameters url= http://finance.yahoo.com, http://finance.yahoo.com ModifiedSince=dateTime Name=t Query for a Tag Example Resource retrieved <?xml version=”1.0” encoding=”UTF-8”?> <tags xmlns="http://jazz.net/xmlns/alm/rdm/v0.1/"> <tag> <name>tag1</name> <description>this is tag1</description> <tagURI>/project/tags/T1<tagURI> <visibility restricted=“true”> <userid>john</userid> <userid>dparikh</userid> </visibility> <count>5</count> <taggedResources href=“http://someurl”/> </tag> <tag> <name>tag2</name> <description>this is tag2</description> <tagURI>/project/tags/T5<tagURI> <visibility restricted=“false”/> <count>9</count> <taggedResources href=“http://someurl”/> </tag> </tags>
… Apply one or more tags to one or more url TBD Example Resource
Questions • How do we get all tags across the project? • How much of the ATOM ? • Is correct RESTful if we have url with query string and delete / POST • DELETE {project-id}/tags/{tag-id}?url=url1 • POST {project-id}/tags/usage?url=url1,url2,url3 • Vs. ‘delicious’-like API, where they utilize GETs and have various actions to do PUT/GET/DELTE functionality