Before you begin
You need to do the following actions before you use Synthetic APIs.
Before you run Synthetic API commands, retrieve the authentication token (ACCESS_TOKEN). To obtain the access token, see Preparing to run component or management API commands.
Get the Synthetic route host name by running the command oc get route -n management-monitoring in cp4mcm hub cluster. The Synthetic Route Port is 443 by default. In the following example, the Synthetic route host is
[root@pogey-inf ~]# oc get route -n management-monitoring NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD monitoring-synthetic monitoring-synthetic-management-monitoring.apps.pogey.cp.fyre.ibm.com monitoring-synthetic client-connect edge None monitoring-threshold monitoring-threshold-management-monitoring.apps.pogey.cp.fyre.ibm.com
If you have multiple console accounts, and don't want to call Synthetic APIs with the default account, you need to pass the
X-TenantIDparameter to the HTTP header. For example, run the following command to pass
curl -X GET -H 'Content-Type: application/json' -H 'Authorization: Bearer $ACCESS_TOKEN' -H 'X-TenantID: f206-de37' -i 'http://<synthetic_route_address>/synthetic/1.0/synthetic_tests'
Note: To get the
X-TenantIDfor your account, click the User icon on IBM Cloud Pak console. The
X-TenantIDfor the default account is