Solved

GETStorage Pool PowerShell RestApi

  • 25 September 2021
  • 6 replies
  • 122 views

Userlevel 1
Badge +6

 

for me application json works ok but xml is returning, I’m using example from api.commvault

],
        [
            "System.Xml.XmlWhitespace",
            "System.Xml.XmlElement",
            "System.Xml.XmlWhitespace",
            "System.Xml.XmlElement",
            "System.Xml.XmlWhitespace"

https://api.commvault.com/#89226552-b05f-423f-b951-79d8592a390b

 

 

icon

Best answer by MaxJamakovic 15 November 2021, 19:19

View original

6 replies

Userlevel 7
Badge +15

Hi @MaxJamakovic 

Thank you for raising the question, the converted json is not working, but are you able to check the xml output before piping through the ConvertTo-Json?

I’m curious to understand if the xml itself in $response is properly formed.

 

Also, another question, if you are happy with the application/json output, what is the purpose for outputting to xml then converting to json?

Thanks,

Stuart

Userlevel 1
Badge +6

@Stuart Painter if I remove | ConverTo-Jason 

I’m curious to understand if the xml itself in $response is properly formed

the output is 

Api_GetStoragePoolListResp
--------------------------
Api_GetStoragePoolListResp

 

I’m using the example from api.commvaut.com exact same command 

 

Userlevel 7
Badge +23

@MaxJamakovic , following up on this thread.  Did you get an answer to your issue?  If not, I can tag in some other people.

Userlevel 1
Badge +6

Yes I found workaround

Thanks Mike

 

Userlevel 7
Badge +23

Glad to hear it!  Would you mind sharing it with the community for posterity?

Thanks!!

Userlevel 7
Badge +23

@MaxJamakovic , I’m marking your reply as the solution, though I’

d love for you to reply back with your workaround when you get a chance as well :nerd:

Reply