Project

class perses_api.project.Project[source]

Bases: object

The class includes all necessary methods to access the Perses projects API

Parameters:

perses_api_model (APIModel) – Inject a Perses API model object that includes all necessary values and information

api

This is where we store the api

Type:

Api

__init__(perses_api_model: APIModel)[source]
create_project(project: Project) dict[source]

The method includes a functionality to create a new project

Parameters:

project (Project) – Specify the project resource to create

Raises:

Exception – Unspecified error by executing the API call

Returns:

The created project dict

Return type:

dict

delete_project(name: str) None[source]

The method includes a functionality to delete a project by name

Parameters:

name (str) – Specify the name of the project to delete

Raises:

ValueError – Missed specifying a necessary value

get_project(name: str) dict[source]

The method includes a functionality to retrieve a single project by name

Parameters:

name (str) – Specify the name of the project to retrieve

Raises:
  • ValueError – Missed specifying a necessary value

  • Exception – Unspecified error by executing the API call

Returns:

The project dict

Return type:

dict

get_projects(name: str = None) list[source]

The method includes a functionality to retrieve all projects

Parameters:

name (str) – Specify a name to filter the results (default None)

Raises:

Exception – Unspecified error by executing the API call

Returns:

A list of project dicts

Return type:

list

update_project(name: str, project: Project) dict[source]

The method includes a functionality to update an existing project by name

Parameters:
  • name (str) – Specify the name of the project to update

  • project (Project) – Specify the updated project resource

Raises:
  • ValueError – Missed specifying a necessary value

  • Exception – Unspecified error by executing the API call

Returns:

The updated project dict

Return type:

dict