I use Python to interact with Morpheus for internal and external clients and I wanted an easy way to make calls to the Morpheus API without dealing with Python requests
. Enter pymorpheus, an easy Python module to act as a wrapper to the Morpheus API.
If I wanted to get a list of instances with a phrase matching “test”, it’s super easy:
from pymorpheus import MorpheusClient
morpheus = MorpheusClient("https://yoururl", username="youruser", password="yourpass")
results = morpheus.call("get", path="instances", options=[("phrase","testing")])
print(results)
Adding json payloads to POST
calls is handled within the same call as well. You can also use a token to authenticate.