Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

141
Views
SOFTLAYER REST API Wrong result using objectFilter

I am using the SOFTLAYER REST API in order to get the virtual machine list then select one of the results and get more details only about the selected machine.

I used this URL to get the machine details by hostname but i get all the machines as result and not the one i selected

URL :

https://api.softlayer.com/rest/v3.1/SoftLayer_Account/getVirtualGuests.json?objectMask=mask[id,hostname,fullyQualifiedDomainName,provisionDate,powerState,operatingSystem[id,passwords[password,username],softwareDescription[longDescription]]]&objectFilter={"hostname":{"operation":"SLRAMONT02"}}

What should i do the get the wright result?

I used python with the same url and I get the expected result but after a debug I found that python is converting the JSON to XML and using the SOAP API.

I'm not planning to use the python API but the JAVA. Can I make the same request using JAVA API?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

This basically was answered here: Softlayer filtering not working.

On your case you need to use following filter:

objectFilter={"virtualGuests":{"hostname":{"operation":"SLRAMONT02"}}}

Also I recommend to review: How to use object filter with softlayer rest api?

Unfortunately object-filters is not supported yet by Softlayer-Java API, this is commented here:
Object Filters in Softlayer in Java
https://github.com/softlayer/softlayer-java/issues/30

If you really need to use object-filters in Java, you can try by using RESTFul, there are some RESTful examples in the following links.

https://www.mkyong.com/webservices/jax-rs/restfull-java-client-with-java-net-url/ https://www.mkyong.com/webservices/jax-rs/restful-java-client-with-apache-httpclient/

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!