POST v1/accounts/{foreignaccountkey}/networks/{foreignkey}/datacontrol/groups/{groupname}/apnpolicies

Create a new APN Policy on this network and in this group.<br/> The APN Policy has the following properties:-<br/> 1) Zone. The zone the policy applies to.<br/> 2) Quota. The quota policy for devices operatin in this Zone.<br/> 2) UnderQuotaPolicy. The access policy to apply when the device is under its restriction quota.<br/> 3) OverQuotaPolicy. he access policy to apply when the device goes over its restriction quota.<br/><br/> Note: the quota policy contains the following properties:-<br/> 1) CutOfAt. The data usage total in bytes at which the device will be cut off (in real time)<br/> 2) RestrictAt. The data usage total in bytes at which the device will go into restricted/over quota mode<br/> 3) SharedRestrictAt. The data usage total for the group at which the all devices will be restricted<br/> 4) Cycle. The cycle at which the data usage counterse are reset - monthyl, weekly, daily<br/><br/> Note: the access policies contain the following properties<br/> 1) AccessRate. The data rate in bytes/sec that the device can operate at. 0 = unrestricted<br/> 2) UpstreamFirewall: the ACL rules for traffic rom the device. Uusally its suffiient to set this as the appropriate downstream ACL is auto-generated<br/> 3) Downstream Firewall: the ACL rules for traffic to the device<br/>

Request Information

URI Parameters

NameDescriptionTypeAdditional information
foreignaccountkey

The Api Account to query

string

Required

foreignkey

The network on the account to query

string

Required

groupname

The name of the Group to query

string

Required

Body Parameters

The details of teh new APN Policy

DataControlPolicy
NameDescriptionTypeAdditional information
Zone

The name of an existing zone for which this policy is to be applied

string

None.

Quota

Gets and sets the data quota policy

DataControlQuotaPolicy

None.

UnderQuotaPolicy

Gets and sets the access policy to be applied when a device is under the quota defined by the Quota property

DataControlAccessPolicy

None.

OverQuotaPolicy

Gets and sets the access policy to be applied when a device is over the quota defined by the Quota property

DataControlAccessPolicy

None.

Request Formats

application/json, text/json

Sample:
{
  "Zone": "sample string 1",
  "Quota": {
    "CutoffAt": 1,
    "RestrictAt": 2,
    "SharedRestrictAt": 3,
    "Cycle": {
      "Period": 0,
      "Day": 1,
      "Hour": 2,
      "Minute": 3,
      "Timezone": 0,
      "UseDaylightSavings": true
    }
  },
  "UnderQuotaPolicy": {
    "Enabled": true,
    "AccessRate": 2,
    "UpstreamFirewall": "sample string 3",
    "DownstreamFirewall": "sample string 4",
    "LinkedDomainFilterPolicy": "sample string 5"
  },
  "OverQuotaPolicy": {
    "Enabled": true,
    "AccessRate": 2,
    "UpstreamFirewall": "sample string 3",
    "DownstreamFirewall": "sample string 4",
    "LinkedDomainFilterPolicy": "sample string 5"
  }
}

application/xml, text/xml

Sample:
<DataControlPolicy xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AS.Models.API">
  <OverQuotaPolicy>
    <PbnbId>6</PbnbId>
    <AccessRate>2</AccessRate>
    <DownstreamFirewall>sample string 4</DownstreamFirewall>
    <Enabled>true</Enabled>
    <LinkedDomainFilterPolicy>sample string 5</LinkedDomainFilterPolicy>
    <UpstreamFirewall>sample string 3</UpstreamFirewall>
  </OverQuotaPolicy>
  <Quota>
    <PbnbId>4</PbnbId>
    <CutoffAt>1</CutoffAt>
    <Cycle>
      <Day>1</Day>
      <Hour>2</Hour>
      <Minute>3</Minute>
      <Period>monthly</Period>
      <Timezone>GMT</Timezone>
      <UseDaylightSavings>true</UseDaylightSavings>
    </Cycle>
    <RestrictAt>2</RestrictAt>
    <SharedRestrictAt>3</SharedRestrictAt>
  </Quota>
  <UnderQuotaPolicy>
    <PbnbId>6</PbnbId>
    <AccessRate>2</AccessRate>
    <DownstreamFirewall>sample string 4</DownstreamFirewall>
    <Enabled>true</Enabled>
    <LinkedDomainFilterPolicy>sample string 5</LinkedDomainFilterPolicy>
    <UpstreamFirewall>sample string 3</UpstreamFirewall>
  </UnderQuotaPolicy>
  <Zone>sample string 1</Zone>
</DataControlPolicy>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'DataControlPolicy'.

Response Information

Resource Description

The newly created APN Policy

