VMware Networking Community
harish422
Contributor
Contributor

error thrown when trying to CREATE an nsx-t redirection rule using REST API.

PUT https://10.5.145.79/policy/api/v1/infra/domains/default/redirection-policies/adc3aec0-c640-11e9-a529...

request payload :

{

            "action": "REDIRECT",

            "resource_type": "RedirectionRule",

            "display_name": "comm-entry-1",

            "id": "comm-entry-1",

            "relative_path": "comm-entry-1",

            "path": "/infra/domains/default/redirection-policies/adc3aec0-c640-11e9-a529-3be73129f6e9/rules/redirect-rule-1",

            "marked_for_delete": false,

            "sources_excluded": false,

            "destinations_excluded": false,

            "source_groups": [

                "/infra/domains/default/groups/IT-web-server-F",

                "/infra/domains/default/groups/IT-app-server-F"

            ],

            "destination_groups": [

                "/infra/domains/default/groups/IT-web-server-F",

                "/infra/domains/default/groups/IT-app-server-F"

            ],

            "services": [

                "ANY"

            ],

            "profiles": [

                "ANY"

            ],

            "logged": false,

            "scope": [

                "ANY"

            ],

            "_revision": 1

        }

Error thrown :

{

    "httpStatus": "NOT_FOUND",

    "error_code": 500090,

    "module_name": "Policy",

    "error_message": "Policy object path=[/infra/domains/default/redirection-policies/adc3aec0-c640-11e9-a529-3be73129f6e9/rules/redirect-rule-1] does not exist."

}

0 Kudos
3 Replies
harish422
Contributor
Contributor

http response code i get is a 404 not found

0 Kudos
daphnissov
Immortal
Immortal

So the response indicates that policy path doesn't exist (not found). If you do a GET request to return those policies, what does it return? Either that ID is invalid or you're specifying it incorrectly in the payload.

0 Kudos
DaleCoghlan
VMware Employee
VMware Employee

Remove the revision number from the payload and try the put request again.