Updated on 2024-06-24 GMT+08:00

Automation Rules

Automation rules are used to monitor information about SIM cards and data pools. When the conditions are met, the system will send SMS or email notifications to you at the specified interval. Currently, you can monitor the number of days before the physical SIM card expires, as well as the used and remaining data of the SIM card or data pool.

Creating a Rule

Log in to the GSL console and choose Automation Rules in the navigation pane. Click Create Rule.

Table 1 Rule parameters

Parameter

Description

Rule Name

You can customize the name of a rule for easy management.

Rule Type

Order management, Usage monitoring, Card status monitoring, and Data pool monitoring are available.

Trigger

Triggers are classified into the following types:

  • Plan expiration: trigger of the Order management rule
  • Data usage per period: trigger of the Usage monitoring rule.
  • Card status change: trigger of the Card status monitoring rule.
  • Forward data pool usage: trigger of the Data pool monitoring rule.
  • Backward data pool usage: trigger of the Data pool monitoring rule.

Condition

Trigger conditions are classified into the following types:

  • Days to expiry: condition for triggering an Order management rule.
  • Remaining data (MB): condition for triggering a Usage monitoring rule or Data pool monitoring rule.
  • Card status change (Inactive, Activatable, In use, Suspended, or Deregistered): condition for triggering a Card status monitoring rule.

Action

After a rule is triggered, available notification modes are as follows:

  • SMS & Email:
    • Notify: You can set the notification period as required.
    • SMS to: An example of the SMS notification template is displayed.
  • API push:
    • API push address: You can specify an API push address. If no push address is available, go to the Push Addresses page and add one.
    • Merged push: If you select Merge Events and Send, see API Merged Push Packet. If not, see API Push Packet.
    • Notify: You can set the notification period as required.
    • Push failure notification: If push failure notification is enabled, you will receive a notification in the Message Center when a push fails. Choose Message Receiving Management in the navigation pane, you can configure the recipients of SMS or email notifications for different message types.

Filter

By default, all SIM cards in your account are monitored. You can use a filter to specify the objects to be monitored.

  • Plan: You can filter SIM cards by the purchased plan.
  • Tag: You can filter SIM cards by the tag.
  • Forward data pool: You can filter SIM cards by the forward data pool name.
  • Backward data pool: You can filter SIM cards by the backward data pool name.

Execution Records

Log in to the GSL console, choose Automation Rules in the navigation pane, and click the Execution Records tab.

All rule execution records are displayed. You can view the cards that trigger the rule, triggering conditions, and email addresses or SMS recipients that receive notifications.

Push Addresses

Log in to the GSL console, choose Automation Rules in the navigation pane, and click the Push Addresses tab. Click Add Address, enter information as required, and click Test.

You can view and manage existing push addresses on the Push Addresses page.

Parameter

Description

Push Address

URL of the push address.

Certificate File Name

Server certificate (in .pem format) corresponding to the URL.

API Push Packet

Push body parameters

Parameter

Type

Description

cid

string

Container ID.

ruleType

int

Rule types:

  • 1: Order management
  • 2: Usage monitoring
  • 3: Data pool monitoring
  • 4: Card status monitoring

templateName

string

Template names:

  • api_rule_price_plan_expired: template for SIM card plan expiration
  • api_rule_flow_usage_remain: template for data usage per period
  • api_rule_sim_status_modify: template for card status change
  • api_sim_pool_rule_flow_usage_remain: template for pool data usage per period
  • sim_pool_rule_flow_usage: email template for forward data pool
  • sim_pool_rule_flow_usage_remain: email template for forward data pool
  • back_pool_rule_flow_usage: email template for backward data pool
  • api_back_pool_rule_flow_usage: API push template for backward data pool data usage per period

templateParams

list

Template parameter set. It is recommended that you parse the parameter set based on the key value. Other key values may be added later.

SIM card plan expiration (api_rule_price_plan_expired)

[GSL] Dear {accountName}, your SIM card (container ID: {cid}, plan name: {pricePlanName}) will expire in {daysToExpire} days. Please renew it in time.

