folders
Creates, updates, deletes, gets or lists a folders resource.
Overview​
| Name | folders |
| Type | Resource |
| Id | sumologic.content.folders |
Fields​
The following fields are returned by SELECT queries:
- get
Folder that was requested.
| Name | Datatype | Description |
|---|---|---|
id | string | Identifier of the content item. (example: 000000000C1C17C6) |
name | string | The name of the content item. (example: Personal) |
parent_id | string | Identifier of the parent content item. (example: 0000000001C41EF2) (wire: parentId) |
children | array | A list of the content items. |
created_at | string (date-time) | Creation timestamp in UTC in [RFC3339](https:​//tools.ietf.org/html/rfc3339) format. (example: 2018-10-16T09:10:00.000Z) (wire: createdAt) |
created_by | string | Identifier of the user who created the resource. (example: 0000000006743FDD) (wire: createdBy) |
description | string | Description of the content item. (example: Personal folder for John Doe) |
is_scheduled | boolean | Indicates whether the content item refers to scheduled search. This field is only relevant to Search content type. (wire: isScheduled) |
item_type | string | Type of the content item. Supported values are: 1. Folder 2. Search 3. Report (for old dashboards) 4. Dashboard (for new dashboards) 5. Lookups (example: Folder) (wire: itemType) |
modified_at | string (date-time) | Last modification timestamp in UTC. (example: 2018-10-16T09:10:00.000Z) (wire: modifiedAt) |
modified_by | string | Identifier of the user who last modified the resource. (example: 0000000006743FE8) (wire: modifiedBy) |
permissions | array | List of permissions the user has on the content item. |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | id, region | is_admin_mode | Get a folder with the given identifier. Set the header parameter isAdminMode to "true" if fetching a folder inside "Admin Recommended" folder. |
create | insert | region, name, parent_id | is_admin_mode | Creates a new folder under the given parent folder. Set the header parameter isAdminMode to "true" to create a folder inside "Admin Recommended" folder. |
update | update | id, region, name | is_admin_mode | Update an existing folder with the given identifier. Set the header parameter isAdminMode to "true" if updating a folder inside "Admin Recommended" folder. |
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 | Identifier of the folder to update. |
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) |
is_admin_mode | string | Set this to "true" if you want to perform the request as a Content Administrator. (wire: isAdminMode) |
SELECT examples​
- get
Get a folder with the given identifier. Set the header parameter isAdminMode to "true" if fetching a folder inside "Admin Recommended" folder.
SELECT
id,
name,
parent_id,
children,
created_at,
created_by,
description,
is_scheduled,
item_type,
modified_at,
modified_by,
permissions
FROM sumologic.content.folders
WHERE id = '{{ id }}' -- required
AND region = '{{ region }}' -- required unless SUMOLOGIC_ENVIRONMENT is set
AND is_admin_mode = '{{ is_admin_mode }}'
;
INSERT examples​
- create
- Manifest
Creates a new folder under the given parent folder. Set the header parameter isAdminMode to "true" to create a folder inside "Admin Recommended" folder.
INSERT INTO sumologic.content.folders (
name,
description,
parent_id,
region,
is_admin_mode
)
SELECT
'{{ name }}' /* required */,
'{{ description }}',
'{{ parent_id }}' /* required */,
'{{ region }}',
'{{ is_admin_mode }}'
RETURNING
id,
name,
parent_id,
children,
created_at,
created_by,
description,
is_scheduled,
item_type,
modified_at,
modified_by,
permissions
;
# Description fields are for documentation purposes
- name: folders
props:
- name: region
value: "{{ region }}"
description: Required parameter for the folders resource.
- name: name
value: "{{ name }}"
description: |
The name of the folder.
- name: description
value: "{{ description }}"
description: |
The description of the folder.
- name: parent_id
value: "{{ parent_id }}"
description: |
The identifier of the parent folder.
- name: is_admin_mode
value: "{{ is_admin_mode }}"
description: Set this to "true" if you want to perform the request as a Content Administrator.
description: Set this to "true" if you want to perform the request as a Content Administrator.
UPDATE examples​
- update
Update an existing folder with the given identifier. Set the header parameter isAdminMode to "true" if updating a folder inside "Admin Recommended" folder.
UPDATE sumologic.content.folders
SET
name = '{{ name }}',
description = '{{ description }}'
WHERE
id = '{{ id }}' --required
AND region = '{{ region }}' --required unless SUMOLOGIC_ENVIRONMENT is set
AND name = '{{ name }}' --required
AND is_admin_mode = '{{ is_admin_mode}}'
RETURNING
id,
name,
parent_id,
children,
created_at,
created_by,
description,
is_scheduled,
item_type,
modified_at,
modified_by,
permissions;