Skip to content

Table of Contents

playlist

Playlist Objects

class Playlist()

The class includes all necessary methods to access the Grafana playlist API endpoints

Arguments:

  • grafana_api_model APIModel - Inject a Grafana API model object that includes all necessary values and information

Attributes:

  • grafana_api_model APIModel - This is where we store the grafana_api_model

search_playlist

def search_playlist(query: str = None, limit: int = None) -> list

The method includes a functionality to get the organization playlist's specified by the optional pagination functionality

Arguments:

  • query str - Specify the query to limit response to playlist having a name like this value(default None)
  • limit int - Specify the limit as integer of the response (default None)

Raises:

  • Exception - Unspecified error by executing the API call

Returns:

  • api_call list - Returns the organization playlist's

get_playlist

def get_playlist(playlist_uid: str) -> dict

The method includes a functionality to get the playlist specified by the playlist_uid

Arguments:

  • playlist_uid str - Specify the playlist_uid

Raises:

  • ValueError - Missed specifying a necessary value
  • Exception - Unspecified error by executing the API call

Returns:

  • api_call dict - Returns the corresponding playlist

get_playlist_items

def get_playlist_items(playlist_uid: str) -> list

The method includes a functionality to get the playlist items specified by the playlist_uid

Arguments:

  • playlist_uid str - Specify the playlist_uid

Raises:

  • ValueError - Missed specifying a necessary value
  • Exception - Unspecified error by executing the API call

Returns:

  • api_call dict - Returns the corresponding playlist items

get_playlist_dashboards

def get_playlist_dashboards(playlist_uid: str) -> list

The method includes a functionality to get the playlist dashboards specified by the playlist_uid

Arguments:

  • playlist_uid str - Specify the playlist_uid

Raises:

  • ValueError - Missed specifying a necessary value
  • Exception - Unspecified error by executing the API call

Returns:

  • api_call dict - Returns the corresponding playlist dashboards

create_playlist

def create_playlist(playlist: PlaylistObject) -> dict

The method includes a functionality to create a playlist specified by the playlist object

Arguments:

  • playlist PlaylistObject - Specify the playlist object

Raises:

  • ValueError - Missed specifying a necessary value
  • Exception - Unspecified error by executing the API call

Returns:

  • api_call dict - Returns the corresponding playlist

update_playlist

def update_playlist(playlist_uid: str, playlist: PlaylistObject) -> dict

The method includes a functionality to update a playlist specified by the playlist object and playlist_uid

Arguments:

  • playlist_uid str - Specify the playlist_uid
  • playlist PlaylistObject - Specify the playlist object

Raises:

  • ValueError - Missed specifying a necessary value
  • Exception - Unspecified error by executing the API call

Returns:

  • api_call dict - Returns the corresponding playlist

delete_playlist

def delete_playlist(playlist_uid: str)

The method includes a functionality to delete a playlist specified by the playlist_uid

Arguments:

  • playlist_uid str - Specify the playlist_uid

Raises:

  • ValueError - Missed specifying a necessary value
  • Exception - Unspecified error by executing the API call

Returns:

None