I am trying to upload a comment to a device's comment field in NetBox which takes markdown language.
With the below file content, the comment gets inserted and displays the comment in NetBox as just text (the lines in the file are doublespaced otherwise the text only comes out in one continuous line):
File Contents:
User Name: user
Password: password
IPv4: x.x.x.x
IPv6: x::x
The resulting comment field in NetBox is this:
When I try to add markdown like below, the upload becomes an empty string and fails with curl stderr : /bin/sh: 1: nUser: not found
This results in the comment field having None for a value:
The curl command I am using is this:
curl
--insecure \
--verbose \
--request PATCH \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization:Token token" \
--user "user:password" \
--url "https://x.x.x.x/api/dcim/devices/{device_id}/" \
--data-binary @input_file
What is the proper way to format the file / string to insert into a markdown field in NetBox?