AnsweredAssumed Answered

Filter for a specific field in host data

Question asked by Alexandre Philbert on May 2, 2019

I am trying to figure out all of the instance IDs for a list of hosts and I was wondering how to filter on a specific field because there is a lot of stuff being returned that I don't need.

 

This is the data I wish to extract and the XML's format (removed unnecessary information):

<ServiceResponse>
  <data>
    <HostAsset>
      <sourceInfo>
        <list>
          <Ec2AssetSourceSimple>
            <instanceId>i-023b166432b1c7afc</instanceId>
          </Ec2AssetSourceSimple>
        </list>
      </sourceInfo>
    </HostAsset>
  </data>
</ServiceResponse>

 

Here is my attempt at getting it to work:

/qps/rest/2.0/get/am/hostasset/<id>/?fields=data.HostAsset.sourceInfo.list.Ec2AssetSourceSimple.instanceId

 

Does anyone know how to format the fields parameters in order to extract the nested instance ID tag?

Outcomes