Skip to content

Table of Contents

legacy_playlist

LegacyPlaylist Objects

class LegacyPlaylist()

The class includes all necessary methods to access the Grafana legacy playlist API endpoints. Be aware that the functionality is a Grafana <= v9 feature

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

get_playlist

def get_playlist(playlist_id: int) -> dict

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

Arguments:

  • playlist_id int - Specify the playlist_id

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_id: int) -> list

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

Arguments:

  • playlist_id int - Specify the playlist_id

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_id: int) -> list

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

Arguments:

  • playlist_id int - Specify the playlist_id

Raises:

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

Returns:

  • api_call dict - Returns the corresponding playlist dashboards

update_playlist

def update_playlist(playlist_id: int, playlist: PlaylistObject) -> dict

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

Arguments:

  • playlist_id int - Specify the playlist_id
  • 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_id: int)

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

Arguments:

  • playlist_id int - Specify the playlist_id

Raises:

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

Returns:

None