Skip to content

Getting started with the API

prodmanager.ProdManager class

To connect to a ProdManager instance, create a prodmanager.ProdManager object :

from prodmanager import ProdManager

# anonymous read-only access for public resources
pm = ProdManager("")

# api token authentication
pm = ProdManager("", token)


The prodmanager.ProdManager class provides managers to access the ProdManager resources. Each manager provides a set of methods to act on the resources. The available methods depend on the resource type.


# list all the scopes
scopes = pm.scope.list()
for scope in scopes:

# get the service with id == 2
service = pm.service.get(2)


Calling list() will not return the complete list of items. A Python iterator is returned instead. See the Pagination section for more information.

The attributes of objects are defined upon object creation, and depend on the ProdManger API itself. To list the available information associated with an object directly try to access its attributes :

monitor = pm.monitor.get(1)

Some objects also provide managers to access related ProdManager resources :

weather =

prod-manager allows to send any data to the ProdManager server when making queries :

incidents = pm.incident.list(status=['active', 'investigating'])
for incident in incidents:

In case of invalid or missing arguments prod-manager will raise an exception with the ProdManager server error message :

Exception: (400, {'message': 'Scope creation failed', 'reasons': {'name': ['Field must be at least 3 characters long.']}})

Base types

The prod-manager package provides some base types.

  • prodmanager.ProdManager is the primary class, handling the HTTP requests. It holds the ProdManager URL and authentication information.
  • prodmanager.base.RestObject is the base class for all the ProdManager objects. These objects provide an abstraction for ProdManager resources (scopes, services, and so on).
  • prodmanager.base.RestManager is the base class for objects managers, providing the API to manipulate the resources and their attributes.

Last update: October 20, 2022
Created: October 20, 2022