Adding / Updating Region Collection


Adding / Updating Region Collection using Postman

 

                                                                                                                                                                                          

Steps to Follow to Add / Update Region Collection-                                                                                                                

Sample Region Collection                                                                                                                                                   

Get Access Token                                                                                                                                                             

Get all the Existing Regions                                                                                                                                         

Create a New Region                                                                                                                                                       

Update Existing Regions                                                                                                                                              

 

Scope

  • Can Create Region collections be using Postman
  • Can Update Existing Region collections be using Postman. 

 

 

Steps to Follow to Add / Update Region Collection-

Please find the sample data below for region collection.

Sample Region Collection

 

{
"controllers" : [
{
                         "IP" : 
"<primary controller ip>",
                            "role" : 
"primary",
                            "name" : 
"controller-1"
},
{
                         "IP" : 
"<secondary controller ip>",
                            "role" : 
"secondary",
                         "name" : 
"controller-2"
},
{
                         "IP" : 
"<staging primary controller ip>",
                            "role" : 
"stagingPrimary",
                            "name" : 
"controller-1"
},
{
                         "IP" : 
"<staging secondary controller ip>",
                            "role" : 
"stagingSecondary",
                            "name" : 
"controller-2"
}
],
"directors" : [
{
                         "IP" : 
"<primary director ip>",
                            "role" : 
"primary"
},
{
                         "IP" : 
"<secondary director ip>",
                            "role" : 
"secondary"
},
{
                         "IP" : 
"<staging primary director ip>",
                            "role" : 
"stagingPrimary"
},
{
                         "IP" : 
"<staging secondary director ip>",
                         "role" : 
"stagingSecondary"
}
],
         "directorRoles" : [     => Verify the roles or remove if it not needed
                 
"TenantOperator",
                 
"TenantDashboardOperator",
                 
"TenantSecurityAdmin",
                 
"TenantSuperAdmin"
],
"analytics" : {
                 "ClusterName" : 
"<Analytics Cluster Name>",
"NorthboundIP" : [
{
                                    "IP" : 
"<Analytics IP>",
                                    "role" : 
"searchNode"
                         },

                        {

                        #Add like the same above if there is more than once Analytics IP
                                    "IP" : 
"<Analytics IP>",
                                    "role" : 
"searchNode"
}
],
                    "ConnectorPort" : 
"8080"
},
         "region" : 
"<Region_Name>",
         "latitude" : 
50.1109,
         "longitude" : 
8.6821,
         "provider" : 
1,

        "providerName" : <Provider_Name0,

        "saseGateways": [

          {

            "name": "<Name of your SASE Gateway>",

            "address": "<Address of your SASE Gateway>",

            "fqdn": "<FQDN of your SASE Gateway>",

            "zipcode": "<Zip Code>",

             "interface": "<>", -à Primary interface name unit for VSA. e.g, vni-0/0.0

             "networkName": "<>",-à Primary interface network name for VSA. e.g, WAN1

            "city": "<City>",

            "state": "<State",

            "country": "<Country>",

            "latitude": "<Lattitude>",

            "longitude": "<Longtitude>",

            "gatewayProvider": "<>", à If gateway is shared then we should use the primary/provider org for the gateway. Default is providername for the tenant.

                  "redundantVSALink": [ à If gateway supports more than 1 WAN for VSA, please add all those below

                           {

                               "interface": "<>",-à Primary interface name unit for VSA. e.g, vni-0/1.0

                               "networkName": "<>" "<>",-à Primary interface network name for VSA. e.g, WAN2

                           }

                       ]

 

          }

        ],
            "regionClusterVersion" : 
"20.2.3",

        "regionDeviceVersion" : "20.2.3",
         "speedTestServerIP" : 
"<Speed Test Server IP>",
"supportedInstallMethods" : [
                 
"ble",
                 
"urlztp",
                 
"gztp"
]
 }

 

 

GGet Access Token-

For all the region collection related API call’s we need an Access token to be added in the header. Follow the below steps to get new Access Token for your API calls. Replace <host_address> with the respective FQDN or IP address of the titan node.

 

Try to fetch access token using url https://<host_address>/oxauth/restv1/token 

 

 

Method type: POST

Parameters and information to pass-

In body: 
select format as x-www-form-urlencoded
 in bulk or key value pair add these attributes

 

