I am trying to add a group into the inventory as I see on the web interface using the REST API:
PUT /global-manager/api/v1/global-infra/domains/default/groups
{
"expression" : [ {
"ip_addresses" : [ "1.1.1.1" ],
"resource_type" : "IPAddressExpression"
} ],
"resource_type" : "Group",
"display_name" : "00test11",
"description" : "test api call",
"_system_owned" : false,
"_protection" : "NOT_PROTECTED",
"_revision" : 0
}
I keep getting the response:
{ "module_name" : "common-services",
"error_message" : "Method is not allowed",
"error_code" : 282 }
When I do GET /global-manager/api/v1/global-infra/domains/default/groups, I do get all the groups. is there a step that I am missing before making a PUT method call? the docs mention put PUT /global-manager/api/v1/global-infra/domains/default/groups/<group-id> but how do I get the <group-id> before I create it? Any help would be appreciated.
So, after being stuck on this issue for long with no success, I tried to use method PATCH and use the URL ..domains/default/groups/00test11 and that works!
Hi,
if you are creating a new group based on IP address Expression, display name "00test11" is going to group-id. Try like this
PUT /global-manager/api/v1/global-infra/domains/default/groups/00test11
https://developer.vmware.com/apis/1230/nsx-t-global-manager
HTH
Sandy
I have tried that by following the URL mentioned in the docs as you described and then the error comes back as:
{ "httpStatus" : "NOT_FOUND",
"error_code" : 500090,
"module_name" : "Policy", "error_message" : "Policy object path=[/global-infra/domains/default/groups/00test11] does not exist." }
So, after being stuck on this issue for long with no success, I tried to use method PATCH and use the URL ..domains/default/groups/00test11 and that works!