Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Trying to get the qtree name that has curly braces in it. ex - {cjtest-really-long-name}
if tried name: {cjtest-really-long-name} without double quotes around the name, it did not return the qtree record.
curl -X GET "https://host_ip/api/storage/qtrees?name=%7Bcjtest-really-long-name%7D&return_records=true&return_timeout=15" -H "accept: application/json" -H "authorization: Basic YWRtaW46bmV0YXBwMSE="
whereas with double quotes "{cjtest-really-long-name}", it return record good.
curl -X GET "https://host_ip/api/storage/qtrees?name=%22%7Bcjtest-really-long-name%7D%22&return_records=true&return_timeout=15" -H "accept: application/json" -H "authorization: Basic YWRtaW46bmV0YXBwMSE="
is this expected?
Thanks,
Mohan
Solved! See The Solution
1 ACCEPTED SOLUTION
MOHANRAJB has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, this is expected. There are 3 ways to quote a string value in the ONTAP API (and CLI). Single quotes ('value'), double quotes ("value") or curly braces, {value}. If the value you are quoting contains one of those characters, you'll need to quote it with a different set so as to have those embedded quote characters treated literally.
2 REPLIES 2
MOHANRAJB has accepted the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, this is expected. There are 3 ways to quote a string value in the ONTAP API (and CLI). Single quotes ('value'), double quotes ("value") or curly braces, {value}. If the value you are quoting contains one of those characters, you'll need to quote it with a different set so as to have those embedded quote characters treated literally.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are correct except for single quotes. ONTAP doesn't treat single quotes as special. BTW, if a string's first and last characters are open and shut curly braces, the rest is treated as literal, even with emdedded curly quotes. So {x}yz} is same as "x}yz" and {x{}y} is same as "x{}y".
