Closed vduseev closed 8 months ago
Describe the bug dt ext upload sends a malformed POST request which unnecessarily wraps extension zip
dt ext upload
To Reproduce Steps to reproduce the behavior:
dt-cli
ZIP downloaded from the cluster contains extra bytes.
Expected behavior dt ext upload should upload built binary of archive as-is.
Additional context Add any other context about the problem here.
def upload(extension_zip_file, tenant_url, api_token): url = f"{tenant_url}/api/v2/extensions" with open(extension_zip_file, "rb") as extzf: headers = {"Accept": "application/json; charset=utf-8", "Authorization": f"Api-Token {api_token}"} try: response = requests.post( url, files={"file": (extension_zip_file, extzf, "application/zip")}, headers=headers ) response.raise_for_status() print("Extension upload successful!") except requests.exceptions.HTTPError: print("Extension upload failed!") raise dtcliutils.ExtensionValidationError(response.text)
We must replace the requests.post portion here with something like
requests.post
curl -X 'POST' \ 'https://fys58062.dev.dynatracelabs.com/api/v2/extensions?validateOnly=false' \ -H 'accept: application/json; charset=utf-8' \ -H 'Content-Type: application/octet-stream' \ --data-binary '@extension.zip'
Describe the bug
dt ext upload
sends a malformed POST request which unnecessarily wraps extension zipTo Reproduce Steps to reproduce the behavior:
dt ext upload
after building and signing usingdt-cli
ZIP downloaded from the cluster contains extra bytes.
Expected behavior
dt ext upload
should upload built binary of archive as-is.Additional context Add any other context about the problem here.
We must replace the
requests.post
portion here with something like