Default language.

Managing Windows proxies and proxy pools by using the REST API


You can manage Windows proxies and pools by using the /discovery/proxies endpoint. The equivalent manual procedures are described in Adding-Windows-proxies.

To retrieve a list of Windows proxy pools and their proxies

To retrieve the Windows proxy pools and the proxies in each pool, use the GET /discovery/proxies endpoint.
The endpoint returns JSON formatted data listing the defined pools and proxies contained in each pool:

[
  {
    "name": "Credential proxy pool",
    "criteria": "0.0.0.0/0,::/0",
    "type": "CREDENTIAL",
    "domains": [],
    "description": "",
    "proxies": [
      {
        "active": true,
        "address": "172.28.228.205",
        "log_data_usage": 25096,
        "log_soft_limit": 0,
        "record_data_usage": 0,
        "record_soft_limit": 0,
        "enabled": true,
        "error_details": "",
        "name": "proxy_host_bmc_com",
        "port": 4323
      },
      {
        "active": false,
        "address": "new-proxies.bmc.com",
        "log_data_usage": 0,
        "log_soft_limit": 0,
        "record_data_usage": 0,
        "record_soft_limit": 0,
        "enabled": true,
        "error_details": "Timed out",
        "name": "new-proxies-bmc",
        "port": 4323
      }
    ]
  },
]

The endpoint return code is: 200 OK

To retrieve details of a named Windows proxy pool

To retrieve the named proxy pools and the proxies it contains, use the GET /discovery/proxies/{poolname} endpoint.
The endpoint returns JSON formatted data listing details of the pool and proxies it contains. The content is the same as described in To get a list of Windows proxies, but for the named proxy pool.

The endpoint return codes are:

  • 200 OK
  • 404 Pool doesn't exist

To delete a named Windows proxy pool

To delete a named Windows proxy pool and all of the proxies it contains, use the DELETE /discovery/proxies/{poolname} endpoint.

The endpoint return codes are:

  • 200 OK
  • 404 Pool doesn't exist

To create a new Windows proxy pool

Use the POST /discovery/proxies endpoint to create a new proxy pool. Define the proxy pool with JSON of the following form:

{
  "name" : "pool name",
  "criteria" : "0.0.0.0/0",
  "type" : "AD",
  "domains" : ["bmc.com"],
  "description" : "Description of the proxy pool",
  "proxies" : [
    {    
       "name" : "the proxy",
       "address" : "192.168.1.101",
       "port" : 4321,
       "enabled" : true
    }
  ]
}
  • name—the name of the proxy pool (required).
  • criteria—endpoints for which the proxy pool is valid.
  • type—the type of proxy pool, AD or Credential (required).
  • domains—domains the Windows Proxy Pool will discover (required for AD proxy pools).
  • description—a description of the proxy pool.
  • proxies—a list of Windows proxies, at least one proxy is required, and the name and address for each defined proxy is required.

The endpoint return codes are:

  • 200 OK
  • 400 Bad Request: missing or invalid parameters
  • 4xx Duplicate pool name

Update the named Windows proxy pool

To update a named Windows proxy pool, retrieve its details by using the GET /discovery/proxies/{poolname} endpoint, edit the returned JSON, and use the PATCH /discovery/proxies/{poolname} endpoint.

The endpoint return codes are:

  • 200 OK
  • 400 Bad Request
  • 404 Pool doesn't exist

To retrieve proxy settings in a named Windows proxy pool

To retrieve the proxy settings in a named proxy pool, use the GET /discovery/proxies/{poolname}/settings endpoint. Each proxy is tried in turn, and the following settings are returned in JSON format from the first proxy to respond:

{
  "log_level": "info",
  "flags_overloaded": false,
  "auto_purge_max_data_age": 7,
  "auto_purge_mode": "LOGS",
  "auto_purge_period": 24,
  "log_soft_limit": 0,
  "openports": false,
  "powershell": true,
  "powershell_http_enabled": true,
  "powershell_http_port": 5985,
  "powershell_https_enabled": true,
  "powershell_https_port": 5986,
  "powershell_jea_config_name": "string",
  "powershell_jea_enabled": false,
  "powershell_timeout": 60,
  "record_soft_limit": 0,
  "recording_mode": "NORMAL",
  "remquery": true,
  "remquery_timeout": 60,
  "tcpvcon": false,
  "wmi": true,
  "wmi_batch_size": 200,
  "wmi_batch_timeout": 60,
  "wmi_timeout": 120,
  "wmi_query_creation": true
}

The endpoint return codes are:

  • 200 OK
  • 400 Bad Request
  • 404 Pool doesn't exist

To update the proxy settings in a named Windows proxy pool

To update the proxy settings in a named proxy pool, use the GET /discovery/proxies/{poolname}/settings endpoint, edit the returned JSON, and use the PATCH /discovery/proxies/{poolname}/settings endpoint. The changes are applied to all proxies in the pool. If a value is not specified in the JSON, it is not updated.

The endpoint return codes are:

  • 200 OK
  • 400 Bad Request
  • 404 Pool doesn't exist

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC Helix Discovery 26.2 (On-Premises)