Migrate Tenant for a firewall using API on NSM On-Prem with Postman

Description

When a firewall is added to NSM, it is in the default tenant "Global Default Tenant". It can be migrate to other tenant using API, following these steps:

  1. Prepare API tool (postman)
  2. Get Auth token from NSM to run the API
  3. Run the API from tool (postman)

Here is an example to migrate a firewall to a tenant named "tenant 1".

Resolution

Step 1. Prepare Postman:

1.1 Click on "+" to create new collection:

Image


1.2 Then right click on "New Collection" to rename it something like "NSM On-Prem Migrate Tenant":

Image


1.3 After rename, Click "Add New Request" and rename it to something like "Migrate Tenant":

Image

Image

1.4 Now click on "GET" button and select "PUT" from dropdown list:

Image

1.5 Enter URL after "PUT" box (replace the IP/port with your own NSM):

https://192.168.167.120/api/manager/devices/migrateTenant

Image

1.6 Go to Headers, enter following in KEY/VALUE and it will look like this as in above screenshot:

x-gms-mode/True

x-snwl-timer/no-reset

1.7 After entering, click on "Save":


Step 2. Find out Authentication Bearer Token and tenantID for NSM

2.1 Open NSM login page and open ‘Developer Tools’ :

Image

2.2 Once logged in NSM, change the tenant from "Global Default Tenant" to "All Tenants". scroll on the left panel in ‘Developer Tools’ and find "data" and copy the "authorization: Bearer", starting with ‘ey’:

Image

2.3 Click on browser refresh button, TenantID can be found under "tenants":

Image

Copy the complete line out, tenant name and corresponding tenantID can be located:

[{"msw_tenant_id":"", "name":"Global Default Tenant","alias":"DefaultTenant","log_level":4,"alert_level":2,"registeredDevicesCount":0,"fqdn":"","migrated":false,
"id":"a4371f74-ed0b-4f5a-82e0-448aa618fd58"},{"msw_tenant_id":"",
"name":"tenant 1","alias":"","log_level":3,"alert_level":2,"registeredDevicesCount":0,"fqdn":"","migrated":false,
"id":"a019b28f-1578-42e5-b52a-61f748ca8bce"}]


Step 3: Run API to sync firewalls

3.1 Open API tool (Postman) and select Migrate Tenant (setup in step 2) and click on Authentication tab and under Type  select "Bearer Token" and paste the token from Step 2.2 and save it:

Image

3.2 Go to "Body" , enter following API with tenantID obtained from step 2 and firewall serial number, click "Save", then "Send" (make sure it is JSON type):

{"destinationTenantID":"a019b28f-1578-42e5-b52a-61f748ca8bce","deviceIDs":["2CB8ED23BB70"]}

Image


3.3 Firewall has been migrated to tenant "tenant 1":

Image


Related Articles

  • Analytics On-Prem vs NSM Feature Matrix
    Read More
  • Analytics On-Prem End of Life and NSM Transition FAQ
    Read More
  • NSM On-Prem: Backups over SCP to Windows OpenSSH Server
    Read More
not finding your answers?