NSX-T Data Center REST API
Create or update an infra segment port
Create an infra segment port if it does not exist based on the IDs, or update existing portinformation by replacing the port object already exists.
This API is available when using VMware Cloud (AWS, Dell-EMC, Outpost, Hyperscalers) or VMware NSX.
Request:
Method:
PUT
URI Path(s):
/policy/api/v1/infra/segments/{segment-id}/ports/{port-id}
/policy/api/v1/global-infra/segments/{segment-id}/ports/{port-id}
/policy/api/v1/orgs/{org-id}/projects/{project-id}/infra/segments/{segment-id}/ports/{port-id}
/policy/api/v1/global-infra/segments/{segment-id}/ports/{port-id}
/policy/api/v1/orgs/{org-id}/projects/{project-id}/infra/segments/{segment-id}/ports/{port-id}
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
SegmentPort+
Example Request:
{ "address_bindings": [ { "ip_address":"1.1.1.1", "mac_address":"aa:bb:cc:dd:ee:ff" }, { "ip_address":"1.1.1.2", "mac_address":"aa:bb:cc:dd:ee:f1" } ], "tags": [ {"tag":"port-1 tag 1 from Policy","scope":"Policy"} ] } { "attachment": { "allocate_addresses": "Dhcp", "app_id": "BM1_APP1", "bms_interface_config": { "app_intf_name": "bm1", "routing_table": ["-net 201.10.0.0 netmask 255.255.0.0 gw 192.168.1.1", "-net 0.0.0.0 netmask 0.0.0.0 gw 172.16.1.1"] }, "context_id": "2b883ab0-6b82-4c38-bdd2-e929f15e8a4d", "id": "b9e54d63-2437-4e53-889f-66a83822c0c1", "type": "STATIC" } } { "attachment": { "allocate_addresses": "Both", "app_id": "BM1_APP1", "bms_interface_config": { "app_intf_name": "bm1", "routing_table": ["-net 201.10.0.0 netmask 255.255.0.0 gw 192.168.1.1", "-net 0.0.0.0 netmask 0.0.0.0 gw 172.16.1.1"] }, "context_id": "2b883ab0-6b82-4c38-bdd2-e929f15e8a4d", "id": "b9e54d63-2437-4e53-889f-66a83822c0c1", "type": "STATIC" } } { "address_bindings": [ { "mac_address": "24:6E:96:62:B1:A6" } ], "attachment": { "allocate_addresses": "IpPool", "app_id": "BM1_APP1", "bms_interface_config": { "app_intf_name": "bm1" }, "context_id": "2b883ab0-6b82-4c38-bdd2-e929f15e8a4d", "id": "b9e54d63-2437-4e53-889f-66a83822c0c1", "type": "STATIC" } } { "address_bindings": [ { "ip_address": "192.1.1.201/24" } ], "attachment": { "allocate_addresses": "MacPool", "app_id": "BM1_APP1", "bms_interface_config": { "app_intf_name": "bm1" }, "context_id": "2b883ab0-6b82-4c38-bdd2-e929f15e8a4d", "id": "b9e54d63-2437-4e53-889f-66a83822c0c1", "type": "STATIC" } } { "address_bindings": [ { "ip_address": "192.1.1.201/24", "mac_address": "24:6E:96:62:B1:A6" } ], "attachment": { "allocate_addresses": "NONE", "app_id": "BM1_APP1", "bms_interface_config": { "app_intf_name": "bm1" }, "context_id": "2b883ab0-6b82-4c38-bdd2-e929f15e8a4d", "id": "b9e54d63-2437-4e53-889f-66a83822c0c1", "type": "STATIC" } }Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
SegmentPort+