Update quota rules

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

Update a quota rule defined for your organization by quota rule ID

You can update a specific quota rule for your organization by using a quota rule ID, as shown here.

Request

This example uses org123456789 as the realmId.

    PUT https://quota.bam.api.here.com/v1/realms/org123456789/rules/CUSTOMER-QUOTA-db8ac3fb-f560-482c-a1e5-1626d503e4cd

Response

   {
     "name": "Example rule (updated)",
     "description": "Alert on Log search IO threshold 10Gi.",
     "actionableEntity": {
       "entityId": "hrn:here:authorization::org123456789:project/my-project-0000",
       "entityType": "projectHrn"
     },
     "actions": [
       "alert"
     ],
     "queryConditions": [
       {
         "key": "featureId",
         "value": "hrn:here:portal::org123456789:logs"
       }
     ],
     "usageThresholdCondition": {
       "thresholdType": "percentage",
       "threshold": 70,
       "usageLimit": 70
     },
     "timeRange": {
       "duration": "monthly"
     },
     "emailNotifications": [
       "example@here.com",
       "test@here.com"
     ],
   }

Response: HTTP 200 OK

   {
       "ruleId": "CUSTOMER-QUOTA-db8ac3fb-f560-482c-a1e5-1626d503e4cd",
       "hrn": "hrn:here:quota::org123456789:CUSTOMER-QUOTA-db8ac3fb-f560-482c-a1e5-1626d503e4cd",
       "name": "Example rule (updated)",
       "description": "Alert on Log search IO threshold 10Gi.",
       "status": "active",
       "queryConditions": [
           {
               "key": "featureId",
               "value": "hrn:here:portal::org123456789:logs"
           }
       ],
       "usageThresholdCondition": {
           "thresholdType": "percentage",
           "threshold": 70,
           "usageLimit": 70
       },
       "actions": [
           "alert"
       ],
       "actionableEntity": {
           "entityType": "projectHrn",
           "entityId": "hrn:here:authorization::org123456789:project/my-project-0000"
       },
       "timeRange": {
           "duration": "monthly"
       },
       "ruleType": "alert",
       "emailNotifications": [
           "example@here.com",
           "test@here.com"
       ],
       "created": "2021-09-03T07:08:23Z",
       "modified": "2021-09-03T07:25:26Z",
       "createdBy": "dhIQFVejQgPkTXLn8CtH",
       "updatedBy": "dhIQFVejQgPkTXLn8CtH"
   }

Update appId based quota rules

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

Request

       PUT https://quota.bam.api.here.com/v1/realms/org123456789/rules/CUSTOMER-QUOTA-db8ac3fb-f560-482c-a1e5-1626d503e4cd
    {
      "name": "Auto suggest rule(updated)",
      "description": "Alert on Autosuggest threshold over 1000 request.",
      "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 200 updated

    {
      "ruleId": "CUSTOMER-QUOTA-db8ac3fb-f560-482c-a1e5-1626d503e4cd",
      "hrn": "hrn:here:quota::org123456789:CUSTOMER-QUOTA-db8ac3fb-f560-482c-a1e5-1626d503e4cd",
      "name": "Auto suggest rule(updated)",
      "description": "Alert on Autosuggest threshold over 1000 request.",
      "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 ""