scope: openid+profile+email+uma_protection

password:  <versaadmin user password>

username:  versaadmin@versa.com

grant_type: password

 

in Authorization:

Select type as basic auth:

Username and password for gluu to identify trusted client request

username: @!5FA2.4677.F41A.A083!0001!32DA.E028!0008!D9DB.3A0C.A48D.789B

password: versa123

 

Once we hit we will get the sample response like below.

 

{
     "access_token": 
"xxxxxxxx-xxcc-xxxx-xxxx-xxxxxxxxxxxx",
     "token_type": 
"bearer",
     "expires_in": 
3599,
     "refresh_token": 
"xxxxxxxx-xxcc-xxxx-xxxx-xxxxxxxxxxxx",
     "scope": 
"openid profile uma_protection email"
 }

 

GGet all the Existing Regions -

URL - https://<host_address>/api/v1/organizations/regions

Method Type- GET

Authorization- 
Select Bearer token as type and paste fetched access token in Token section.

Sample Data-
 

{
    
"message": null,
    
"data": [
        {

          <Regions with the above sample Data>
        },

       {

          <Another regions if there is any>

       }
],
    
"status"200
 }

 

 

CCreate a New Region-

URL - https://<host_address>/api/v1/organizations/regions

Method Type- POST

Authorization-
 Select Bearer token as type and paste fetched access token in Token section. 

 

Note: We need to add square brackets while creating new regions with the above mentioned sample data.

 

Body-
 

[
{
"controllers" : [
{
                         "IP" : 
"<primary controller ip>",
                            "role" : 
"primary",
                            "name" : 
"controller-1"
},
{
                         "IP" : 
"<secondary controller ip>",
                            "role" : 
"secondary",
                            "name" : 
"controller-2"
},
{
                         "IP" : 
"<staging primary controller ip>",
                            "role" : 
"stagingPrimary",
                            "name" : 
"controller-1"
},
{
                         "IP" : 
"<staging secondary controller ip>",
                            "role" : 
"stagingSecondary",
                            "name" : 
"controller-2"
}
],
"directors" : [
{
                         "IP" : 
"<primary director ip>",
                            "role" : 
"primary"
},
{
                         "IP" : 
"<secondary director ip>",
                            "role" : 
"secondary"
},
{
                         "IP" : 
"<staging primary director ip>",
                            "role" : 
"stagingPrimary"
},
{
                         "IP" : 
"<staging secondary director ip>",
                            "role" : 
"stagingSecondary"
}
],
         "directorRoles" : [     => Verify the roles or remove if it not needed
                 
"TenantOperator",
                 
"TenantDashboardOperator",
                 
"TenantSecurityAdmin",
                 
"TenantSuperAdmin"
],
"analytics" : {
                 "ClusterName" : 
"<Analytics Cluster Name>",
"NorthboundIP" : [
{
                                    "IP" : 
"<Analytics IP>",
                                    "role" : 
"searchNode"
                         },

                        {

                        #Add like the same above if there is more than once Analytics IP
                                    "IP" : 
"<Analytics IP>",
                                    "role" : 
"searchNode"
}
],
                    "ConnectorPort" : 
"8080"
},
         "region" : 
"<Region_Name>",
         "latitude" : 
50.1109,
         "longitude" : 
8.6821,
         "provider" : 
1,

        "providerName" : <Provider_Name>,

        "saseGateways": [

          {

            "name": "<Name of your SASE Gateway>",

            "address": "<Address of your SASE Gateway>",

            "fqdn": "<FQDN of your SASE Gateway>",

            "zipcode": "<Zip Code>",

             "interface": "<>", -à Primary interface name unit for VSA. e.g, vni-0/0.0

             "networkName": "<>",-à Primary interface network name for VSA. e.g, WAN1

            "city": "<City>",

            "state": "<State",

            "country": "<Country>",

            "latitude": "<Lattitude>",

            "longitude": "<Longtitude>",

            "gatewayProvider": "<>",  à If gateway is shared then we should use the primary/provider org for the gateway. Default is providername for the tenant.

                  "redundantVSALink": [ à If gateway supports more than 1 WAN for VSA, please add all those below

                           {

                               "interface": "<>",-à Primary interface name unit for VSA. e.g, vni-0/1.0

                               "networkName": "<>" "<>",-à Primary interface network name for VSA. e.g, WAN2

                           }

                       ]

 

          }

        ],
         "regionClusterVersion" : 
"20.2.3",

        "regionDeviceVersion" : "20.2.3",
         "speedTestServerIP" : 
"<Speed Test Server IP>",
"supportedInstallMethods" : [
                 
"ble",
                 
"urlztp",
                 
"gztp"
]
}
 ]

 

 