{
  "cid": "4441380627973120",
  "ruleType": 1,
  "templateName": "api_rule_price_plan_expired",
  "templateParams": [
    {
      "key": "cid",
      "value": "4441380627973120"
    },
    {
      "key": "pricePlanName",
      "value": "China Mobile: 30 MB/month"
    },
    {
      "key": "poolId",
      "value": "0"
    },
    {
      "key": "daysToExpire",
      "value": "9"
    }
  ]
}

Data usage per period (api_rule_flow_usage_remain)

[GSL] Dear {accountName}, your SIM card (container ID: {cid}, plan name: {pricePlanName}) has less than {remainFlow} MB data. Monitor your usage to avoid disconnection.

{
  "cid": "4441380627973120",
  "ruleType": 1,
  "templateName": "api_rule_flow_usage_remain",
  "templateParams": [
    {
      "key": "cid",
      "value": "4441380627973120"
    },
    {
      "key": "pricePlanName",
      "value": "China Mobile: 30 MB/month"
    },
    {
      "key": "remainFlow",
      "value": "100"
    }
  ]
}

Card status change (api_rule_sim_status_modify)

[GSL] Dear {accountName}, your SIM card (container ID: {cid}) changed from {oldStatus} to {newStatus} at {modifyTime}.

{
  "cid":"2021080621060000T",
  "ruleType":4,
  "templateName":"api_rule_sim_status_modify",
  "templateParams":[
    {
	"key":"cid","value":"2021080621060000T"
    },
    {
	"key":"modifyTime","value":"2022-05-16 03:24:08"
    },
    {
	"key":"oldStatus","value":"Inactive"
    },
    {
	"key":"newStatus","value":"Activatable"
    }
  ]
}

Pool data usage per period (api_sim_pool_rule_flow_usage_remain)

[GSL] Dear {accountName}, your data pool (pool ID: {poolId}, pool name: {poolName}, plan name: {pricePlanName}) has less than {remainFlow} MB data. Monitor your usage to avoid disconnection.

{
  "cid": "4441380627973120",
  "ruleType": 1,
  "templateName": "api_sim_pool_rule_flow_usage_remain",
  "templateParams": [
    {
      "key": "poolId",
      "value": "4441380627973120"
    },
    {
      "key": "poolName",
      "value": "xx data pool"
    },
    {
      "key": "pricePlanName",
      "value": "China Mobile: 30 MB/month"
    },
    {
      "key": "remainFlow",
      "value": "100"
    }
  ]
}

Email template for forward data pool (sim_pool_rule_flow_usage)

[Huawei Cloud] Dear {Account}, your forward data pool (pool ID: {poolId}, pool name: {poolName}, plan name: {pricePlanName}) has used {usageFlow} MB data. Monitor your usage to avoid disconnection.

{
  "cid": "null",
  "ruleType": 3,
  "templateName": "api_back_pool_rule_flow_usage_remain",
  "templateParams": [
    {
      "key": "poolId",
      "value": "4441380627973120"
    },
    {
      "key": "poolName",
      "value": "xx data pool"
    },
    {
      "key": "pricePlanName",
      "value": "China Telecom Commercial: tiered data pool"
    },
    {
      "key": "usageFlow",
      "value": "100"
    }
  ]
}

Email template for forward data pool (sim_pool_rule_flow_usage_remain)

[Huawei Cloud] Dear {Account}, your forward data pool (pool ID: {poolId}, pool name: {poolName}, plan name: {pricePlanName}) has less than {remainFlow} MB data. Monitor your usage to avoid disconnection.

{
  "cid": "4441380627973120",
  "ruleType": 1,
  "templateName": "api_sim_pool_rule_flow_usage_remain",
  "templateParams": [
    {
      "key": "poolId",
      "value": "4441380627973120"
    },
    {
      "key": "poolName",
      "value": "xx data pool"
    },
    {
      "key": "pricePlanName",
      "value": "China Mobile: 30 MB/month"
    },
    {
      "key": "remainFlow",
      "value": "100"
    }
  ]
}

Email template for backward data pool (back_pool_rule_flow_usage)

[Huawei Cloud] Dear {Account}, your backward data pool (pool ID: {poolId}, pool name: {poolName}, plan name: {pricePlanName}) has used {usageFlow} MB data. Monitor your usage to avoid excessive fees.

