- [HTTP request](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyGetRuleCounts#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyGetRuleCounts#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyGetRuleCounts#body.request_body)
- [Response body](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyGetRuleCounts#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyGetRuleCounts#body.LegacyGetRuleCountsResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyGetRuleCounts#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyGetRuleCounts#body.aspect_1)
- [UserFacingRuleTypeToCount](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyGetRuleCounts#UserFacingRuleTypeToCount)
  - [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyGetRuleCounts#UserFacingRuleTypeToCount.SCHEMA_REPRESENTATION)

**Full name**: projects.locations.instances.legacy.legacyGetRuleCounts

RPC to get rule counts.

### HTTP request

`GET https://{endpoint}/v1alpha/{instance}/legacy:legacyGetRuleCounts`

Where `{endpoint}` is one of the [supported service endpoints](https://docs.cloud.google.com/chronicle/docs/reference/rest#rest_endpoints).

### Path parameters

| Parameters ||
|---|---|
| `instance` | `string` Required. The name of the parent resource, which is the SecOps instance the resource belongs to. Format: projects/{project}/locations/{location}/instances/{instance} |

### Request body

The request body must be empty.

### Response body

A legacy rpc response for rule count stats.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "totalActiveCount": integer, "totalArchivedCount": integer, "totalLiveRuleCountsPerRuleType": [ { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyGetRuleCounts#UserFacingRuleTypeToCount`) } ], "maxLiveRuleCountsPerRuleType": [ { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyGetRuleCounts#UserFacingRuleTypeToCount`) } ], "totalLiveRuleCount": integer, "maxLiveRuleCount": integer, "chronicleRulesQuotaLimit": integer, "chronicleRulesQuotaUsage": integer } ``` |

| Fields ||
|---|---|
| `totalActiveCount` | `integer` Number of active rules for a customer. |
| `totalArchivedCount` | `integer` Number of archived rules for a customer. |
| `totalLiveRuleCountsPerRuleType[]` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyGetRuleCounts#UserFacingRuleTypeToCount`)`` Total rule count of all enabled Live Rules, per RuleType. |
| `maxLiveRuleCountsPerRuleType[]` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyGetRuleCounts#UserFacingRuleTypeToCount`)`` Maximum rule count of all enabled Live Rules, per RuleType. |
| `totalLiveRuleCount` | `integer` Total rule count |
| `maxLiveRuleCount` | `integer` Maximum rule count |
| `chronicleRulesQuotaLimit` | `integer` Chronicle rules quota limit. |
| `chronicleRulesQuotaUsage` | `integer` Chronicle rules quota usage. |

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloud-platform`
- `
  https://www.googleapis.com/auth/chronicle`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `instance` resource:

- `chronicle.legacies.legacyGetRuleCounts`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).

## UserFacingRuleTypeToCount

| JSON representation |
|---|
| ``` { "type": enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/UserFacingRuleType`), "count": integer } ``` |

| Fields ||
|---|---|
| `type` | ``enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/UserFacingRuleType`)`` |
| `count` | `integer` |