ITRS Opsview Cloud Documentation

Config - BSM - Component

Object type: BSM Component

Request URL: /rest/config/bsmcomponent

List Copied

Parameters: N/A

Example GET request and response Copied

To list all available BSM components:

$ opsview_rest --username=admin --password=initial --pretty --data-format=json GET 'config/bsmcomponent'
{
   "list" : [
      {
         "has_icon" : "0",
         "host_template" : {
            "name" : "Application - Opsview",
            "ref" : "/rest/config/hosttemplate/225"
         },
         "host_template_id" : "225",
         "hosts" : [
            {
               "name" : "opsview",
               "ref" : "/rest/config/host/1"
            }
         ],
         "id" : "3",
         "name" : "Opsview",
         "quorum_pct" : "0",
         "ref" : "/rest/config/bsmcomponent/3",
         "uncommitted" : "0"
      }
   ],
   "summary" : {
      "allrows" : "1",
      "page" : "1",
      "rows" : "1",
      "totalpages" : "1",
      "totalrows" : "1"
   }
}

Create Copied

Example POST Copied

To create a new BSM Component called New Component, specifying the Host Template, Hosts and the required quorum.

Parameters:

$ opsview_rest --username=admin --password=initial --pretty --data-format=json POST 'config/bsmcomponent' --data '{"name":"New Component","host_template":{ "name":"Application - HTTP"},"hosts":[ {"name":"Web1"},{"name":"Web2"},{"name":"Web3"} ], "quorum_pct":"33.33" }'
{
   "object" : {
      "has_icon" : "0",
      "host_template" : {
         "name" : "Application - HTTP",
         "ref" : "/rest/config/hosttemplate/176"
      },
      "host_template_id" : "176",
      "hosts" : [
         {
            "name" : "Web1",
            "ref" : "/rest/config/host/46"
         },
         {
            "name" : "Web2",
            "ref" : "/rest/config/host/47"
         },
         {
            "name" : "Web3",
            "ref" : "/rest/config/host/48"
         }
      ],
      "id" : "5",
      "name" : "New Component",
      "quorum_pct" : "33.33",
      "uncommitted" : "1"
   }
}

Delete Copied

Deletes must be done using the ID in the URL, as follows:

$ opsview_rest --username=admin --password=initial --pretty --data-format=json DELETE 'config/bsmcomponent/5'
{
   "success" : "1"
}
["Opsview On-premises"] ["API", "Technical Reference"]

Was this topic helpful?