Sample Response - Region data with success response

 

 

UUpdate Existing Regions-

 

To update existing regions, we need to run the get all region api and need to find the region name. After getting the region, we need to follow the below steps

 

Note: There won’t be any square brackets (like we added while we are creating new region) while updating existing regions with the above-mentioned sample data.

 

URL - https://<host_address>/api/v1/organizations/region?region=<Region Name ex. East_Coast>

Method Type- PUT

Authorization- 
 Select Bearer token as type and paste fetched access token in Token section. 

Body- 
 

{
"controllers" : [
{
                         "IP" : 
"<primary controller ip>",
                            "role" : 
"primary",
                         "name" : 
"controller-1"
},
{
                         "IP" : 
"<secondary controller ip>",
                            "role" : 
"secondary",
                            "name" : 
"controller-2"
},
{
                         "IP" : 
"<staging primary controller ip>",
                            "role" : 
"stagingPrimary",
                            "name" : 
"controller-1"
},
{
                         "IP" : 
"<staging secondary controller ip>",
                            "role" : 
"stagingSecondary",
                            "name" : 
"controller-2"
}
],
"directors" : [
{
                         "IP" : 
"<primary director ip>",
                            "role" : 
"primary"
},
{
                         "IP" : 
"<secondary director ip>",
                            "role" : 
"secondary"
},
{
                         "IP" : 
"<staging primary director ip>",
                            "role" : 
"stagingPrimary"
},
{
                         "IP" : 
"<staging secondary director ip>",
                            "role" : 
"stagingSecondary"
}
],
         "directorRoles" : [     => Verify the roles or remove if it not needed
                 
"TenantOperator",
                 
"TenantDashboardOperator",
                 
"TenantSecurityAdmin",
                 
"TenantSuperAdmin"
],
"analytics" : {
                 "ClusterName" : 
"<Analytics Cluster Name>",
"NorthboundIP" : [
{
                                    "IP" : 
"<Analytics IP>",
                                    "role" : 
"searchNode"
                         },

                        {

                        #Add like the same above if there is more than once Analytics IP
                                    "IP" : 
"<Analytics IP>",
                                 "role" : 
"searchNode"
}
],
                    "ConnectorPort" : 
"8080"
},
         "region" : 
"<Region_Name>",
         "latitude" : 
50.1109,
         "longitude" : 
8.6821,
         "provider" : 
1,

        "providerName" : <Provider_Name0,

        "saseGateways": [

          {

            "name": "<Name of your SASE Gateway>",

            "address": "<Address of your SASE Gateway>",

            "fqdn": "<FQDN of your SASE Gateway>",

            "zipcode": "<Zip Code>",

             "interface": "<>", -à Primary interface name unit for VSA. e.g, vni-0/0.0

             "networkName": "<>",-à Primary interface network name for VSA. e.g, WAN1

            "city": "<City>",

            "state": "<State",

            "country": "<Country>",

            "latitude": "<Lattitude>",

            "longitude": "<Longtitude>",

            "gatewayProvider": "<>", à If gateway is shared then we should use the primary/provider org for the gateway. Default is providername for the tenant.

                  "redundantVSALink": [ à If gateway supports more than 1 WAN for VSA, please add all those below

                           {

                               "interface": "<>",-à Primary interface name unit for VSA. e.g, vni-0/1.0

                               "networkName": "<>" "<>",-à Primary interface network name for VSA. e.g, WAN2

                           }

                       ]

          }

        ],
            "regionClusterVersion" : 
"20.2.3",

        "regionDeviceVersion" : "20.2.3",
         "speedTestServerIP" : 
"<Speed Test Server IP>",
"supportedInstallMethods" : [
                 
"ble",
                 
"urlztp",
                 
"gztp"
]
 }

   

 

 

Sample Response - updated region with success response