dt-cli — Dynatrace developer's toolbox
Dynatrace CLI is a command line utility that assists in signing, building and uploading extensions for Dynatrace Extension Framework 2.0.
Features
- Work with Extensions 2.0
- Build and sign extensions from source
- Generate CA certificates for development
- Generate development certificates for extension signing
- Validate and upload extension to Dynatrace
- (planned) Perform various API requests from command line
FAQ
What's the difference between monaco and dt-cli?
- Monaco is a monitoring configuration as code 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.
Installation
pip install dt-cli
Usage
-
(optional) If you don't already have a developer certificate
-
Generate CA key and certificate
$ dt ext genca CA private key passphrase []: Repeat for confirmation: Generating CA... Wrote CA private key: ./ca.key Wrote CA certificate: ./ca.pem
-
Generate developer key and certificate from the CA
$ dt ext generate-developer-pem --ca-crt ca.pem --ca-key ca.key -o dev.pem Name: Ext Loading CA private key ca.key Loading CA certificate ca.pem Generating developer certificate... Wrote developer certificate: dev.pem Wrote developer private key: dev.pem
-
-
Upload your CA certificate to the Dynatrace credential vault
See: Add your root certificate to the Dynatrace credential vault
-
Upload your CA certificate to OneAgent or ActiveGate hosts that will run your extension
-
Build and sign the extension
$ dt ext assemble Building extension.zip from extension/ Adding file: extension/dashboards/overview_dashboard.json as dashboards/overview_dashboard.json Adding file: extension/extension.yaml as extension.yaml Adding file: extension/activationSchema.json as activationSchema.json $ dt ext sign --key dev.pem Successfully signed the extension bundle at bundle.zip
-
(optional) Validate the assembled and signed bundle with your Dynatrace tenant
$ dt ext validate bundle.zip --tenant-url https://<tenantid>.live.dynatrace.com --api-token <token> Extension validation successful!
-
Upload the extension to your Dynatrace tenant
$ dt ext upload bundle.zip --tenant-url https://<tenantid>.live.dynatrace.com --api-token <token> Extension upload successful!
Using dt-cli from your Python code
You may want to use some commands implemented by dt-cli directly 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 assumes dtcli package is already installed and available in your working environment.
from dtcli import building
building.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,
)
Development
See our CONTRIBUTING guidelines and instructions.
Contributions
You are welcome to contribute using Pull Requests to the respective repository. Before contributing, please read our Code of Conduct.
License
dt-cli is an Open Source Project. Please see
LICENSE for more information.
Metadata
Release files for dt-cli 1.6.21
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dt_cli-1.6.21.tar.gz | 27.3 kB | Without provenance | Details for dt_cli-1.6.21.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dt_cli-1.6.21-py3-none-any.whl | Python 3 | none | any | Details for dt_cli-1.6.21-py3-none-any.whl |
Total release size: 60.3 kB
Release files / dt_cli-1.6.21.tar.gz
| Download URL | dt_cli-1.6.21.tar.gz |
|---|---|
| Size | 27.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d92ec210b36fc45b035b6056acedb220eb477ade5c576e231cc20cc12800e4e2
|
|
BLAKE2b-256 checksum How to use checksums |
fb6122cf258d5e08f25f06b06670093646320fd25ec8562624abac1e2c16a7d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.3 Darwin/23.6.0
|
Release files / dt_cli-1.6.21-py3-none-any.whl
| Download URL | dt_cli-1.6.21-py3-none-any.whl |
|---|---|
| Size | 33.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f1693b0445fdaa0dec715bbd0c3f64765eb7db58d445f570898813577e693166
|
|
BLAKE2b-256 checksum How to use checksums |
62fe2377be081f626731575daad064c8c09582ee4bfd75cbb0471241ab55f596
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.3 Darwin/23.6.0
|
Security for dt-cli 1.6.21
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.