VMware Cloud Community
you_cloud
Contributor
Contributor

How to publish changes in the vShield spoofguard with REST API?

Hi

I'm working with vShield 5.1 and in the P187 of <<vShield API Programming Guide>>,"Change SpoofGuard IP Settings",It says that "If the action is publish then no message body is required".So I use the URL"POST https://<vsm-ip>/api/2.0/services/spoofguard/<contextID>?action = publish" ,and the post data is null. But i got a HTTP 500 error,and the error detail is "input contained no data". How to figure out this problem?

0 Kudos
3 Replies
VictorY2000
Contributor
Contributor

I am also looking for a solution for this one.

0 Kudos
sorabhk5
VMware Employee
VMware Employee

You also need to update the <contextID> in the POST e.g: datacenter-id or portgroup-id

ContextId are the mo-refIds of objects i.e. datacenter, portgroup or virtualwire.

You can use vCenter Manager Object Browser ( MOB ) to get mo-refIds for datacenter and portgroups

From Document

An XML representation of VnicIdList is expected in the message body for delete and approve actions.

If the action is publish then no message body is required. If the action is saveApproved then an XML representation of VnicInfo is expected

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

For us, we want to approve the IP change via API. We found the datacenter  ID via MOB, and could got the list of the IP changes by GET https://vsmURL/api/2.0/services/spoofguard/datacenter-21?list=PUBLISHED, however, we got error when we tried to approve the IP change by POST https://vsmURL/api/2.0/services/spoofguard/datacenter-21?action=approve, we are not sure what's the header for this action, and also the "messaged body" that mentioned in the Page 185 ( "An XML representation of VnicIdList is expected in the message body for delete and approve actions.") . could someone give us a example?

Thanks!

0 Kudos