Overview

CLI command

add-network-partition

DescriptionAdd a new network partition.
Command format

add-network-partition -p <JSON_FILE_PATH>

The path to the JSON file that defines the network partition needs to be defined as the <JSON_FILE_PATH> value.

Parameter definitions

Short option
Long option
Description
Required
Example value
-p
--resource-pathFolder path where the JSON file that defines the network partition is stored.yes<STRATOS_SOURCE_HOME>/samples/network-partitions/kubernetes/network-partition-1.json

Sample network partition JSON

{  
   "id":"network-partition-1",
   "provider":"ec2",
   "partitions":[  
      {  
         "id":"partition-1",
         "property":[  
            {  
               "name":"region",
               "value":"default"
            }
         ]
      }
   ]
}
{
  "id": "network-partition-1",
  "provider": "mock",
  "partitions": [
    {
      "id": "partition-1",
      "property": [
        {
          "name": "region",
          "value": "default"
        }
      ]
    }
  ]
}
{  
   "id":"network-partition-1",
   "provider":"kubernetes",
   "partitions":[  
      {  
         "id":"partition-1",
         "property":[  
            {  
               "name":"cluster",
               "value":"kubernetes-cluster-1"
            }
         ]
      }
   ]
}

For information on all the properties that can be used in a network partition definition, see the Network Partition Resource Definition.

Example

Use case:  Add the network partition that has been defined in the <STRATOS_SOURCE_HOME>/samples/network-partitions/kubernetes/network-partition-1.json file.

add-network-partition -p <STRATOS_SOURCE_HOME>/samples/network-partitions/kubernetes/network-partition-1.json

Sample output

Successfully added network partition.
  • No labels