CharlesFu
Contributor
Contributor

Why does create an IPset result in 405 error with vShieldManage API

Jump to solution

I create an IPset with vShield Manger API, but vShield reports fault  http respone "405 Method Not Allowed" with the body info: Requet method  'POST' not supported .  While both query and modify IPset API work correct. Why? the vshield_5.0_api.pdf is written as following:

Create an IPset on a Scope
You can create a new IPset on the specified scope.
Example 2-19.  Create IPset on a scope
Request:
POST https://<vsm-ip>/api/2.0/services/ipset/scope/<scope-moref>
Request Body Example:
<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>

Additional info: I want to create an IPset with  scope-moref of portgroup id of vCenter.

0 Kudos
1 Solution

Accepted Solutions
sorabhk5
VMware Employee
VMware Employee

Just remove the scope from the URL and it should work.

-- POST https://<vsm-ip>/api/2.0/services/ipset/scope/<scope-moref> to POST https://<vsm-ip>/api/2.0/services/ipset/<scope-moref>

All opinions expressed here are my personal opinions and not of my employer. Thanks #Sorabh [[ http://sorabhk5.in or @sorabhk5 ]]

View solution in original post

0 Kudos
4 Replies
abirhasan
Enthusiast
Enthusiast

Here is a nice API documetn have a look...

http://www.vmware.com/pdf/vshield_41_api.pdf

abirhasan
0 Kudos
CharlesFu
Contributor
Contributor

Thank you response. I have check the vshield_41_api.pdf and don't find the create an IPset introduce. I think the IPset is added from the vShield 5.0.
Becuase the new feature is added recently, the vshield_50_api.pdf have not the xsd definite about the IPset.

Referenced api document, I can't create an IPset. But using the vShieldManger GUI, i can create an IPset successfully. Because https is used between vShield Plugin and vShieldManage, I can't grab the network traffic for analysis the Rest request sended by vshield plugin.

0 Kudos
sorabhk5
VMware Employee
VMware Employee

Just remove the scope from the URL and it should work.

-- POST https://<vsm-ip>/api/2.0/services/ipset/scope/<scope-moref> to POST https://<vsm-ip>/api/2.0/services/ipset/<scope-moref>

All opinions expressed here are my personal opinions and not of my employer. Thanks #Sorabh [[ http://sorabhk5.in or @sorabhk5 ]]

View solution in original post

0 Kudos
CharlesFu
Contributor
Contributor

The issue is fixed when using POST https://<vsm-ip>/api/2.0/services/ipset/<scope-moref, Thank sorabhk5 assistance.

0 Kudos