> For the complete documentation index, see [llms.txt](https://docs.parallels.com/landing/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.parallels.com/landing/ras-rest-api-guide/examples/connection-broker-and-secure-gateway-sample.md).

# Connection Broker and Secure Gateway Sample

### Logon

<table><thead><tr><th>Request</th></tr></thead><tbody><tr><td>POST api/Session/logon</td></tr><tr><td>Headers</td></tr><tr><td><pre><code>Content-Type: application/json; api-version=1.0
</code></pre></td></tr><tr><td>Body</td></tr><tr><td><pre><code>{
  "username":"administrator",
  "password":"11112222"
}
</code></pre></td></tr></tbody></table>

\ <br>

<table><thead><tr><th>Response</th></tr></thead><tbody><tr><td>Status:OK (200)<br></td></tr><tr><td><pre><code>{
  "authToken": "[AUTHENTICATION_TOKEN]"
}
</code></pre></td></tr></tbody></table>

\ <br>

### Get All Secure Gateways

<table><thead><tr><th>Request</th></tr></thead><tbody><tr><td>GET api/gateway</td></tr><tr><td>Headers</td></tr><tr><td><pre><code>Content-Type: application/json; api-version=1.0
auth_token: [AUTHENTICATION_TOKEN]
</code></pre></td></tr></tbody></table>

\ <br>

<table><thead><tr><th>Response</th></tr></thead><tbody><tr><td>Status:OK (200)</td></tr><tr><td><pre><code>[
  {
    "gwMode": 0,
    "preferredPAId": 0,
    "normalModeForwarding": false,
    "forwardHttpServers": "localhost:81",
    "forwardGatewayServers": "",
    "ipVersion": 0,
    "iPs": "126.0.0.5",
    "bindV4Addresses": "",
    "bindV6Addresses": "",
    "optimizeConnectionIPv4": "",
    "optimizeConnectionIPv6": "",
    "enableGWPort": true,
    "broadcast": true,
    "enableClientManagerPort": true,
    "dosPro": true,
    "enableRDP": false,
    "enableRDPUDP": true,
    "gwPort": 80,
    "rdpPort": 3389,
    "enableSSL": true,
    "minSSLVersion": 2,
    "cipherStrength": 2,
    "sslPort": 443,
    "cipher": "EECDH:!SSLv2:!SSLv3:!aNULL:!RC4:!ADH:!eNULL:!LOW:!MEDIUM:!EXP:+HIGH",
    "privateKeyFile": "SelfSignedCertificate.crt",
    "certificateFile": "SelfSignedCertificate.crt",
    "enableUserPortal": true,
    "UserPortalPort": 20020,
    "launchMethod": 0,
    "allowEmbed": false,
    "allowlaunchMethod": true,
    "allowAppsInNewTab": false,
    "allowFileTransfer": true,
    "allowClipboard": true,
    "usePreWin2000LoginFormat": true,
    "enableHSTS": false,
    "hstsIncludeSubdomains": false,
    "hstsPreload": false,
    "hstsMaxAge": 12,
    "enableWyseSupport": true,
    "securityMode": 0,
    "macAllowExceptLst": [],
    "macAllowOnlyLst": [],
    "webRequestsURL": "",
    "fwGWID": 4294967295,
    "server": "126.0.0.5",
    "enabled": true,
    "description": "",
    "siteId": 1,
    "id": 218
  }
]
</code></pre></td></tr></tbody></table>

\ <br>

### New Secure Gateway

<table><thead><tr><th>Request</th></tr></thead><tbody><tr><td>POST api/gateway</td></tr><tr><td>Headers</td></tr><tr><td><pre><code>Content-Type: application/json; api-version=1.0
auth_token: [AUTHENTICATION_TOKEN]
</code></pre></td></tr><tr><td>Body</td></tr><tr><td><pre><code>{
  "server":"126.0.0.6",
  "siteId":"1"
}
</code></pre></td></tr></tbody></table>

\ <br>

<table><thead><tr><th>Response</th></tr></thead><tbody><tr><td>Status:Created (201)<br></td></tr><tr><td><pre><code>{
  "gwMode": 0,
  "preferredPAId": 0,
  "normalModeForwarding": false,
  "forwardHttpServers": "localhost:81",
  "forwardGatewayServers": "",
  "ipVersion": 0,
  "iPs": "126.0.0.6",
  "bindV4Addresses": "",
  "bindV6Addresses": "",
  "optimizeConnectionIPv4": "",
  "optimizeConnectionIPv6": "",
  "enableGWPort": true,
  "broadcast": true,
  "enableClientManagerPort": true,
  "dosPro": true,
  "enableRDP": false,
  "enableRDPUDP": true,
  "gwPort": 80,
  "rdpPort": 3389,
  "enableSSL": true,
  "minSSLVersion": 2,
  "cipherStrength": 2,
  "sslPort": 443,
  "cipher": "EECDH:!SSLv2:!SSLv3:!aNULL:!RC4:!ADH:!eNULL:!LOW:!MEDIUM:!EXP:+HIGH",
  "privateKeyFile": "SelfSignedCertificate.crt",
  "certificateFile": "SelfSignedCertificate.crt",
  "enableUserPortal": true,
  "UserPortalPort": 20020,
  "launchMethod": 0,
  "allowEmbed": false,
  "allowlaunchMethod": true,
  "allowAppsInNewTab": false,
  "allowFileTransfer": true,
  "allowClipboard": true,
  "usePreWin2000LoginFormat": true,
  "enableHSTS": false,
  "hstsIncludeSubdomains": false,
  "hstsPreload": false,
  "hstsMaxAge": 12,
  "enableWyseSupport": true,
  "securityMode": 0,
  "macAllowExceptLst": [],
  "macAllowOnlyLst": [],
  "webRequestsURL": "",
  "fwGWID": 4294967295,
  "server": "126.0.0.6",
  "enabled": true,
  "description": "",
  "siteId": 1,
  "id": 220
}
</code></pre></td></tr></tbody></table>

\ <br>

### Get Secure Gateway

<table><thead><tr><th>Request</th></tr></thead><tbody><tr><td>GET api/gateway/220</td></tr><tr><td>Headers</td></tr><tr><td><pre><code>Content-Type: application/json; api-version=1.0
auth_token: [AUTHENTICATION_TOKEN]
</code></pre></td></tr></tbody></table>

\ <br>

<table><thead><tr><th>Response</th></tr></thead><tbody><tr><td>Status:OK (200)<br></td></tr><tr><td><pre><code>{
  "gwMode": 0,
  "preferredPAId": 0,
  "normalModeForwarding": false,
  "forwardHttpServers": "localhost:81",
  "forwardGatewayServers": "",
  "ipVersion": 0,
  "iPs": "126.0.0.6",
  "bindV4Addresses": "",
  "bindV6Addresses": "",
  "optimizeConnectionIPv4": "",
  "optimizeConnectionIPv6": "",
  "enableGWPort": true,
  "broadcast": true,
  "enableClientManagerPort": true,
  "dosPro": true,
  "enableRDP": false,
  "enableRDPUDP": true,
  "gwPort": 80,
  "rdpPort": 3389,
  "enableSSL": true,
  "minSSLVersion": 2,
  "cipherStrength": 2,
  "sslPort": 443,
  "cipher": "EECDH:!SSLv2:!SSLv3:!aNULL:!RC4:!ADH:!eNULL:!LOW:!MEDIUM:!EXP:+HIGH",
  "privateKeyFile": "SelfSignedCertificate.crt",
  "certificateFile": "SelfSignedCertificate.crt",
  "enableUserPortal": true,
  "UserPortalPort": 20020,
  "launchMethod": 0,
  "allowEmbed": false,
  "allowlaunchMethod": true,
  "allowAppsInNewTab": false,
  "allowFileTransfer": true,
  "allowClipboard": true,
  "usePreWin2000LoginFormat": true,
  "enableHSTS": false,
  "hstsIncludeSubdomains": false,
  "hstsPreload": false,
  "hstsMaxAge": 12,
  "enableWyseSupport": true,
  "securityMode": 0,
  "macAllowExceptLst": [],
  "macAllowOnlyLst": [],
  "webRequestsURL": "",
  "fwGWID": 4294967295,
  "server": "126.0.0.6",
  "enabled": true,
  "description": "",
  "siteId": 1,
  "id": 220
}
</code></pre></td></tr></tbody></table>

\ <br>

### Update Secure Gateway

<table><thead><tr><th>Request</th></tr></thead><tbody><tr><td>PUT api/gateway/220</td></tr><tr><td>Headers</td></tr><tr><td><pre><code>Content-Type: application/json; api-version=1.0
auth_token: [AUTHENTICATION_TOKEN]
</code></pre></td></tr><tr><td>Body</td></tr><tr><td><pre><code>{
  "ipversion":"bothVersions",
  "enableGWPort":"false"
}
</code></pre></td></tr></tbody></table>

\ <br>

| Response                |
| ----------------------- |
| Status:No Content (204) |

\ <br>

### Delete Secure Gateway

<table><thead><tr><th>Request</th></tr></thead><tbody><tr><td>DELETE api/gateway/224</td></tr><tr><td>Headers</td></tr><tr><td><pre><code>Content-Type: application/json; api-version=1.0
auth_token: [AUTHENTICATION_TOKEN]
</code></pre></td></tr></tbody></table>

\ <br>

| Response                |
| ----------------------- |
| Status:No Content (204) |

\ <br>

### Get All Connection Brokers

<table><thead><tr><th>Request</th></tr></thead><tbody><tr><td>GET api/broker</td></tr><tr><td>Headers</td></tr><tr><td><pre><code>Content-Type: application/json; api-version=1.0
auth_token: [AUTHENTICATION_TOKEN]
</code></pre></td></tr></tbody></table>

\ <br>

<table><thead><tr><th>Response</th></tr></thead><tbody><tr><td>Status:OK (200)</td></tr><tr><td><pre><code>[
  {
    "priority": 0,
    "ip": "10.226.13.23",
    "alternativeIPs": "",
    "standby": false,
    "markedForDeletion": false,
    "server": "DESKTOP-OAP0DJ2",
    "enabled": true,
    "description": "aekaek",
    "siteId": 1,
    "id": 1
  }
]
</code></pre></td></tr></tbody></table>

\ <br>

### Create Connection Broker

<table><thead><tr><th>Request</th></tr></thead><tbody><tr><td>POST api/broker</td></tr><tr><td>Headers</td></tr><tr><td><pre><code>Content-Type: application/json; api-version=1.0
auth_token: [AUTHENTICATION_TOKEN]
</code></pre></td></tr><tr><td>Body</td></tr><tr><td><pre><code>{
  "server":"192.12.0.8",
  "siteId":"1"
}
</code></pre></td></tr></tbody></table>

\ <br>

<table><thead><tr><th>Response</th></tr></thead><tbody><tr><td>Status:Created (201)</td></tr><tr><td><pre><code>{
  "priority": 1,
  "ip": "192.12.0.8",
  "alternativeIPs": "",
  "standby": false,
  "markedForDeletion": false,
  "server": "192.12.0.8",
  "enabled": true,
  "description": "",
  "siteId": 1,
  "id": 133
}
</code></pre></td></tr></tbody></table>

\ <br>

### Get All Conection broker Status

<table><thead><tr><th>Request</th></tr></thead><tbody><tr><td>GET api/broker/status</td></tr><tr><td>Headers</td></tr><tr><td><pre><code>Content-Type: application/json; api-version=1.0
auth_token: [AUTHENTICATION_TOKEN]
</code></pre></td></tr></tbody></table>

\ <br>

<table><thead><tr><th>Response</th></tr></thead><tbody><tr><td>Status:OK (200)<br></td></tr><tr><td><pre><code>[
  {
    "cpuLoad": 0,
    "memLoad": 0,
    "diskRead": 0,
    "diskWrite": 0,
    "enabled": true,
    "id": "1",
    "server": "DESKTOP-OAP0DJ2",
    "siteId": 1,
    "agentVer": "17.0 (build 21000) vkoutsomanis 0",
    "serverOS": "Windows 10 Enterprise Edition (x64)",
    "serviceStartTime": "Unknown",
    "systemBootTime": "Tue May 14 12:10:39 2019",
    "unhandledExceptions": 0,
    "agentState": 0,
    "serverType": 7,
    "logLevel": 3
  }
]
</code></pre></td></tr></tbody></table>

\ <br>

### Update Connection Broker

<table><thead><tr><th>Request</th></tr></thead><tbody><tr><td>PUT api/broker/133</td></tr><tr><td>Headers</td></tr><tr><td><pre><code>Content-Type: application/json; api-version=1.0
auth_token: [AUTHENTICATION_TOKEN]
</code></pre></td></tr><tr><td>Body</td></tr><tr><td><pre><code>{
  "enable":"false",
  "description":"alternative publishing agent"
}
</code></pre></td></tr></tbody></table>

\ <br>

| Response                |
| ----------------------- |
| Status:No Content (204) |

\ <br>

### Update Connection Broker Priority

<table><thead><tr><th>Request</th></tr></thead><tbody><tr><td>PUT api/broker/133/priority</td></tr><tr><td>Headers</td></tr><tr><td><pre><code>Content-Type: application/json; api-version=1.0
auth_token: [AUTHENTICATION_TOKEN]
</code></pre></td></tr><tr><td>Body</td></tr><tr><td><pre><code>{
  "direction":"up"
}
</code></pre></td></tr></tbody></table>

\ <br>

<table><thead><tr><th>Response</th></tr></thead><tbody><tr><td>Status:Bad Request (400)</td></tr><tr><td><pre><code>{
  "code": 0,
  "msg": "Cannot move selected Publishing Agent up."
}
</code></pre></td></tr></tbody></table>

\ <br>

### Promote Connection Broker To Primary

<table><thead><tr><th>Request</th></tr></thead><tbody><tr><td>POST api/broker/133/Promote</td></tr><tr><td>Headers</td></tr><tr><td><pre><code>Content-Type: application/json; api-version=1.0
auth_token: [AUTHENTICATION_TOKEN]
</code></pre></td></tr></tbody></table>

\ <br>

<table><thead><tr><th>Response</th></tr></thead><tbody><tr><td>Status:Bad Request (400)</td></tr><tr><td><pre><code>{
    "code": 0,
    "msg": "Cannot promote RAS Connection Broker - The selected Connection Broker is already set as primary."
}
</code></pre></td></tr></tbody></table>

\ <br>

### Delete Connection Broker

<table><thead><tr><th>Request</th></tr></thead><tbody><tr><td>DELETE api/broker/133</td></tr><tr><td>Headers</td></tr><tr><td><pre><code>Content-Type: application/json; api-version=1.0
auth_token: [AUTHENTICATION_TOKEN]
</code></pre></td></tr></tbody></table>

\ <br>

| Response                |
| ----------------------- |
| Status:No Content (204) |

\ <br>

### Apply Settings

<table><thead><tr><th>Request</th></tr></thead><tbody><tr><td>POST api/Settings/Apply</td></tr><tr><td>Headers</td></tr><tr><td><pre><code>Content-Type: application/json; api-version=1.0
auth_token: [AUTHENTICATION_TOKEN]
</code></pre></td></tr></tbody></table>

\ <br>

| Response                |
| ----------------------- |
| Status:No Content (204) |

\ <br>

### LogOff

<table><thead><tr><th>Request</th></tr></thead><tbody><tr><td>POST api/Session/logoff</td></tr><tr><td>Headers</td></tr><tr><td><pre><code>Content-Type: application/json; api-version=1.0
auth_token: [AUTHENTICATION_TOKEN]
</code></pre></td></tr></tbody></table>

\ <br>

| Response        |
| --------------- |
| Status:OK (200) |

\ <br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.parallels.com/landing/ras-rest-api-guide/examples/connection-broker-and-secure-gateway-sample.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
