AnsweredAssumed Answered

500 Internal Server Error with HCS REST API

Question asked by Jake Larrimore Employee on Aug 17, 2018

In my python script, I'm attempting to create a host group. The following curl command works, and initiates a job as expected:

curl -v  -H "Accept:application/json" -H "Content-Type:application/json" -H "Authorization: Basic bWFpbnRlbmFuY2U6cmFpZC1tYWludGVuYW5jZQ==" -d '{"hostMode": "LINUX/IRIX", "portId": "CL1-J", "hostGroupName": "HCMD0002"}' -X  POST "http://localhost:23450/ConfigurationManager/v1/objects/storages/836000440723/host-groups"

 

Unfortunately, in my python script, I'm sending the same command, but getting a "500-- internal server error" response.

the Code:

    conn = http.client.HTTPConnection(host,port=port)

    headers = {

    'Content-Type': "application/json",

    'Accept-Language': "application/json",

    'Authorization': "Basic %s"%auth,

    }

    conn.request(method, base+url, headers=headers,body=body)

    res = conn.getresponse()

 

Log File:

POST /ConfigurationManager/v1/objects/storages/836000440723/host-groups

body: {"hostMode": "LINUX/IRIX", "portId": "CL1-J", "hostGroupName": "HCMD0002"}

 

output: 500

Internal Server Error

None

 

There isn't much data as to why I'm getting the error, and the documentation skips over any possible debugging:

For asynchronous processing, the operation on the resource is registered

as a job. In addition, the job information and the HTTP status code 202,

which indicates that the processing has been accepted, are returned in the

response. Subsequently, the registered job runs asynchronously. If

registration of a job fails, the HTTP status code 500 is returned.

Outcomes