This documentation is for WSO2 Private PaaS 4.1.0. View documentation for the latest release.
Updating a Network Partition - WSO2 Private PaaS 4.1.0 - WSO2 Documentation
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
||
Skip to end of metadata
Go to start of metadata

You can update a network partition using the CLI tool, REST API or the PPaaS Console as shown below:

 

Updating a network partition via the CLI

Overview
CLI command
update-network-partition
DescriptionUpdate details of a network partition.
Command format
update-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 definition
Short optionLong optionDescriptionRequiredExample value
-p--resource-pathFolder path of the JSON file where the network partition is defined.Yes

<PRIVATE_PAAS_CARTRIDGES>/wso2am/1.9.0/samples
/network-partitions/mock/network-partition-mock.json

Example

Update a network partition based on the <PRIVATE_PAAS_CARTRIDGES>/wso2am/1.9.0/samples/network-partitions/mock/network-partition-mock.json file.

update-network-partition -p <PRIVATE_PAAS_CARTRIDGES>/wso2am/1.9.0/samples/network-partitions/mock/network-partition-mock.json
Sample output
Network Partition updated successfully: [network-partition] network-partition-mock

Updating a network partition via the REST API

Overview
Description

Update a specific network partition.

URL/networkPartitions
HTTP MethodPUT
Request/Response Formatapplication/json
Command format
curl -X PUT -H "Content-Type: application/json" -d "@<JSON_PAYLOAD>" -k -v -u <USERNAME>:<PASSWORD> https://<PRIVATE_PAAS_HOST>:<PRIVATE_PAAS_HTTPS_PORT>/api/networkPartitions
  • The path to the JSON file that defines the network partition needs to be defined as the <JSON_PAYLOAD> value.
  • By default, <USERNAME>:<PASSWORD> is admin:admin.
  • By default, <PRIVATE_PAAS_HOST> is localhost. However, if you are using a public IP, the respective IP address or domain needs to be specified.
  • By default, <PRIVATE_PAAS_HTTPS_PORT> has been set to 9443. However, if the port offset has been incremented by n, the default port value needs to be incremented by n.
Example

Update a network partition based on the <PRIVATE_PAAS_SAMPLES>/common/samples/network-partitions/mock/network-partition-mock.json file.

cd <PRIVATE_PAAS_SAMPLES>/common/samples
curl -X PUT -H "Content-Type: application/json" -d @'network-partitions/mock/network-partition-mock.json' -k -v -u admin:admin https://localhost:9443/api/networkPartitions
Sample output
> PUT /api/networkPartitions HTTP/1.1
> Host: localhost:9443
> Authorization: Basic YWRtaW46YWRtaW4=
> User-Agent: curl/7.43.0
> Accept: */*
> Content-Type: application/json
> Content-Length: 476
> 
< HTTP/1.1 200 OK
< Date: Fri, 02 Oct 2015 09:08:18 GMT
< Content-Type: application/json
< Transfer-Encoding: chunked
< Server: WSO2 Carbon Server
< 
{"status":"success","message":"Network Partition updated successfully: [network-partition] network-partition-mock"}

You will come across the following HTTP status codes while updating a network partition:

HTTP status code

200, 404, 500

See the descriptions of the HTTP status codes here.

Updating a network partition via the PPaaS Console

Updating a network partition via the UI editor

Follow the instructions below to update a network partition:

  1. Click Configurations on the home page.
  2. Click Network Partitions.
  3. Hover your mouse pointer over the Network Partition that you wish to edit, for the Updatebutton to appear and then click Edit
  4. Update the network partition definition. For property definitions, see the Network Partition Resource Definition.
  5. Click SAVE to save the changes of the updated network partition definition.
Updating a network partition via the JSON editor

Follow the instructions below to update a network partition:

  1. Click Configurations on the home page.
  2. Click Network Partitions.
  3. Hover your mouse pointer over the network partition definition you wish to update for the  Edit  button to appear and click Edit.
  4. Click on the editor control to switch to the JSON editor. The JSON code format to update a network partition appears.
  5. Optionally, check the Auto correct with schema option to ensure that you do not accidentally delete any mandatory fields from the network partition definition JSON code.
  6. Update the network partition definition using JSON. For property definitions, see the Network Partition Resource Definition.
  7. Click SAVE to save the changes of the updated network partition definition.

 


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"
            }
         ]
      }
   ]
}

  • No labels