{
  "cid": "null",
  "ruleType": 3,
  "templateName": "api_back_pool_rule_flow_usage_remain",
  "templateParams": [
    {
      "key": "poolId",
      "value": "4441380627973120"
    },
    {
      "key": "poolName",
      "value": "xx data pool"
    },
    {
      "key": "pricePlanName",
      "value": "China Telecom Commercial: tiered data pool"
    },
    {
      "key": "usageFlow",
      "value": "100"
    }
  ]
}

API push template for backward data pool data usage per period (api_back_pool_rule_flow_usage)

[Huawei Cloud] Dear {Account}, your backward data pool (pool ID: {poolId}, pool name: {poolName}, plan name: {pricePlanName}) has used {usageFlow} MB data. Monitor your usage to avoid excessive fees.

{
  "cid": "null",
  "ruleType": 3,
  "templateName": "api_back_pool_rule_flow_usage_remain",
  "templateParams": [
    {
      "key": "poolId",
      "value": "4441380627973120"
    },
    {
      "key": "poolName",
      "value": "xx data pool"
    },
    {
      "key": "pricePlanName",
      "value": "China Telecom Commercial: tiered data pool"
    },
    {
      "key": "usageFlow",
      "value": "100"
    }
  ]
}

API Merged Push Packet

Push body parameters

Parameter

Type

Description

ruleType

int

Rule types:

  • 1: Order management
  • 2: Usage monitoring
  • 4: Card status monitoring

templateName

string

Template names:

api_rule_price_plan_expired: template for SIM card plan expiration

api_rule_flow_usage_remain: template for data usage per period

api_rule_sim_status_modify: template for card status change

templateParamsList

array

A template parameter set that contains information about a maximum of 500 cards.

templateParamsList.templateParams

array

Template parameter set for individual cards. It is recommended that you parse the parameter set based on the key value. Other key values may be added later.

SIM card plan expiration (api_rule_price_plan_expired)
{
  "ruleType": 1,
  "templateName": "api_rule_price_plan_expired",
  "templateParamsList": [
    {
      "templateParams": [
        {
          "key": "cid",
          "value": "4441380627973120"
        },
        {
          "key": "pricePlanName",
          "value": "China Mobile: 30 MB/month"
        },
        {
          "key": "daysToExpire",
          "value": "9"
        }
      ]
    },
    {
      "templateParams": [...]
    }
    ...
  ]
}

Data usage per period (api_rule_flow_usage_remain)

{
  "ruleType": 2,
  "templateName": "api_rule_flow_usage",
  "templateParamsList": [
    {
      "templateParams": [
        {
          "key": "cid",
          "value": "4441380627973120"
        },
        {
          "key": "pricePlanName",
          "value": "China Mobile: 30 MB/month"
        },
        {
          "key": "usageFlow",
          "value": "100"
        }
      ]
    },
    {
      "templateParams": [...]
    }
    ...
  ]
}

Card status change (api_rule_sim_status_modify)

{
  "ruleType": 4,
  "templateName": "api_rule_sim_status_modify",
  "templateParamsList": [
    {
      "templateParams": [
        {
          "key": "cid",
          "value": "2021080621060000T"
        },
        {
          "key": "modifyTime",
          "value": "2022-05-16 03:24:08"
        },
        {
          "key": "oldStatus",
          "value": "Inactive"
        },
        {
          "key": "newStatus",
          "value": "Activatable"
        }
      ]
    },
    {
      "templateParams": [...]
    }
    ...
  ]
}

API Push Failure Notification

If you select API push as the notification type and enable the push failure notification, you will receive a notification in the Message Center when a push fails.

Example:

Dear {accountName},
API push of automation rule {ruleName} failed at {pushTime}. Push URL: {pushUrl}. For details, see the attachment.
This email is automatically sent by the GSL system. Please do not reply.
Thank you for your support.
  • If you select API push and Merge Events and Send, the packet is different from that when Merge Events and Send is not selected.
  • Merged push is not available for data pool usage notifications.
  • The attachment is the content of the packet that fails to be pushed.