Skip to content

Commit a330e95

Browse files
docs: Add the documentation
1 parent f36b834 commit a330e95

File tree

1 file changed

+65
-1
lines changed

1 file changed

+65
-1
lines changed

docs/content/grafana_api/folder.md

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* [get\_folder\_by\_id](#folder.Folder.get_folder_by_id)
88
* [create\_folder](#folder.Folder.create_folder)
99
* [update\_folder](#folder.Folder.update_folder)
10+
* [move\_folder](#folder.Folder.move_folder)
1011
* [delete\_folder](#folder.Folder.delete_folder)
1112
* [get\_folder\_permissions](#folder.Folder.get_folder_permissions)
1213
* [update\_folder\_permissions](#folder.Folder.update_folder_permissions)
@@ -46,6 +47,10 @@ def get_folders() -> list
4647

4748
The method includes a functionality to extract all folders inside the organization
4849

50+
Required Permissions:
51+
Action: folders:read
52+
Scope: folders:*
53+
4954
**Raises**:
5055

5156
- `Exception` - Unspecified error by executing the API call
@@ -69,6 +74,10 @@ The method includes a functionality to extract all folder information specified
6974

7075
- `uid` _str_ - Specify the uid of the folder
7176

77+
Required Permissions:
78+
- `Action` - folders:read
79+
- `Scope` - folders:*
80+
7281

7382
**Raises**:
7483

@@ -94,6 +103,10 @@ The method includes a functionality to extract all folder information specified
94103

95104
- `id` _int_ - Specify the id of the folder
96105

106+
Required Permissions:
107+
- `Action` - folders:read
108+
- `Scope` - folders:*
109+
97110

98111
**Raises**:
99112

@@ -110,7 +123,7 @@ The method includes a functionality to extract all folder information specified
110123
#### create\_folder
111124

112125
```python
113-
def create_folder(title: str, uid: str = None) -> dict
126+
def create_folder(title: str, uid: str = None, parent_uid: str = None) -> dict
114127
```
115128

116129
The method includes a functionality to create a new folder inside the organization specified by the defined title and the optional uid
@@ -119,6 +132,11 @@ The method includes a functionality to create a new folder inside the organizati
119132

120133
- `title` _str_ - Specify the title of the folder
121134
- `uid` _str_ - Specify the uid of the folder (default None)
135+
- `parent_uid` _str_ - Specify the parent_uid of the folder (default None)
136+
137+
Required Permissions:
138+
- `Action` - folders:create, folders:write
139+
- `Scope` - folders:*
122140

123141

124142
**Raises**:
@@ -151,6 +169,10 @@ The method includes a functionality to update a folder information inside the or
151169
- `version` _int_ - Specify the version of the folder (default 0)
152170
- `overwrite` _bool_ - Should the already existing folder information be overwritten (default False)
153171

172+
Required Permissions:
173+
- `Action` - folders:write
174+
- `Scope` - folders:*
175+
154176

155177
**Raises**:
156178

@@ -162,6 +184,36 @@ The method includes a functionality to update a folder information inside the or
162184

163185
- `api_call` _dict_ - Returns an updated folder
164186

187+
<a id="folder.Folder.move_folder"></a>
188+
189+
#### move\_folder
190+
191+
```python
192+
def move_folder(uid: str, parent_uid: str = None)
193+
```
194+
195+
The method includes a functionality to move a folder inside the organization specified by the defined uid. This feature is only relevant if nested folders are enabled
196+
197+
**Arguments**:
198+
199+
- `uid` _str_ - Specify the uid of the folder
200+
- `parent_uid` _str_ - Specify the parent_uid of the folder. If the value is None, then the folder is moved under the root (default None)
201+
202+
Required Permissions:
203+
- `Action` - folders:create, folders:write
204+
- `Scope` - folders:*, folders:uid:<destination folder UID>
205+
206+
207+
**Raises**:
208+
209+
- `ValueError` - Missed specifying a necessary value
210+
- `Exception` - Unspecified error by executing the API call
211+
212+
213+
**Returns**:
214+
215+
- `api_call` _dict_ - Returns the moved folder
216+
165217
<a id="folder.Folder.delete_folder"></a>
166218

167219
#### delete\_folder
@@ -176,6 +228,10 @@ The method includes a functionality to delete a folder inside the organization s
176228

177229
- `uid` _str_ - Specify the uid of the folder
178230

231+
Required Permissions:
232+
- `Action` - folders:delete
233+
- `Scope` - folders:*
234+
179235

180236
**Raises**:
181237

@@ -201,6 +257,10 @@ The method includes a functionality to extract the folder permissions inside the
201257

202258
- `uid` _str_ - Specify the uid of the folder
203259

260+
Required Permissions:
261+
- `Action` - folders.permissions:read
262+
- `Scope` - folders:*
263+
204264

205265
**Raises**:
206266

@@ -227,6 +287,10 @@ The method includes a functionality to update the folder permissions based on th
227287
- `uid` _str_ - Specify the uid of the folder
228288
- `permission_json` _dict_ - Specify the inserted permissions as dict
229289

290+
Required Permissions:
291+
- `Action` - folders.permissions:write
292+
- `Scope` - folders:*
293+
230294

231295
**Raises**:
232296

0 commit comments

Comments
 (0)