Validate

class perses_api.validate.Validate[source]

Bases: object

The class includes all necessary methods to access the Perses validation 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]
validate(resource_type: str, body: dict) None[source]

The method includes a functionality to validate a resource body against the Perses schema

Parameters:
  • resource_type (str) – Specify the resource type to validate against, one of dashboards, datasources, globaldatasources, variables, or globalvariables

  • body (dict) – Specify the resource body to validate

Raises:
  • ValueError – Missed specifying a necessary value

  • Exception – Unspecified error by executing the API call