Permalink
Browse files

Add WADL resource definitions for RoleApi

  • Loading branch information...
1 parent c149e54 commit 724207652c1213d7b6fd6d2e073652d3b015caba Ryan Morgan committed Jun 29, 2009
Showing with 105 additions and 2 deletions.
  1. +35 −0 src/org/hyperic/hq/hqapi1/test/WADLRole_test.java
  2. +70 −2 xsd/HQApi1.wadl
View
35 src/org/hyperic/hq/hqapi1/test/WADLRole_test.java
@@ -0,0 +1,35 @@
+package org.hyperic.hq.hqapi1.test;
+
+import org.hyperic.hq.hqapi1.wadl.*;
+
+public class WADLRole_test extends WADLTestBase {
+
+ public void testRoleList() throws Exception {
+ Endpoint.RoleListHqu roleList = new Endpoint.RoleListHqu();
+
+ RolesResponse response = roleList.getAsRolesResponse();
+ hqAssertSuccess(response);
+ }
+
+ public void testRoleGet() throws Exception {
+ Endpoint.RoleGetHqu roleGet = new Endpoint.RoleGetHqu();
+
+ RoleResponse response = roleGet.getAsRoleResponse("Some role");
+ hqAssertFailure(response);
+ }
+
+ public void testRoleDelete() throws Exception {
+ Endpoint.RoleDeleteHqu roleDelete = new Endpoint.RoleDeleteHqu();
+
+ StatusResponse response = roleDelete.getAsStatusResponse(Integer.MAX_VALUE);
+ hqAssertFailure(response);
+ }
+
+ public void testRoleSync() throws Exception {
+ Endpoint.RoleSyncHqu roleSync = new Endpoint.RoleSyncHqu();
+ RolesRequest request = new RolesRequest();
+
+ StatusResponse response = roleSync.postAsStatusResponse(request);
+ hqAssertSuccess(response);
+ }
+}
View
72 xsd/HQApi1.wadl
@@ -992,7 +992,7 @@
<wadl:resource path="group/list.hqu">
<wadl:doc title="HQApi Group list command">
- Get a Group
+ List Groups
</wadl:doc>
<wadl:method name="GET" id="GroupList">
<wadl:request>
@@ -1011,7 +1011,6 @@
</wadl:method>
</wadl:resource>
-
<wadl:resource path="group/delete.hqu">
<wadl:doc title="HQApi Group delete command">
Delete a Group
@@ -1048,6 +1047,75 @@
</wadl:method>
</wadl:resource>
+ <wadl:resource path="role/get.hqu">
+ <wadl:doc title="HQApi Role get command">
+ Get a Role
+ </wadl:doc>
+ <wadl:method name="GET" id="RoleGet">
+ <wadl:request>
+ <wadl:param name="name" style="query" required="true"
+ type="xs:string">
+ <wadl:doc>
+ The name of the Role to return.
+ </wadl:doc>
+ </wadl:param>
+ </wadl:request>
+ <wadl:response>
+ <wadl:representation mediaType="application/xml"
+ element="RoleResponse"/>
+ </wadl:response>
+ </wadl:method>
+ </wadl:resource>
+
+ <wadl:resource path="role/list.hqu">
+ <wadl:doc title="HQApi Role list command">
+ List Roles
+ </wadl:doc>
+ <wadl:method name="GET" id="RoleList">
+ <wadl:request/>
+ <wadl:response>
+ <wadl:representation mediaType="application/xml"
+ element="RolesResponse"/>
+ </wadl:response>
+ </wadl:method>
+ </wadl:resource>
+
+ <wadl:resource path="role/delete.hqu">
+ <wadl:doc title="HQApi Role delete command">
+ Delete a Role
+ </wadl:doc>
+ <wadl:method name="GET" id="RoleDelete">
+ <wadl:request>
+ <wadl:param name="id" style="query" required="true"
+ type="xs:int">
+ <wadl:doc>
+ The id of the Role to delete.
+ </wadl:doc>
+ </wadl:param>
+ </wadl:request>
+ <wadl:response>
+ <wadl:representation mediaType="application/xml"
+ element="StatusResponse"/>
+ </wadl:response>
+ </wadl:method>
+ </wadl:resource>
+
+ <wadl:resource path="role/sync.hqu">
+ <wadl:doc title="HQApi Role sync command">
+ Sync Roles
+ </wadl:doc>
+ <wadl:method name="POST" id="RoleSync">
+ <wadl:request>
+ <wadl:representation mediaType="application/xml"
+ element="RolesRequest"/>
+ </wadl:request>
+ <wadl:response>
+ <wadl:representation mediaType="application/xml"
+ element="StatusResponse"/>
+ </wadl:response>
+ </wadl:method>
+ </wadl:resource>
+
</wadl:resources>
</wadl:application>

0 comments on commit 7242076

Please sign in to comment.