Retrieve Object Identifier

Version 1 by Robin Shen
on Jun 10, 2010 03:05.


 
compared with
Version 2 by Robin Shen
on Jun 10, 2010 03:32.


Key
These lines were removed. This word was removed.
These lines were added. This word was added.

View page history


There are 2 changes. View first change.

 Most of QuickBuild RESTful API relies on identifier of the object, which can be retrieved with the id service explained here.
  
 h1. Get configuration id by path
  
 h2. Syntax
 Configuration id can be retrieved by path name using http GET method through below url:
 {code}http://localhost:8810/rest/ids?configuration_path=<configuration path name>{code}
 Here _<configuration path name>_ represents full path of a configuration. The response is of mime type _application/xml_ and the content is string representation of configuration id. Status code 204 (No Content) will be returned if configuration is not found.
  
 h2. Security
 Any user including anonymous can use this service.
  
 h2. Demo
 Below [curl|http://curl.haxx.se/] command demonstrates how to get id of configuration _root/test_:
 {code}curl http://localhost:8810/rest/ids?configuration_path=root/test{code}
  
 h1. Get user id by name
  
 h2. Syntax
 User id can be retrieved by user name using http GET method through below url:
 {code}http://localhost:8810/rest/ids?user_name=<user name>{code}
 Here _<user name>_ represents name of a QuickBuild user. The response is of mime type _application/xml_ and the content is string representation of user id. Status code 204 (No Content) will be returned if user is not found.
  
 h2. Security
 Any user including anonymous can use this service.
  
 h2. Demo
 Below [curl|http://curl.haxx.se/] command demonstrates how to get id of user _robin_:
 {code}curl http://localhost:8810/rest/ids?user_name=robin{code}
  
 h1. Get group id by name
  
 h2. Syntax
 Group id can be retrieved by group name using http GET method through below url:
 {code}http://localhost:8810/rest/ids?group_name=<group name>{code}
 Here _<group name>_ represents name of a QuickBuild group. The response is of mime type _application/xml_ and the content is string representation of group id. Status code 204 (No Content) will be returned if group is not found.
  
 h2. Security
 Any user including anonymous can use this service.
  
 h2. Demo
 Below [curl|http://curl.haxx.se/] command demonstrates how to get id of group _developers_:
 {code}curl http://localhost:8810/rest/ids?group_name=developers{code}
  
  
 h1. Get build id by request id
  
 h2. Syntax
 Build id can be retrieved by request id using http GET method through below url:
 {code}http://localhost:8810/rest/ids?request_id=<request id>{code}
 Here _<request id>_ represents id of a build request. The response is of mime type _application/xml_ and the content is string representation of build id. Status code 204 (No Content) will be returned if build is not generated yet.
  
 h2. Security
 Any user including anonymous can use this service.
  
 h2. Demo
 Below [curl|http://curl.haxx.se/] command demonstrates how to get build id of request _0136ed89-d47f-4307-8e69-c8535fae0e84_:
 {code}curl http://localhost:8810/rest/ids?request_id=0136ed89-d47f-4307-8e69-c8535fae0e84{code}
  
 h1. Get build id by build name
  
 h2. Syntax
 Build id can be retrieved by build name using http GET method through below url:
  Build id can be retrieved by [build name|build#name] using http GET method through below url:
 {code}http://localhost:8810/rest/ids?build_name=<build name>{code}
 Here _<build name>_ represents [name of a build|build name]. The response is of mime type _application/xml_ and the content is string representation of build id. Status code 204 (No Content) will be returned if build of the name is not found.
  Here _<build name>_ represents [name of a build|build#name]. The response is of mime type _application/xml_ and the content is string representation of build id. Status code 204 (No Content) will be returned if build of the name is not found.
  
 h2. Security
 Any user including anonymous can use this service.
  
 h2. Demo
 Below [curl|http://curl.haxx.se/] command demonstrates how to get build id of name _1:latest_:
 {code}curl http://localhost:8810/rest/ids?build_name=1:latest{code}