Create a Subscription Usage Alarm

The following sample shows how to create a subscription usage alarm that fires when Verizon cellular usage data exceeds 2 MB. The subscription usage alarm must specify the svcID along with a metric. Use the CustomerRatePlan web service to get a list of svcIDs.

In this example, the alarm template ID for the subscription usage alarm is 8 (almtId=8). To find the almtId for an alarm type, send a GET ws/AlarmTemplate request to get a list of all available alarm templates.

Request

POST /ws/Alarm

Payload

<Alarm>
   <almtId>8</almtId>   <!-- Subscription Usage alarm -->
   <almName>Verizon Cellular Usage</almName>
   <almDescription>Fires when verizon cellular usage data exceeds 2MB </almDescription>
   <almScopeConfig>
      <ScopingOptions>
         <Scope name="Device" value="00000000-00000000-000000FF-FF000001" />
      </ScopingOptions>
   </almScopeConfig>
   <almRuleConfig>
      <Rules>
         <FireRule>
            <Variable name="unit" value="mb" />
            <Variable name="thresholdValue" value="2" />
            <Variable name="svcId" value="14" />
            <Variable name="metric" value="transferred" />
         </FireRule>
         <ResetRule />
      </Rules>
   </almRuleConfig>
</Alarm>