Zone Charge Example

The zone charge examples show how to create, query, and update zone charge components.

The <normalizer ... /> tags take a value_index and/or a value_name attribute. If both are specified, they both must match the definition in a normalizer. If only the value_name is provided, the first normalizer value with the given name is used. If only the value_id is provided, the remaining normalizer value information can be determined.

POST /objects/Matrix/basic shows how to create a new matrix charge component.
Table 1. POST /objects/Matrix/basic
URL
POST http://localhost:8080/matrixx/data/objects/Matrix/basic
Input
<?xml version="1.0" encoding="UTF-8"?>
<Matrix name="Zone A Charges  - Charging MCC/MNC">
  <balance id="90208" class="756" balance_units="none"/>
  <defaultbeat id="3" override="true"/>
  <formula intercept="0.0000" slope="0.3000" multiple="30.0000" units="kbytes" beatid="3"/>
  <NormalizerList>
    <normalizer id="1067"/>
    <normalizer id="1066"/>
  </NormalizerList>
  <RowList>
    <row>
      <normalizer_value id="1067" value_index="0" value_name="GPRS"/>
      <normalizer_value id="1066" value_index="1" value_name="Zone A"/>
      <formula intercept="0.0000" slope="0.1000" multiple="30.0000" units="kbytes" beat="30 kbytes"/>
    </row>
    <row>
      <normalizer_value id="1067" value_index="1" value_name="Blackberry"/>
      <normalizer_value id="1066" value_index="1" value_name="Zone A"/>
      <formula intercept="0.0000" slope="0.1000" multiple="30.0000" units="kbytes" beat="10 kbytes"/>
    </row>
  </RowList>
</Matrix> 
Response
<CreateResponse>
    <type>Matrix</type>
    <DomainId>1</DomainId>
    <Result>0</Result>
    <ResultText>Success</ResultText>
    <ObjectId>2625</ObjectId>
    <Revision>0</Revision>
</CreateResponse>  
GET /objects/Matrix/basic{id} shows how to retrieve a matrix charge component from the in-memory pricing database.
Table 2. GET /objects/Matrix/basic{id}
URL
GET http://localhost:8080/matrixx/data/objects/Matrix/basic/2625
Response
<?xml version="1.0" encoding="UTF-8"?>	
<Matrix name="Zone A Charges  - Charging MCC/MNC">
  <balance id="90208" class="756" balance_units="none"/>
  <defaultbeat id="3" override="true"/>
  <formula intercept="0.0000" slope="0.3000" multiple="30.0000" units="kbytes" beatid="3"/>
  <NormalizerList>
    <normalizer id="1067"/>
    <normalizer id="1066"/>
  </NormalizerList>
  <RowList>
    <row>
      <normalizer_value id="1067" value_index="0" value_name="GPRS"/>
      <normalizer_value id="1066" value_index="1" value_name="Zone A"/>
      <formula intercept="0.0000" slope="0.1000" multiple="30.0000" units="kbytes" beat="30 kbytes"/>
    </row>
    <row>
      <normalizer_value id="1067" value_index="1" value_name="Blackberry"/>
      <normalizer_value id="1066" value_index="1" value_name="Zone A"/>
      <formula intercept="0.0000" slope="0.1000" multiple="30.0000" units="kbytes" beat="10 kbytes"/>
    </row>
  </RowList>
</Matrix> 
PUT /objects/Matrix/basic/{id} shows how to update an existing matrix charge component.
Table 3. PUT /objects/Matrix/basic/{id}
URL
PUT http://localhost:8080/matrixx/data/objects/Matrix/basic/2625
Input
<?xml version="1.0" encoding="UTF-8"?>
<Matrix name="Zone A Charges  - Charging MCC/MNC">
  <RowList>
    <row>
      <normalizer_value id="1067" value_index="0" value_name="GPRS"/>
      <normalizer_value id="1066" value_index="1" value_name="Zone A"/>
      <formula intercept="0.0000" slope="0.2000" multiple="30.0000" units="kbytes" beat="30 kbytes"/>
    </row>
    <row>
      <normalizer_value id="1067" value_index="1" value_name="Blackberry"/>
      <normalizer_value id="1066" value_index="1" value_name="Zone A"/>
      <formula intercept="0.0000" slope="0.2000" multiple="30.0000" units="kbytes" beat="10 kbytes"/>
    </row>
  </RowList>
</Matrix> 
Response
<UpdateResponse>
    <type>Matrix</type>
    <Result>0</Result>
    <ResultText>Success</ResultText>
    <ObjectId>2625</ObjectId>
</UpdateResponse>