#api for creating cifs share

1 messages · Page 1 of 1 (latest)

uneven patio
#

Hi Team,

I have activeiq with name active-iq I’m trying to create cifs share as command below

curl -k -v -X POST “ https://active-iq/api/datacenter/protocols/cifs/shares? cluster.uuid=”clusteruidnunber” -d @data.json -H “accept: application/json” -H “Authorization: Basic fshahshshsjshsh=“

My data json file is like this as attached

Can someone please help me what I’m doing wrong

Thank you

warm jackal
#

Without seeing the actual error it gives, it's hard to troubleshoot. Does it work if you send it directly to your cluster, i.e. https://<cluster-mgmt-ip-or-hostname>/protocols/cifs/shares ? If not then your json file is probably incorrect. Check that the names match, they are case-sensitive for example. If it works if you send it to your cluster it might be your AIQUM setup: do other API calls to AIQUM work? You might need to add the UUIDs to the svm and/or volume, so that AIQUM can uniquely identify those

uneven patio
uneven patio
#

I have volume mounted on vserver as /test_share , svm- NetApp01-TEST and want to create share as test_share

warm jackal
#

hm. try adding the x-trace-threshold:0 header to your request and looking at the output headers (i.e. curl -i). I don't know if this works for AIQUM but it works for ONTAP and shows some debugging stuff that might be helpful

weary smelt
#

Your JSON file contents is bad. The first character of the JSON file should be { and the last }. cifs_share is a key and the {...} is the value.

#

It should be:

{
  "cifs_share": {
    "key you have": "values you have",
    "key2": "value2"
  }
}
warm jackal
#

ah! well spotted. I agree that this is most likely the issue

uneven patio
#

@weary smelt @warm jackal

#

I’m getting error 500: internal server error

#

Thank you for help but I’m still having issue

weary smelt
#

That 500 error may be because the JSON is not parsable. It's still invalid.
The trailing coma makes it invalid.

#

Since you're using photos to post info here, I'm guessing the system is 'isolated'. As you're on a linux system, jq may already be installed.

To lint (validate) JSON in Bash, you can use the jq command:
jq . <your_json_file.json
If the JSON is valid, jq will output the formatted JSON. If it's invalid, you'll get an error message.
Explanation:
jq . tells jq to parse the JSON and output it as-is (the . is the identity filter).
<your_json_file.json is the path to your JSON file.

uneven patio
#

Thank you I did check and found this json file is parsing and not giving me error but still I’m getting error 500 @weary smelt

uneven patio
#

Is there any log where I can check into activeiq server itself

warm jackal
#

also the UUID of the SVM looks strange, it should only be a hex number with dashes, and not contain that "SVM_uida" stuff before it

uneven patio
uneven patio
#

With error can not resolve host

#

But my GET is working as I can fetch infos

warm jackal
#

cannot resolve host sounds like your command line is wrong. You have to add custom headers with the -H parameter to curl, did you do that correctly?

uneven patio
#

It’s not showing too much info apart form error 500

#

Please let me know if I can see logs in activeIQ

#

For API calls

warm jackal
warm jackal
uneven patio
#

Yes I did that

uneven patio
#

My user that I created on activeIQ is having Applications Admin privilege

uneven patio
#

Any idea how to find performance service level keys for volume like Performance or custom ?

uneven patio
#

I have sorted out the issue and now it’s creating volume but not the share

#

@warm jackal and @weary smelt if you have any idea what it’s not creating CIFS share please help me

uneven patio
#

It’s creating volume and mounting it

weary smelt
#

I see on the second post you’ve figured it out. Please post your findings on this original thread so that others in the community, including those that offered assistance, can benefit.

#

Start a separate thread for the performance question. Threads here, like cases, should be focused on a single topic.

uneven patio
#

It was missing ACL even though in API documentation it does not say it’s required but when I did pass it it created