Product/components used and version/fix level:
cumulocity version: backend: 1016.0.256, UI: 1016.0.256
Detailed explanation of the problem:
i want to upload lwm2m device protocols to a tenant via phyton script but i always get error message.
manually this is done via UI {{tenantURL}}/apps/devicemanagement/index.html#/deviceprotocols => button “add device protocol” (right upper corner) => button: “LWM2M” => select .xml file => finished
via developer tool in browser you can see that this is done with a POST request:
request URL: {{tenanturl}}/service/lwm2m-agent/objectResourceMappings/ddf
payload: file: (binary)
accept: application/json
content-type: multipart/form-data; boundary=----WebKitFormBoundaryjGpksrHDnUpqpSFK
…
this is my python function where i am trying to do this via script:
url_upload_binary_file = "{{tenant_domain}}/service/lwm2m-agent/objectResourceMappings/ddf".replace("{{tenant_domain}}", tenant_domain)
print("url upload application = : ", url_upload_binary_file)
file_name = "1-Server-1_0.xml"
c8y_headers_newTenant["Content-Type"] = "multipart/form-data; boundary=----WebKitFormBoundaryjGpksrHDnUpqpSFK"
response = requests.post(url_upload_binary_file, headers=c8y_headers_newTenant, files = files)
Error messages / full error message screenshot / log file:
this is the error file that i receive:
upload application FAILED status code = 500
b’{“message”:“Required request part 'file' is not present”,“error”:“LWM2M/Error”}’
is anybody alrready doing such things and can help here?
thanks
Question related to a free trial, or to a production (customer) instance?
production