metrics_searches_v2
Creates, updates, deletes, gets or lists a metrics_searches_v2 resource.
Overview​
| Name | metrics_searches_v2 |
| Type | Resource |
| Id | sumologic.metrics_searches.metrics_searches_v2 |
Fields​
The following fields are returned by SELECT queries:
- get
- list
Metrics search page that was requested.
| Name | Datatype | Description |
|---|---|---|
id | string | Unique identifier for the metrics search page. (example: B23OjNs5ZCyn5VdMwOBoLo3PjgRnJSAlNTKEDAcpuDG2CIgRe9KFXMofm2H2) |
folder_id | string | The identifier of the folder to save the metrics search in. By default it is saved in your personal folder. (example: 000000000C1C17C6) (wire: folderId) |
description | string | Description of the metrics search page. |
queries | array | Queries of the metrics search page. |
time_range | object | (wire: timeRange) |
title | string | Title of the metrics search page. (pattern: <code>^\s*\S.*$</code>, x-pattern-message: must contain at least 1 non-whitespace character) |
visual_settings | string | Visual settings of the metrics search page. (wire: visualSettings) |
Paginated list of metrics search pages under the Personal folder created by the user or viewable by user.
| Name | Datatype | Description |
|---|---|---|
id | string | Unique identifier for the metrics search page. (example: B23OjNs5ZCyn5VdMwOBoLo3PjgRnJSAlNTKEDAcpuDG2CIgRe9KFXMofm2H2) |
folder_id | string | The identifier of the folder to save the metrics search in. By default it is saved in your personal folder. (example: 000000000C1C17C6) (wire: folderId) |
description | string | Description of the metrics search page. |
queries | array | Queries of the metrics search page. |
time_range | object | (wire: timeRange) |
title | string | Title of the metrics search page. (pattern: <code>^\s*\S.*$</code>, x-pattern-message: must contain at least 1 non-whitespace character) |
visual_settings | string | Visual settings of the metrics search page. (wire: visualSettings) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | id, region | Get a metrics search page by the given identifier. | |
list | select | region | limit, token, mode | List all metrics search pages under the Personal folder created by the user or under folders viewable by user. |
create | insert | region, queries, time_range, title | Creates a new metrics search page. | |
update | update | id, region, queries, time_range, title | Update a metrics search page by the given identifier. | |
delete | delete | id, region | Delete metrics search page by the given identifier. |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
id | string | Unique identifier of the metrics search page to delete. |
region | string | Sumo Logic deployment (au, ca, ch, de, eu, fed, in, jp, kr, us1, us2). Resolved from the SUMOLOGIC_ENVIRONMENT environment variable when it is set (x-stackQL-envVar, the same variable the Terraform provider reads); otherwise defaults to us2. A WHERE region = '...' value always takes precedence. (enum: [au, ca, ch, de, eu, fed, in, jp, kr, us1, us2], default: us2, x-stackQL-envVar: SUMOLOGIC_ENVIRONMENT) |
limit | integer (int32) | Limit the number of metric searches returned in the response. The number of metric searches returned may be less than the limit. (example: 50) |
mode | string | whether to list all viewable metric searches under the folders |
token | string | Continuation token to get the next page of results. A page object with the next continuation token is returned in the response body. Subsequent GET requests should specify the continuation token to get the next page of results. token is set to null when no more pages are left. (example: GDCiRv4vebF3UWFJQ1kySXBOR3Bzh69GR0RyWm9vCtc) |
SELECT examples​
- get
- list
Get a metrics search page by the given identifier.
SELECT
id,
folder_id,
description,
queries,
time_range,
title,
visual_settings
FROM sumologic.metrics_searches.metrics_searches_v2
WHERE id = '{{ id }}' -- required
AND region = '{{ region }}' -- required unless SUMOLOGIC_ENVIRONMENT is set
;
List all metrics search pages under the Personal folder created by the user or under folders viewable by user.
SELECT
id,
folder_id,
description,
queries,
time_range,
title,
visual_settings
FROM sumologic.metrics_searches.metrics_searches_v2
WHERE region = '{{ region }}' -- required unless SUMOLOGIC_ENVIRONMENT is set
AND limit = '{{ limit }}'
AND token = '{{ token }}'
AND mode = '{{ mode }}'
;
INSERT examples​
- create
- Manifest
Creates a new metrics search page.
INSERT INTO sumologic.metrics_searches.metrics_searches_v2 (
title,
time_range,
description,
queries,
visual_settings,
folder_id,
region
)
SELECT
'{{ title }}' /* required */,
'{{ time_range }}' /* required */,
'{{ description }}',
'{{ queries }}' /* required */,
'{{ visual_settings }}',
'{{ folder_id }}',
'{{ region }}'
RETURNING
id,
folder_id,
description,
queries,
time_range,
title,
visual_settings
;
# Description fields are for documentation purposes
- name: metrics_searches_v2
props:
- name: region
value: "{{ region }}"
description: Required parameter for the metrics_searches_v2 resource.
- name: title
value: "{{ title }}"
description: |
Title of the metrics search page.
- name: time_range
value:
type: "{{ type }}"
- name: description
value: "{{ description }}"
description: |
Description of the metrics search page.
- name: queries
description: |
Queries of the metrics search page.
value:
- queryString: "{{ queryString }}"
queryType: "{{ queryType }}"
queryKey: "{{ queryKey }}"
metricsQueryMode: "{{ metricsQueryMode }}"
metricsQueryData:
metric: "{{ metric }}"
aggregationType: "{{ aggregationType }}"
groupBy: "{{ groupBy }}"
filters:
- key: "{{ key }}"
value: "{{ value }}"
negation: {{ negation }}
operators:
- operatorName: "{{ operatorName }}"
parameters: "{{ parameters }}"
tracesQueryData:
filters:
- type: "{{ type }}"
spansQueryData:
filters:
- type: "{{ type }}"
fieldName: "{{ fieldName }}"
visualizations:
- type: "{{ type }}"
name: "{{ name }}"
groupBy:
- type: "{{ type }}"
limit:
- direction: "{{ direction }}"
limitValue: {{ limitValue }}
parseMode: "{{ parseMode }}"
timeSource: "{{ timeSource }}"
transient: {{ transient }}
outputCardinalityLimit: {{ outputCardinalityLimit }}
- name: visual_settings
value: "{{ visual_settings }}"
description: |
Visual settings of the metrics search page.
- name: folder_id
value: "{{ folder_id }}"
description: |
The identifier of the folder to save the metrics search in. By default it is saved in your personal folder.
UPDATE examples​
- update
Update a metrics search page by the given identifier.
UPDATE sumologic.metrics_searches.metrics_searches_v2
SET
title = '{{ title }}',
time_range = '{{ time_range }}',
description = '{{ description }}',
queries = '{{ queries }}',
visual_settings = '{{ visual_settings }}',
folder_id = '{{ folder_id }}'
WHERE
id = '{{ id }}' --required
AND region = '{{ region }}' --required unless SUMOLOGIC_ENVIRONMENT is set
AND queries = '{{ queries }}' --required
AND time_range = '{{ time_range }}' --required
AND title = '{{ title }}' --required
RETURNING
id,
folder_id,
description,
queries,
time_range,
title,
visual_settings;
DELETE examples​
- delete
Delete metrics search page by the given identifier.
DELETE FROM sumologic.metrics_searches.metrics_searches_v2
WHERE id = '{{ id }}' --required
AND region = '{{ region }}' --required unless SUMOLOGIC_ENVIRONMENT is set
;