Skip to content

dynatrace-extensions/anypoint-api-python-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Anypoint python client

from datetime import datetime, timedelta

from anypoint import Anypoint
from anypoint.authentication import  OAuth2


def main():
    auth = OAuth2("connected_app_client_id", "connected_app_client_secret")
    client = Anypoint(auth)
    org = client.organizations.get_organization()
    print(org.name, org.id)

    for environment in org.get_environments():
        for app in environment.get_applications():
            statistics = app.get_dashboard_statistics(datetime.utcnow() - timedelta(minutes=5), datetime.utcnow())
            for event in statistics.events:
                print(event.timestamp, event.value)
            for worker in statistics.workers:
                for metric in worker.metrics:
                    print(metric.metric_id, metric.statistics)


if __name__ == '__main__':
    main()

About

python api client for some mulesoft anypoint apis

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages