Permalink
Browse files

Add WADL resource definitions for EscalationApi

  • Loading branch information...
1 parent 14b061e commit 970cf8731f1af33a4d7ed85e8562947306fb6b8e Ryan Morgan committed Jun 26, 2009
Showing with 109 additions and 0 deletions.
  1. +38 −0 src/org/hyperic/hq/hqapi1/test/WADLEscalation_test.java
  2. +71 −0 xsd/HQApi1.wadl
@@ -0,0 +1,38 @@
+package org.hyperic.hq.hqapi1.test;
+
+import org.hyperic.hq.hqapi1.wadl.*;
+
+public class WADLEscalation_test extends WADLTestBase {
+
+ public void testEscalationGet() throws Exception {
+ Endpoint.EscalationGetHqu escGet = new Endpoint.EscalationGetHqu();
+
+ EscalationResponse response = escGet.getAsEscalationResponse("Some Esc");
+ hqAssertFailure(response); // Won't exist
+ }
+
+ public void testEscalationList() throws Exception {
+ Endpoint.EscalationListHqu escList = new Endpoint.EscalationListHqu();
+
+ EscalationsResponse response = escList.getAsEscalationsResponse();
+ hqAssertSuccess(response);
+ }
+
+ public void testEscalationDelete() throws Exception {
+ Endpoint.EscalationDeleteHqu escDelete =
+ new Endpoint.EscalationDeleteHqu();
+
+ StatusResponse response = escDelete.getAsStatusResponse(Integer.MAX_VALUE);
+ hqAssertFailure(response); // Won't exist
+ }
+
+ public void testEscalationSync() throws Exception {
+ Endpoint.EscalationSyncHqu escSync =
+ new Endpoint.EscalationSyncHqu();
+
+ EscalationsRequest request = new EscalationsRequest();
+
+ StatusResponse response = escSync.postAsStatusResponse(request);
+ hqAssertSuccess(response);
+ }
+}
View
@@ -899,6 +899,77 @@
</wadl:method>
</wadl:resource>
+ <wadl:resource path="escalation/get.hqu">
+ <wadl:doc title="HQApi Escalation get command">
+ Get an Escalation
+ </wadl:doc>
+ <wadl:method name="GET" id="EscalationGet">
+ <wadl:request>
+ <wadl:param name="name" style="query" required="true"
+ type="xs:string">
+ <wadl:doc>
+ The name of the Escalation to return.
+ </wadl:doc>
+ </wadl:param>
+ </wadl:request>
+ <wadl:response>
+ <wadl:representation mediaType="application/xml"
+ element="EscalationResponse"/>
+ </wadl:response>
+ </wadl:method>
+ </wadl:resource>
+
+ <wadl:resource path="escalation/list.hqu">
+ <wadl:doc title="HQApi Escalation list command">
+ List Escalations
+ </wadl:doc>
+ <wadl:method name="GET" id="EscalationList">
+ <wadl:request/>
+ <wadl:response>
+ <wadl:representation mediaType="application/xml"
+ element="EscalationsResponse"/>
+ </wadl:response>
+ </wadl:method>
+ </wadl:resource>
+
+ <wadl:resource path="escalation/delete.hqu">
+ <wadl:doc title="HQApi Escalation delete command">
+ Delete an AlertDefinition
+ </wadl:doc>
+ <wadl:method name="GET" id="EscalationDelete">
+ <wadl:request>
+ <wadl:param name="id" style="query" required="true"
+ type="xs:int">
+ <wadl:doc>
+ The id of the Escalation to delete.
+ </wadl:doc>
+ </wadl:param>
+ </wadl:request>
+ <wadl:response>
+ <wadl:representation mediaType="application/xml"
+ element="StatusResponse"/>
+ </wadl:response>
+ </wadl:method>
+ </wadl:resource>
+
+ <!-- Escalation create/update left off intentionally, use sync() -->
+
+ <wadl:resource path="escalation/sync.hqu">
+ <wadl:doc title="HQApi Escalation sync command">
+ Sync Escalations
+ </wadl:doc>
+ <wadl:method name="POST" id="EscalationSync">
+ <wadl:request>
+ <wadl:representation mediaType="application/xml"
+ element="EscalationsRequest"/>
+ </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 970cf87

Please sign in to comment.