PBPRReturnOfDataControlPolicy
NameDescriptionTypeAdditional information
Data

DataControlPolicy

None.

Success

Gets the success status of the API call

boolean

None.

Meta

Gets the optional meta-data

Dictionary of string [key] and string [value]

None.

Code

Get the http code of the API call e.g. 200, 202, 409

integer

None.

ErrorCode

Get the failure error code of the API call. This is available if Success is false

integer

None.

ErrorSubCode

Gets the error sub code if available

integer

None.

ErrorDescription

Gets a textual description of the error

string

None.

StatusUrl

Gets the status url for any ACCEPTed API commands. Any command (POST,DELETE,PATCh,PUT) to the API usually returns a 202 response code. The status of the command can be queried using the URL provided

string

None.

ContinuationToken

Gets the token to be used for paged queries

string

None.

Response Formats

application/json, text/json

Sample:
{
  "Success": true,
  "Meta": {
    "sample string 1": "sample string 2",
    "sample string 3": "sample string 4"
  },
  "Code": 2,
  "ErrorCode": 3,
  "Data": {
    "Zone": "sample string 1",
    "Quota": {
      "CutoffAt": 1,
      "RestrictAt": 2,
      "SharedRestrictAt": 3,
      "Cycle": {
        "Period": 0,
        "Day": 1,
        "Hour": 2,
        "Minute": 3,
        "Timezone": 0,
        "UseDaylightSavings": true
      }
    },
    "UnderQuotaPolicy": {
      "Enabled": true,
      "AccessRate": 2,
      "UpstreamFirewall": "sample string 3",
      "DownstreamFirewall": "sample string 4",
      "LinkedDomainFilterPolicy": "sample string 5"
    },
    "OverQuotaPolicy": {
      "Enabled": true,
      "AccessRate": 2,
      "UpstreamFirewall": "sample string 3",
      "DownstreamFirewall": "sample string 4",
      "LinkedDomainFilterPolicy": "sample string 5"
    }
  },
  "ErrorSubCode": 4,
  "ErrorDescription": "sample string 5",
  "StatusUrl": "sample string 6",
  "ContinuationToken": "AxVEWREALVF6SRcfHlRCcA%3D%3D"
}

application/xml, text/xml

Sample:
<PBPRReturnOfDataControlPolicy7NMnQmOk xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AS.Models.API">
  <Code>2</Code>
  <ContinuationToken>AxVEWREALVF6SRcfHlRCcA%3D%3D</ContinuationToken>
  <ErrorCode>3</ErrorCode>
  <ErrorDescription>sample string 5</ErrorDescription>
  <ErrorSubCode>4</ErrorSubCode>
  <Meta xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:KeyValueOfstringstring>
      <d2p1:Key>sample string 1</d2p1:Key>
      <d2p1:Value>sample string 2</d2p1:Value>
    </d2p1:KeyValueOfstringstring>
    <d2p1:KeyValueOfstringstring>
      <d2p1:Key>sample string 3</d2p1:Key>
      <d2p1:Value>sample string 4</d2p1:Value>
    </d2p1:KeyValueOfstringstring>
  </Meta>
  <StatusUrl>sample string 6</StatusUrl>
  <Success>true</Success>
  <Data>
    <OverQuotaPolicy>
      <PbnbId>6</PbnbId>
      <AccessRate>2</AccessRate>
      <DownstreamFirewall>sample string 4</DownstreamFirewall>
      <Enabled>true</Enabled>
      <LinkedDomainFilterPolicy>sample string 5</LinkedDomainFilterPolicy>
      <UpstreamFirewall>sample string 3</UpstreamFirewall>
    </OverQuotaPolicy>
    <Quota>
      <PbnbId>4</PbnbId>
      <CutoffAt>1</CutoffAt>
      <Cycle>
        <Day>1</Day>
        <Hour>2</Hour>
        <Minute>3</Minute>
        <Period>monthly</Period>
        <Timezone>GMT</Timezone>
        <UseDaylightSavings>true</UseDaylightSavings>
      </Cycle>
      <RestrictAt>2</RestrictAt>
      <SharedRestrictAt>3</SharedRestrictAt>
    </Quota>
    <UnderQuotaPolicy>
      <PbnbId>6</PbnbId>
      <AccessRate>2</AccessRate>
      <DownstreamFirewall>sample string 4</DownstreamFirewall>
      <Enabled>true</Enabled>
      <LinkedDomainFilterPolicy>sample string 5</LinkedDomainFilterPolicy>
      <UpstreamFirewall>sample string 3</UpstreamFirewall>
    </UnderQuotaPolicy>
    <Zone>sample string 1</Zone>
  </Data>
</PBPRReturnOfDataControlPolicy7NMnQmOk>