Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

139
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda