Support Support Downloads Knowledge Base Juniper Support Portal Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[CSO] Updating the serial number of an SRX Dual CPE in CSO UI via a REST API

0

0

Article ID: KB36445 KB Last Updated: 29 Jan 2021Version: 1.0
Summary:

This article talks about using the REST API to modify the serial number for node0 (primary node) and node1 (secondary node) of an SRX Dual CPE device in Contrail Service Orchestration (CSO) UI for which RMA has been performed.

Note: This article applies to CSO 5.1.2.

 

Solution:

If RMA has been performed on both primary node 0 and secondary node1 of the SRX Dual CPE device that is being managed in the CSO UI, the following steps can be performed to change the serial numbers for both node0 and node1 in the UI.

  1. Generate an auth-token for the cspadmin user. 

POST :   ​http://CSO_IP : 5000/v3/auth/tokens

Body:  ​

{
"auth": {
"scope": {
"project": {
"domain": {
"id": "default"
},
"name": "admin"
}
},
"identity": {
"password": {
"user": {
"domain": {
"id": "default"
},
"password": "PASSWORD",
"name": "cspadmin"
}
},
"methods": [
"password"
]
}
}
}
  1. Generate an auth-token for the tenant (customer).

POST :   http://CSO_IP : 5000/v3/auth/tokens

BODY:    {"auth":{"identity":{"methods":["token"],"token":{"id":"{{auth-token}}"}},"scope":{"project":{"domain":{"id":"default"},"name":"TENANT NAME"}}}}
  1. Fetch the UUIDs for the SRX Dual CPE site (SITENAME, SITENAME_cpe0, and SITENAME_cpe1).

GET:  https://CSO_IP/ems-regional/device/

BODY:  
{
"fq_name": [
"default-domain",
"NewIPVPNpki",
"SITENAME"
],
"uuid": "42f091b6-0f4d-491a-9bfe-83aa580247f7",
"uri": "/ems-regional/device/42f091b6-0f4d-491a-9bfe-83aa580247f7"
},
{
"fq_name": [
"default-domain",
"NewIPVPNpki",
"SITENAME_cpe0"
],
"uuid": "b25291fa-542a-4f11-9de2-4eefd8dba4d7",
"uri": "/ems-regional/device/b25291fa-542a-4f11-9de2-4eefd8dba4d7"
},
{
"fq_name": [
"default-domain",
"NewIPVPNpki",
"SITENAME_cpe1"
],
"uuid": "4642159a-b3db-44c3-885d-0d61d7340b6b",
"uri": "/ems-regional/device/4642159a-b3db-44c3-885d-0d61d7340b6b"
}
  1. Fetch the serial number for SITENAME uuid of the new device under ems-central and ems-regional.

GET: ​https://CSO_IP/ems-regional/device/<SITENAME uuid>

"system_info": {
"hardware_model": "srx4100",
"os_version": "19.3R2-S4.5",
"os_name": "junos-es",
"host_name": "S7GW2.S7GW2.NewIPVPNpki",
"serial_number": "DJ2418AR0171.DJ3618AR0009"
},
},
"parent_uri": "/ems-regional/project/dd80ff89-d391-4508-8a08-8de42dd5958c",
"unique_id": "DJ2418AR0171.DJ3618AR0009"

GET: ​https://{ }/ems-central/device/<SITENAME uuid>
"parent_uri": "/ems-central/project/dd80ff89-d391-4508-8a08-8de42dd5958c",
"unique_id": "DJ2418AR0171.DJ3618AR0009"
"os_name": "junos-es",
"host_name": "S7GW2.S7GW2.NewIPVPNpki",
"serial_number": "DJ2418AR0171.DJ3618AR0009"
  1. Change the serial numbers for SITENAME uuid by using the PUT method [take the complete response from the above GET operation, modify the existing serial number of the device to the new serial number, and create it as a payload (BODY) for the PUT operation].

PUT: https://CSO_IP/ems-regional/device/<SITENAME uuid>
PUT: https://CSO_IP/ems-central/device/<SITENAME uuid>
  1. Fetch the serial number for SITENAME_cpe0 uuid of the new device under ems-central and ems-regional.

GET: ​https://CSO_IP/ems-regional/device/<SITENAME_cpe0 uuid>

"system_info": {
"hardware_model": null,
"os_version": "19.3R2-S4.5",
"os_name": null,
"host_name": "default_host",
"serial_number": "DJ2418AR0171"
},
...

"parent_uri": "/ems-central/project/dd80ff89-d391-4508-8a08-8de42dd5958c",
"unique_id": "DJ2418AR0171"

GET: ​https://CSO_IP/ems-centrall/device/<SITENAME_cpe0 uuid>

"os_name": null,
"host_name": "default_host",
"serial_number": "DJ2418AR0171"
},
...

"parent_uri": "/ems-regional/project/dd80ff89-d391-4508-8a08-8de42dd5958c",
"unique_id": "DJ2418AR0171"
  1. Change the serial numbers for SITENAME_cpe0 uuid of the new device by using the PUT method [take the complete response from the above GET operation, modify the existing serial number of the device to the new serial number, and create it as a payload (BODY) for the PUT operation].

PUT: https://CSO_IP/ems-regional/device/<SITENAME_cpe0 uuid>
PUT: https://CSO_IP/ems-central/device/<SITENAME_cpe0 uuid>
  1. Fetch the serial number for SITENAME_cpe1 uuid of the new device under ems-central and ems-regional.

GET: ​https://CSO_IP/ems-regional/device/<SITENAME_cpe1 uuid>

"os_name": null, "host_name": "default_host", "serial_number": "DJ3618AR0009"
},
...

}, "parent_uri": "/ems-regional/project/dd80ff89-d391-4508-8a08-8de42dd5958c",
"unique_id": "DJ3618AR0009"
  1. Change the serial numbers for SITENAME_cpe1 uuid of the new device by using the PUT method [take the complete response from the above GET operation, modify the existing serial number of the device to the new serial number, and create it as a payload (BODY) for the PUT operation].

PUT: https://CSO_IP/ems-regional/device/<SITENAME_cpe1 uuid>
PUT: https://CSO_IP/ems-central/device/<SITENAME_cpe1 uuid>

After the above steps have been successfully completed, the serial number change will be reflected in the CSO UI.

 

Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search