Package: dt-cli
dt-cli — Dynatrace developer's toolboxDynatrace CLI is a command line utility that assists in signing, building and uploading
extensions for Dynatrace Extension Framework 2.0.FeaturesWork with Extensions 2.0Build and sign extensions from sourceGenerate CA certificates for developmentGenerate development certificates for extension signingValidate and upload extension to Dynatrace(planned) Perform various API requests from command lineFAQWhat's the difference between monaco and dt-cli?Monacois amonitoring configurationascode solution that allows you to configure Dynatrace environment using GitOps approach. It follows a declarative approach: define what you need and the tool will ensure the correct configuration.dtcommand line, on the other hand, is a tool for performing imperative step-by-step configuration. You explicitly invoke commands to modify the state.Installationpipinstalldt-cliUsage(optional) If you don't already have a developer certificateGenerate CA key and certificate$dtextgenca
CAprivatekeypassphrase[]:Repeatforconfirmation:GeneratingCA...

WroteCAprivatekey:./ca.key
WroteCAcertificate:./ca.pemGenerate developer key and certificate from the CA$dtextgenerate-developer-pem--ca-crtca.crt--ca-keyca.key-odev.pem
Name:Ext
LoadingCAprivatekeyca.key
LoadingCAcertificateca.pem
Generatingdevelopercertificate...
Wrotedevelopercertificate:dev.pem
Wrotedeveloperprivatekey:dev.pemUpload your CA certificate to the Dynatrace credential vaultSee:Add your root certificate to the Dynatrace credential vaultUpload your CA certificate to OneAgent or ActiveGate hosts that will run your extensionSee:Uplaod your root certificate to OneAgent or ActiveGateBuild and sign the extension$dtextassemble
Buildingextension.zipfromextension/
Addingfile:extension/dashboards/overview_dashboard.jsonasdashboards/overview_dashboard.json
Addingfile:extension/extension.yamlasextension.yaml
Addingfile:extension/activationSchema.jsonasactivationSchema.json

$dtextsign--keydev.pem
Successfullysignedtheextensionbundleatbundle.zip(optional) Validate the assembled and signed bundle with your Dynatrace tenant$dtextvalidatebundle.zip--tenant-urlhttps://<tenantid>.live.dynatrace.com--api-token<token>
Extensionvalidationsuccessful!Upload the extension to your Dynatrace tenant$dtextuploadbundle.zip--tenant-urlhttps://<tenantid>.live.dynatrace.com--api-token<token>
Extensionuploadsuccessful!Using dt-cli from your Python codeYou may want to use some commands implemented bydt-clidirectly in your Python code, e.g. to automatically sign your extension in a CI environment.
Here's an example of building an extension programatically, it assumesdtclipackage is already installed and available in your working environment.fromdtcliimportbuildingbuilding.build_extension(extension_dir_path='./extension',extension_zip_path='./extension.zip',extension_zip_sig_path='./extension.zip.sig',target_dir_path='./dist',certificate_file_path='./developer.crt',private_key_file_path='./developer.key',dev_passphrase=None,keep_intermediate_files=False,)DevelopmentSee ourCONTRIBUTINGguidelines and instructions.ContributionsYou are welcome to contribute using Pull Requests to the respective
repository. Before contributing, please read ourCode of Conduct.Licensedt-cliis an Open Source Project. Please seeLICENSEfor more information.