Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Mike_A
Advisor

SmartConsole CLI - Validation Failed

I'm working on adding ~85 networks into an group. Some of the networks may already exist, and I'm OK with the duplicate for this process. 

If I use SmartConsole CLI to add the group and networks below, some fail when they are already present with the same subnet/mask. In SmartConsole if I manually create the same network I am able to accept the use of more than one network with the same network/mask combination and move forward.

My question is, how can we accept the use of another network/subnet with a different name to be created and accepted, just like we would in SmartConsole by manually creating the network? Basically when the validation fails with the 1 warning, the network object never gets created or added to the group. I'm looking for some sort of an "accept warning" flag to create the new network in the script even if one exists already with a different name. 

> add group name CORE_NETWORKS
> add network name network_10.2.15.0_b27 subnet 10.2.15.0 mask-length 27 groups CORE_NETWORKS
> add network name network_10.2.1.0_b24 subnet 10.2.1.0 mask-length 24 groups CORE_NETWORKS

code: "err_validation_failed"
message: "Validation failed with 1 warning"
warnings:
- message: "More than one network have the same IP 10.2.1.0/255.255.255.0"


> add network name network_10.2.6.0_b24 subnet 10.2.6.0 mask-length 24 groups CORE_NETWORKS

code: "err_validation_failed"
message: "Validation failed with 1 warning"
warnings:
- message: "More than one network have the same IP 10.2.6.0/255.255.255.0"


> add network name network_10.2.7.0_b24 subnet 10.2.7.0 mask-length 24 groups CORE_NETWORKS

From the commands above, just for testing and to articulate this in a post, the group is created. Out of the 4x networks attempted to be created only 2x are and added to the group. 

 

Capture.JPG

1 Reply
Mike_A
Advisor

I figured it out. 

If you want to create the objects even if one matching a subnet/mask already exist, you can use the commands below after your commands. 

ignore-warnings trueApply changes ignoring warnings

ignore-errors trueApply changes ignoring errors. You won't be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored.

 

Mine looked like this. 

> add group name CORE_NETWORKS
> add network name network_10.2.15.0_b27 subnet 10.2.15.0 mask-length 27 groups CORE_NETWORKS ignore-errors true
> add network name network_10.2.1.0_b24 subnet 10.2.1.0 mask-length 24 groups CORE_NETWORKS ignore-errors true

 

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    Tue 23 Apr 2024 @ 11:00 AM (EDT)

    East US: What's New in R82

    Thu 25 Apr 2024 @ 11:00 AM (SGT)

    APAC: CPX 2024 Recap

    Tue 30 Apr 2024 @ 03:00 PM (CDT)

    EMEA: CPX 2024 Recap

    Thu 02 May 2024 @ 11:00 AM (SGT)

    APAC: What's new in R82

    Tue 23 Apr 2024 @ 11:00 AM (EDT)

    East US: What's New in R82

    Thu 25 Apr 2024 @ 11:00 AM (SGT)

    APAC: CPX 2024 Recap

    Tue 30 Apr 2024 @ 03:00 PM (CDT)

    EMEA: CPX 2024 Recap

    Thu 02 May 2024 @ 11:00 AM (SGT)

    APAC: What's new in R82
    CheckMates Events