Description

Starting with CSO (Contrail Service Orchestration) 4.0, it can be installed in three deployment modes: Small, Medium and Large deployment. Refer to the documentation on Contrail Service Orchestration Overview

Regional Microservices virtual machine (Regional msvm) will be created only in Large deployment mode. Small and Medium deployments will not have separate Regional msvm. Refer to the documentation on Minimum Requirements for Servers and VMs.

This article explains how to execute regional Restful API's in Small and Medium deployment modes. Restful API's are used for troubleshooting purposes.

Solution

As per /etc/haproxy/haproxy.cfg configuration in central microservice VM, regional API's such as ems-regional, dms-regional, device-connectivity, cms-regional, config-service, etc., are bound to port 444.

Snippet of haproxy.cfg configuration:

frontend regional-main-frontend
..
bind *:444 ssl crt-list /etc/cert-list
..
acl csp-ems-regional_acl14 url_beg -i /ems-regional
use_backend regional-main-csp-ems-regional-backend if csp-ems-regional_acl14
..
acl csp-dms-regional_acl15 url_beg -i /dms-regional
use_backend regional-main-csp-dms-regional-backend if csp-dms-regional_acl15

Steps to execute regional restful API's in Small and Medium deployments as of CSO 4.1.1 version.

  1. Generate a token. Refer to KB34116 - How to execute Contrail Service Orchestrator HTTP API requests through CLI [juniper.net]  for step by step instructions on how to generate token.

  2. Once token is generated, use the URL below to execute regional Restful API's. Make sure port 444 is used in the URL,otherwise regional restful API's will not work.

    Small Deployment: 

    URL:  https:// <Central Microservices VM IP> :444/ems-regional   
    Example: curl  -k -H "x-auth-token:$TOKEN" -H "content-type: application/json" https://< Central Microservices VM IP>:444/ems-regional/device/  -X GET

    Medium Deployment:

    URL: https:// <Central Microservices VIP IP> :444/ems-regional 
    Example: curl  -k -H "x-auth-token:$TOKEN" -H "content-type: application/json" https://< Central Microservices VIP IP>:444/ems-regional/device/  -X GET


Note: In Large deployments, these regional restful API's will be executed using Regional Microservices VIP IP and standard https port (i.e., 443). Hence, it is not necessary to specify port 443 explicitly (i.e., https:// <CSO Regional Microservices VIP IP> /ems-regional/)