Skip to content

Commit

Permalink
Add WADL resource definitions for RoleApi
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Morgan committed Jun 29, 2009
1 parent c149e54 commit 7242076
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 2 deletions.
35 changes: 35 additions & 0 deletions 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);
}
}
72 changes: 70 additions & 2 deletions xsd/HQApi1.wadl
Expand Up @@ -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>
Expand All @@ -1011,7 +1011,6 @@
</wadl:method>
</wadl:resource>


<wadl:resource path="group/delete.hqu">
<wadl:doc title="HQApi Group delete command">
Delete a Group
Expand Down Expand Up @@ -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.