Create quota rules

The tutorial in this section shows you how to create quota rules.

Create appId based quota rules

The following explains app ID based rules. This rule example suspends access to appId app1 for the autosuggest API, if the app1 usage for the autosuggest API exceeds 1000 requests.

Request

This example uses org123456789 as the realmId.

       POST https://quota.bam.api.here.com/v1/realms/org123456789/rules
    {
      "name": "Example rule",
      "description": "Alert on Log search IO threshold 10Gi.",
      "queryConditions": [
        {
          "key": "featureId",
          "value": "hrn:here:service::org123456789:search-autosuggest-7"
        },
        {
          "key": "appId",
          "value": "app1"
        }
      ],
      "usageThresholdCondition": {
        "thresholdType": "percentage",
        "threshold": 100,
        "usageLimit": 1000
      },
      "actionableEntity": {
        "entityId": "appId",
        "entityType": "app1"
      },
      "actions": [
        "alert",
        "suspend"
      ],
      "timeRange": {
        "duration": "monthly"
      },
      "emailNotifications": [
        "example@here.com",
        "test@here.com"
      ]
    }

Response: HTTP 201 Created

    {
      "ruleId": "CUSTOMER-QUOTA-db8ac3fb-f560-482c-a1e5-1626d503e4cd",
      "hrn": "hrn:here:quota::org123456789:CUSTOMER-QUOTA-db8ac3fb-f560-482c-a1e5-1626d503e4cd",
      "name": "Example rule",
      "description": "Alert on Log search IO threshold 10Gi.",
      "queryConditions": [
        {
          "key": "featureId",
          "value": "hrn:here:service::org123456789:search-autosuggest-7"
        },
        {
          "key": "appId",
          "value": "app1"
        }
      ],
      "usageThresholdCondition": {
        "thresholdType": "percentage",
        "threshold": 100,
        "usageLimit": 1000
      },
      "actionableEntity": {
        "entityId": "appId",
        "entityType": "app1"
      },
      "actions": [
        "alert",
        "suspend"
      ],
      "timeRange": {
        "duration": "monthly"
      },
      "emailNotifications": [
        "example@here.com",
        "test@here.com"
      ],
      "created": "2021-09-03T07:08:23Z",
      "modified": "2021-09-03T07:08:23Z",
      "createdBy": "dhIQFVejQgPkTXLn8CtH",
      "updatedBy": "dhIQFVejQgPkTXLn8CtH"
    }

results matching ""

    No results matching ""