# Method: aggregateIssueStats

- [HTTP request](https://docs.cloud.google.com/database-center/docs/reference/rest/v1beta/TopLevel/aggregateIssueStats#body.HTTP_TEMPLATE)
- [Request body](https://docs.cloud.google.com/database-center/docs/reference/rest/v1beta/TopLevel/aggregateIssueStats#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/database-center/docs/reference/rest/v1beta/TopLevel/aggregateIssueStats#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/database-center/docs/reference/rest/v1beta/TopLevel/aggregateIssueStats#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/database-center/docs/reference/rest/v1beta/TopLevel/aggregateIssueStats#body.AggregateIssueStatsResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/database-center/docs/reference/rest/v1beta/TopLevel/aggregateIssueStats#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/database-center/docs/reference/rest/v1beta/TopLevel/aggregateIssueStats#body.aspect_1)
- [IssueGroupStats](https://docs.cloud.google.com/database-center/docs/reference/rest/v1beta/TopLevel/aggregateIssueStats#IssueGroupStats)
  - [JSON representation](https://docs.cloud.google.com/database-center/docs/reference/rest/v1beta/TopLevel/aggregateIssueStats#IssueGroupStats.SCHEMA_REPRESENTATION)
- [IssueStats](https://docs.cloud.google.com/database-center/docs/reference/rest/v1beta/TopLevel/aggregateIssueStats#IssueStats)
  - [JSON representation](https://docs.cloud.google.com/database-center/docs/reference/rest/v1beta/TopLevel/aggregateIssueStats#IssueStats.SCHEMA_REPRESENTATION)
- [Try it!](https://docs.cloud.google.com/database-center/docs/reference/rest/v1beta/TopLevel/aggregateIssueStats#try-it)

v1beta.aggregateIssueStats provides database resource issues statistics.

### HTTP request

`POST https://databasecenter.googleapis.com/v1beta:aggregateIssueStats`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "parent": string, "filter": string, "signalTypeGroups": [ { object (`https://docs.cloud.google.com/database-center/docs/reference/rest/v1beta/SignalTypeGroup`) } ], "baselineDate": { object (`https://docs.cloud.google.com/database-center/docs/reference/rest/v1beta/Date`) } } ``` |

| Fields ||
|---|---|
| `parent` | `string` Required. Parent can be a project, a folder, or an organization. The search is limited to the resources within the `scope`. The allowed values are: - projects/{PROJECT_ID} (e.g., "projects/foo-bar") - projects/{PROJECT_NUMBER} (e.g., "projects/12345678") - folders/{FOLDER_NUMBER} (e.g., "folders/1234567") - organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456") |
| `filter` | `string` Optional. The expression to filter resources. Supported fields are: `fullResourceName`, `resourceType`, `container`, `product.type`, `product.engine`, `product.version`, `location`, `labels`, `issues`, fields of availability_info, data_protection_info,'resourceName', etc. The expression is a list of zero or more restrictions combined via logical operators `AND` and `OR`. When `AND` and `OR` are both used in the expression, parentheses must be appropriately used to group the combinations. Example: `location="us-east1"` Example: `container="projects/123" OR container="projects/456"` Example: `(container="projects/123" OR container="projects/456") AND location="us-east1"` |
| `signalTypeGroups[]` | ``object (`https://docs.cloud.google.com/database-center/docs/reference/rest/v1beta/SignalTypeGroup`)`` Optional. Lists of signal types that are issues. |
| `baselineDate` | ``object (`https://docs.cloud.google.com/database-center/docs/reference/rest/v1beta/Date`)`` Optional. The baseline date w.r.t. which the delta counts are calculated. If not set, delta counts are not included in the response and the response indicates the current state of the fleet. |

### Response body

The response message containing one of more group of relevant health issues for database resources.

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

| JSON representation |
|---|
| ``` { "issueGroupStats": [ { object (`https://docs.cloud.google.com/database-center/docs/reference/rest/v1beta/TopLevel/aggregateIssueStats#IssueGroupStats`) } ], "totalResourcesCount": integer, "totalResourceGroupsCount": integer, "unreachable": [ string ] } ``` |

| Fields ||
|---|---|
| `issueGroupStats[]` | ``object (`https://docs.cloud.google.com/database-center/docs/reference/rest/v1beta/TopLevel/aggregateIssueStats#IssueGroupStats`)`` List of issue group stats where each group contains stats for resources having a particular combination of relevant issues. |
| `totalResourcesCount` | `integer` Total count of the resources filtered in based on the user given filter. |
| `totalResourceGroupsCount` | `integer` Total count of the resource filtered in based on the user given filter. |
| `unreachable[]` | `string` Unordered list. List of unreachable regions from where data could not be retrieved. |

### Authorization scopes

Requires the following OAuth scope:

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

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 `parent` resource:

- `databasecenter.fleetHealthStats.list`

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

## IssueGroupStats

IssueGroupStats refers to stats for a particulare combination of relevant health issues of database resources.

| JSON representation |
|---|
| ``` { "displayName": string, "resourceGroupsCount": integer, "resourcesCount": integer, "healthyResourceGroupsCount": integer, "healthyResourcesCount": integer, "issueStats": [ { object (`https://docs.cloud.google.com/database-center/docs/reference/rest/v1beta/TopLevel/aggregateIssueStats#IssueStats`) } ] } ``` |

| Fields ||
|---|---|
| `displayName` | `string` Database resource level health card name. This will corresponds to one of the requested input group names. |
| `resourceGroupsCount` | `integer` Total count of the groups of resources returned by the filter that also have one or more resources for which any of the specified issues are applicable. |
| `resourcesCount` | `integer` Total count of resources returned by the filter for which any of the specified issues are applicable. |
| `healthyResourceGroupsCount` | `integer` The number of resource groups from the total groups as defined above that are healthy with respect to all of the specified issues. |
| `healthyResourcesCount` | `integer` The number of resources from the total defined above in field totalResourcesCount that are healthy with respect to all of the specified issues. |
| `issueStats[]` | ``object (`https://docs.cloud.google.com/database-center/docs/reference/rest/v1beta/TopLevel/aggregateIssueStats#IssueStats`)`` List of issues stats containing count of resources having particular issue category. |

## IssueStats

IssueStats holds stats for a particular signal category.

| JSON representation |
|---|
| ``` { "signalType": enum (`https://docs.cloud.google.com/database-center/docs/reference/rest/v1beta/SignalType`), "resourceCount": integer, "deltaDetails": { object (`https://docs.cloud.google.com/database-center/docs/reference/rest/v1beta/DeltaDetails`) }, "issueSeverity": enum (`https://docs.cloud.google.com/database-center/docs/reference/rest/v1beta/IssueSeverity`) } ``` |

| Fields ||
|---|---|
| `signalType` | ``enum (`https://docs.cloud.google.com/database-center/docs/reference/rest/v1beta/SignalType`)`` Type of signal which is an issue. |
| `resourceCount` | `integer` Number of resources having issues of a given type. |
| `deltaDetails` | ``object (`https://docs.cloud.google.com/database-center/docs/reference/rest/v1beta/DeltaDetails`)`` Optional. Delta counts and details of resources for which issue was raised or fixed. |
| `issueSeverity` | ``enum (`https://docs.cloud.google.com/database-center/docs/reference/rest/v1beta/IssueSeverity`)`` Severity of the issue. |