VMware Networking Community
jdemierre
Contributor
Contributor
Jump to solution

API: Post in Simplified User Interface and not in the Advanced one

Hello,

I'm running the latest version of NSX-T 2.4.1 and I have some troubles using the REST API.

I've just upgrade from the version 2.3.1 so all our Networking and Security parameters are now in the Advance User Interface.

I'm migrating everything in the Simplified User Interface. It's recommended by VMware and beautiful dashboards are available there Smiley Wink

I want to create my new nat rules faster using the REST API.

Everything is working (the rules are created) but my rules are only available from the Advance User Interface.

I want from the API that the rules are created in the Simplified User Interface.

Is there a parameter in the request to do so ?

Thank you in advance for your help.

Cordially,

Julien

POST https://<nsx-manager>/api/v1/logical-routers/<logical-router-id>/nat/rules

{

"action": "NO_SNAT",

"match_source_network": "10.x.y.z/16",

"match_destination_network": "120.180.0.0/16",

"logging": true,

"display_name": "Allow-1",

"enabled": true

}

0 Kudos
1 Solution

Accepted Solutions
daphnissov
Immortal
Immortal
Jump to solution

You would have to use a separate API as everything in the new policy-driven section is in the /policy API which you can see from the explorer.

---------------------------------------------------------------------------------------------------------

Was it helpful? Let us know by completing this short survey here.

View solution in original post

2 Replies
daphnissov
Immortal
Immortal
Jump to solution

You would have to use a separate API as everything in the new policy-driven section is in the /policy API which you can see from the explorer.

---------------------------------------------------------------------------------------------------------

Was it helpful? Let us know by completing this short survey here.

jdemierre
Contributor
Contributor
Jump to solution

Thank you very much!

I was looking on the wrong direction (another API) but it's included under the "2.26 Policy" section : NSX-T Data Center REST API - VMware API Explorer - VMware {code}

My new REST API call working correctly:

PATCH  https://<nsx-manager>/policy/api/v1/infra/tier-1s/<tier-1-id>/nat/<nat-id>/nat-rules/<nat-rule-id>

{

"sequence_number": 100,

"action": "NO_SNAT",

"source_network": "10.x.y.z/16",

"destination_network": "120.180.0.0/16",

"service": "",

"scope": [],

"enabled": true,

"logging": true,

"resource_type": "PolicyNatRule",

"display_name": "Allow-1",

"parent_path": "/infra/tier-1s/<tier-1-id>/nat/USER",

"marked_for_delete": false

}

0 Kudos