HA - Test proxy configuration from specific data center
The ServiceProviderAPI
(Service Provider API) Api-Token scope is required to test proxy configuration from specific data center using Dynatrace API.
Parameter
Parameter | Type | Description | In | Required |
---|---|---|---|---|
dc | string |
Data Center |
path | required |
body | InternetProxyChangeRequest | body | optional |
Body format
The InternetProxyChangeRequest object
Configuration of proxy server for Internet connection
Element | Type | Description | Required |
---|---|---|---|
scheme | string |
Protocol which proxy server uses |
required |
server | string |
Address (either IP or Hostname) of proxy server |
required |
port | integer |
Port of proxy server |
required |
user | string |
User of proxy server, null means do not change previous value |
optional |
password | string |
Password of proxy server, null means do not change previous value |
optional |
nonProxyHosts | string[] |
Definition of hosts for which proxy won't be used. You can define multiple hosts. Each host can start or end with wildcard '*' for instance to match whole domain. |
optional |
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request. See the Example expandable section for working sample request.
{
"scheme": "http",
"server": "string",
"port": 0,
"user": "string",
"password": "string",
"nonProxyHosts": [
"string"
]
}
Response
Response codes
Code | Description |
---|---|
200 | Request was processed, check response body for details |
Response body
The ConnectionStatus object
Internet connection test result
Element | Type | Description |
---|---|---|
connectionOk | boolean | Connection test result |
testExecuted | boolean | Indicates whether test was executed at all |
testExecutionMessage | string | Additional comments usually indicates why test was not executed |
{
"connectionOk": true,
"testExecuted": true,
"testExecutionMessage": "string"
}
Example
In this example, you test a proxy server (outbound-proxy-dc1.dynatrace.com
) that uses port 8080 and requires a password in specific data center (eu-west-1
), at the same time excluding an internal lab host (*.internal.lab.company.com
). In return you receive a JSON response indicating that the connection is OK.
Curl
curl -X PUT "https://myManaged.cluster.com/api/v1.0/onpremise/proxy/test/eu-west-1" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"scheme\":\"http\",\"server\":\"outbound-proxy-dc1.dynatrace.com\",\"port\":8080,\"nonProxyHosts\":[\"https://mycompany.com/proxy/*\",\"*.internal.lab.company.com\"],\"userOrPasswordDefined\":true}"
Request URL
https://myManaged.cluster.com/api/v1.0/onpremise/proxy/test/eu-west-1
Response body
{
"connectionOk": true,
"testExecuted": true,
"testExecutionMessage": "string"
}
Response code
200