-
Notifications
You must be signed in to change notification settings - Fork 193
createObjects methods do not work with REST API #885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I used debugging the the VSI createObjects call and got the following:
The result showed that hostname was missing:
Changing the URL to have createObjects on the end made it work properly:
|
Another suggestion was to remove the double array, but that only results in the first VSI being created, the second is ignored:
Response:
|
Merged
Merged
this should be fixed in 5.2.15 and up. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please triple-check to make sure that you have properly masked out user credentials like usernames, passwords and API keys before submitting your issue
Expected Behavior
createObjects with the RestTransport should operate the same way as the XmlRpcTransport. Calling createObjects with multiple objects should create each object, and return all created objects
Actual Behavior
Here is a script that I wrote to attempt creating multiple VSIs as the comments in the VS manager's create_instances function instructs. The endpoint I was pointing to was
endpoint_url = https://api.softlayer.com/rest/v3.1/
The error output was:
The hostname on each instance is set, so this isn't the actual error that's happening. This is also happening for security groups createObjects, and what's happening with security groups is it is just doing a create of one security group with no attributes set on it.
For security groups, we attempted to make the REST call using curl:
This only created one security group instead of both. The call, in order to make it work, was:
The solution was to call createObjects directly, where softlayer-python is just calling https://api.softlayer.com/rest/v3/SoftLayer_Network_SecurityGroup with POST. This probably means that if a "special method" (https://github.com/softlayer/softlayer-python/blob/master/SoftLayer/transports.py#L32-L38) is encountered, we should change it to POST, but we shouldn't remove the method name in case it is the plural API that is being called.
Environment Information
Operating System: Mac OS 10.12.6
softlayer-python version (
slcli --version
):slcli (SoftLayer Command-line), version 5.2.14
The text was updated successfully, but these errors were encountered: