VMware Cloud Community
jmedd
Enthusiast
Enthusiast
Jump to solution

Issue listing IPsets Created on a Scope via REST API

I'm able to create an IPset on a datacenter scope like the following:

POST https://192.168.x.x/api/2.0/services/ipset/datacenter-xx

<ipset>

  <objectId />

  <type>

  <typeName />

  </type>

  <description>New Description</description>

  <name>TestIPSet2</name>

  <revision>0</revision>

  <objectTypeName />

  <value>10.112.201.8-10.112.201.14</value>

</ipset>

which gives me back an id of:

ipset-205

I can successfully query that IPset directly with:

GET https://192.168.x.x/api/2.0/services/ipset/ipset-205

<ipsetipset>

  <objectId>ipset-205</objectId>

  <type>

  <typeName>IPSet</typeName>

  </type>

  <name>TestIPSet2</name>

  <description>New Description</description>

  <revision>1</revision>

  <objectTypeName>IPSet</objectTypeName>

  <scope>

  <id>datacenter-xx</id>

  <objectTypeName>Datacenter</objectTypeName>

  <name>xxxxx</name>

  </scope>

  <extendedAttributes />

  <inheritanceAllowed>false</inheritanceAllowed>

  <value>10.112.201.8-10.112.201.14</value>

</ipset>

However, if I attempt to list all IPsets on the datacenter-xx scope I get an error:

GET https://192.168.x.x/api/2.0/services/ipset/datacenter-xx

https://192.168.x.x/api/2.0/services/ipset/datacenter-xx

https://192.168.x.x/api/2.0/services/ipset/ipset-205

<error>

<details>The requested object : datacenter-xx could not be found. Object identifiers are case sensitive.</details>

<errorCode>202</errorCode>

<moduleName>core-services</moduleName>

</error>

Any ideas? Surely datacenter-xx must exist because I have successfully create an IPSet on it?

Blog: http://jonathanmedd.net | Twitter: @jonathanmedd
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
jmedd
Enthusiast
Enthusiast
Jump to solution

Figured it out. The URL in the documentation is incorrect, the one you actually need is:

https://192.168.x.x/api/2.0/services/ipset/scope/datacenter-xx

i.e. it is missing the /scope

Once added the query is then successful Smiley Happy

Blog: http://jonathanmedd.net | Twitter: @jonathanmedd

View solution in original post

0 Kudos
1 Reply
jmedd
Enthusiast
Enthusiast
Jump to solution

Figured it out. The URL in the documentation is incorrect, the one you actually need is:

https://192.168.x.x/api/2.0/services/ipset/scope/datacenter-xx

i.e. it is missing the /scope

Once added the query is then successful Smiley Happy

Blog: http://jonathanmedd.net | Twitter: @jonathanmedd
0 Kudos