Skip to main content

Common Morpheus API calls for HOL Events

Project description

Morpheus Python Module

Installation

pip install pymorphapi

Usage

Reference at https://bertramdev.github.io/morpheus-apidoc

import pymorphapi

# import and validate/refresh bearer token
bearer_token = pymorphapi.import_token_from_disk(BASE_URI, LOCAL_PATH + TOKEN_FILE, VERIFY_SSL)

# sample get
results = pymorphapi.invoke_api(
    BASE_URI + "/api/roles/?max=1000",
    "Bearer " + bearer_token,
    "get",
    None,
    VERIFY_SSL
)

# sample post
body = {}
body.update({"group": {"name": current_student}})
pymorphapi.invoke_api(
    BASE_URI + "/api/accounts/" + str(new_tenant_id) + "/groups/",
    "Bearer " + bearer_token,
    "post",
    body,
    VERIFY_SSL
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymorphapi-1.9.5.tar.gz (8.4 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page