Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

140
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda