Skip to content

joetitra/pymorphapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages