Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
anilcecikoglu
Participant

Api Call - message : Requested object name [tcp_3389] is not unique

Hi All,

I got a error while creating access rule with api call.

This error shown as below:

{
code : generic_err_object_field_not_unique,
message : Requested object name [tcp_3389] is not unique.
}

 

Firstly i added host and service objects and i got status code 200,

{url: https://x.x.x.x:443/web_api/add-service-tcp, payload: {name: tcp_3389, port: 3389, ignore-warnings: true}, status_code: 200}

{url: https://x.x.x.x:443/web_api/add-host, payload: {name: 2.1.2.1, ip-address: 2.1.2.1, ignore-warnings: true}, status_code: 200}

{url: https://x.x.x.x:443/web_api/add-host, payload: {name: 1.2.1.2, ip-address: 1.2.1.2, ignore-warnings: true}, status_code: 200}

Then i tried to add access rule with payload below, i got error

{url: https://x.x.x.x:443/web_api/add-access-rule, payload: {position: top, layer: Network, source: [1.2.1.2], destination: [2.1.2.1], service: [tcp_3389], time: Any, action: Accept, comments: test-1, ignore-warnings: true, track: {type: Log}}, status_code: 400}

Does anyone have an idea about that?

Thanks

0 Kudos
6 Replies
PhoneBoy
Admin
Admin

Sounds like you have multiple objects with the same name.
That is not an error you can "ignore."
Search for the object(s) in SmartConsole and rename them.

0 Kudos
anilcecikoglu
Participant

Thank you for your response,

Do you know, how to ignore while creating this object in api call?

0 Kudos
Chris_Atkinson
Employee Employee
Employee

But why are you trying to create something that already exists...?

Either reuse the existing object to avoid the duplication or choose a different name for the new one that you're attempting to create.

CCSM R77/R80/ELITE
0 Kudos
anilcecikoglu
Participant

Hi Chris, Thank you for your response,

but i did not get any error while creating tcp_3389 also i get 200 from create process.

you are right but, i want to ignore this error, do you have any idea about this?

0 Kudos
PhoneBoy
Admin
Admin

You used ignore-warnings true when creating the object.
If you had not done that, you would have gotten a warning about creating an object with the same name and/or details (IP, port, etc) as an existing object.
The 200 message is expected in this case.

The reason you are getting an error now is because you are attempting to refer to an object by name when that name is not unique.
This is not an error you can ignore.
To refer to the specific object you created, reference the object by uid (which is always unqiue) instead of the name.

However, creating multiple objects with the same name/details is very much not recommended.

0 Kudos
anilcecikoglu
Participant

Thank you for your answer, I'll try

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events