Policy > Infra > Hierarchical API

Update the infra including all the nested entities

Patch API at infra level can be used in two flavours
1. Like a regular API to update Infra object
2. Hierarchical API: To create/update/delete entire or part of intent
hierarchy
Hierarchical API: Provides users a way to create entire or part of
intent in single API invocation. Input is expressed in a tree format.
Each node in tree can have multiple children of different types.
System will resolve the dependecies of nodes within the intent tree
and will create the model. Children for any node can be specified using
ChildResourceReference or ChildPolicyConfigResource.
If a resource is specified using ChildResourceReference then it will
not be updated only its children will be updated. If Object is specified
using ChildPolicyConfigResource, object along with its children will be
updated.
Hierarchical API can also be used to delete any sub-branch of entire tree.
This API is available when using VMware Cloud on AWS or VMware NSX-T.

Request:

Method:
PATCH
URI Path(s):
/policy/api/v1/infra
/policy/api/v1/global-infra
Request Headers:
n/a
Query Parameters:
ForceRevisionCheckRequestParameter+
Request Body:
Infra+

Example Request:

#Example using ChildResourceReference in hierarchical API #Below example updates group g1 in'domain-test' without updating domain and without #requiring to populate domain object completely in request payload. PATCH https://<policy-mgr>/policy/api/v1/infra { "resource_type":"Infra", "children":[ { "resource_type":"ChildResourceReference", "id":"domain-test", "target_type":"Domain", "children":[ { "resource_type":"ChildGroup", "Group":{ "resource_type":"Group", "description":"web group update", "display_name":"webgroup", "id":"g1", "expression":[ { "member_type":"VirtualMachine", "value":"web", "key":"Tag", "operator":"EQUALS", "resource_type":"Condition" } ] } } ] } ] }

Successful Response:

Response Code:
200 OK
Response Headers:
n/a
Response Body:
n/a

Required Permissions:

crud

Feature:

no_rbac

Additional Errors: