Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Merge pull request #30 from mbovo/issue/29
Browse files Browse the repository at this point in the history
Issue/29
  • Loading branch information
m0nhawk authored Jun 7, 2019
2 parents 9c1aba8 + f1f3fa2 commit 8c0f1b0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions grafana_api/api/folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,23 @@ def create_folder(self, title, uid=None):
json_data["uid"] = uid
return self.api.POST("/folders", json=json_data)

def update_folder(self, uid, title):
def update_folder(self, uid, title, version=None, overwrite=False):
"""
:param uid:
:param title:
:param version:
:param overwrite:
:return:
"""
body = {"title": title}
if version is not None:
body['version'] = version
if overwrite:
body['overwrite'] = True

path = "/folders/%s" % uid
r = self.api.PUT(path, json={"title": title})
r = self.api.PUT(path, json=body)
return r

def delete_folder(self, uid):
Expand Down

0 comments on commit 8c0f1b0

Please sign in to comment.