case_views
Creates, updates, deletes, gets or lists a case_views resource.
Overview
| Name | case_views |
| Type | Resource |
| Id | datadog.service_management.case_views |
Fields
The following fields are returned by SELECT queries:
- get_case_view
- list_case_views
| Name | Datatype | Description |
|---|---|---|
id | string | The view's identifier. (example: a1b2c3d4-e5f6-7890-abcd-ef1234567890) |
attributes | object | Attributes of a case view, including the filter query and optional notification rule. |
relationships | object | Related resources for the case view, including the creator, last modifier, and associated project. |
type | string | JSON:API resource type for case views. (view) (default: view, example: view) |
| Name | Datatype | Description |
|---|---|---|
id | string | The view's identifier. (example: a1b2c3d4-e5f6-7890-abcd-ef1234567890) |
attributes | object | Attributes of a case view, including the filter query and optional notification rule. |
relationships | object | Related resources for the case view, including the creator, last modifier, and associated project. |
type | string | JSON:API resource type for case views. (view) (default: view, example: view) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_case_view | select | view_id | Returns a single saved case view identified by its UUID, including its query, associated project, and timestamps. | |
list_case_views | select | project_id | Returns all saved case views for a given project. Views are saved search queries that allow quick access to filtered lists of cases. | |
create_case_view | insert | data | Creates a new saved case view with a name, filter query, and associated project. Optionally, a notification rule can be linked to the view. | |
update_case_view | replace | view_id, data | Updates the name, query, or notification rule of an existing case view. | |
delete_case_view | delete | view_id | Permanently deletes a saved case view. |
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 |
|---|---|---|
project_id | string | Filter views by project identifier. (example: e555e290-ed65-49bd-ae18-8acbfcf18db7) |
site | string | The Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both. |
view_id | string | The UUID of the case view. (example: a1b2c3d4-e5f6-7890-abcd-ef1234567890) |
SELECT examples
- get_case_view
- list_case_views
Returns a single saved case view identified by its UUID, including its query, associated project, and timestamps.
SELECT
id,
attributes,
relationships,
type
FROM datadog.service_management.case_views
WHERE view_id = '{{ view_id }}' -- required
;
Returns all saved case views for a given project. Views are saved search queries that allow quick access to filtered lists of cases.
SELECT
id,
attributes,
relationships,
type
FROM datadog.service_management.case_views
WHERE project_id = '{{ project_id }}' -- required
;
INSERT examples
- create_case_view
- Manifest
Creates a new saved case view with a name, filter query, and associated project. Optionally, a notification rule can be linked to the view.
INSERT INTO datadog.service_management.case_views (
data
)
SELECT
'{{ data }}' /* required */
RETURNING
data
;
# Description fields are for documentation purposes
- name: case_views
props:
- name: data
description: |
Data object for creating a case view.
value:
attributes:
name: "{{ name }}"
np_rule_id: "{{ np_rule_id }}"
project_id: "{{ project_id }}"
query: "{{ query }}"
type: "{{ type }}"
REPLACE examples
- update_case_view
Updates the name, query, or notification rule of an existing case view.
REPLACE datadog.service_management.case_views
SET
data = '{{ data }}'
WHERE
view_id = '{{ view_id }}' --required
AND data = '{{ data }}' --required
RETURNING
data;
DELETE examples
- delete_case_view
Permanently deletes a saved case view.
DELETE FROM datadog.service_management.case_views
WHERE view_id = '{{ view_id }}' --required
;