A trusted host group can be created with a set of trusted hosts, which can be associated with the service to enforce action for the trusted hosts.
For more information on trusted hosts, see How to Configure Trusted Hosts .
Creating a Trusted Host Group
| URL: /v1/ trusted_host_groups | |||
| Method: POST | |||
| Description: Creates a trusted host group with the given name. | |||
| Parameter Name | Data Type | Mandatory | Description |
|---|---|---|---|
| Input Parameters: | |||
| name | Alphanumeric | Yes | A name for the trusted host group that needs to be created. |
Example:
Request:
curl http://192.168.0.1:8000/restapi/v1/trusted_host_groups -u 'eyJldCI6mFkbWluIn0=\n:' -X POST -H Content-Type:application/json -d '{"name":"Group1"}'
Response:
{"id":"Group1","token":"eyJldCWluIn0=\n"}
Deleting a Trusted Host Group
| URL: /v1/ trusted_host_groups/{trusted_host_group_name} |
| Method: DELETE |
| Description: Deletes the given service group |
Example:
Request:
curl http://192.168.0.1:8000/restapi/v1/trusted_host_groups/Group1 -u 'eyJldkbWluIn0=\n:' -X DELETE
Response:
{"msg":"Successfully deleted","token":"eyJldbWluIn0=\n"}
Adding a Trusted Host Group
| URL: /v1/ trusted_host_groups/{trusted_host_group_name}/trusted_hosts | |||
| Method: POST | |||
| Description: Creates a trusted host with the given name. | |||
| Parameter Name | Data Type | Mandatory | Description |
|---|---|---|---|
| Input Parameters: | |||
| name | Alphanumeric | Yes | Name for the trusted host. |
| address_version | Enumeration | Yes | Internet protocol version for the trusted host. |
| ip_address | Alphanumeric | Yes | IP address of the trusted host. |
| mask | Alphanumeric | Yes | Associated subnet mask. |
| comments | Alphanumeric | Optional | Description about the trusted host. |
Example:
Request:
curl http://192.168.0.1:8000/restapi/v1/trusted_host_groups/Group1/trusted_hosts -u 'eyJldCluIn0=\n:' -X POST -H Content-Type:application/json -d '{"name":"Host1", "ip_address":"99.99.124.56", "address_version":"ipv4", "mask":"255.255.255.255", "comments":"raj"}'
Response:
{"id":"Host1","token":"eyJldWluIn0=\n"}
Updating a Trusted Host
| URL: /v1/ trusted_host_groups/{trusted_host_group_name}/trusted_hosts/(trusted_host_name) | |||
| Method: PUT | |||
| Description: Updates the values of given parameters. | |||
| Parameter Name | Data Type | Mandatory | Description |
|---|---|---|---|
| Input Parameters: | |||
| ip_address | Alphanumeric | Optional | IP address of the trusted host. |
| mask | Alphanumeric | Optional | Associated subnet mask. |
| comments | Alphanumeric | Optional | Description about the trusted host. |
Example:
Request:
curl http://192.168.0.1:8000/restapi/v1/trusted_host_groups/Group1/trusted_hosts/Host1 -u 'eyJldCIn0=\n:' -X PUT -H Content-Type:application/json -d '{"ip_address":"99.99.107.69", "mask":"255.255.0.0"}'
Response:
{"id":"Host1","token":"eyJldCWluIn0=\n"}
Deleting a Trusted Host
| URL: /v1/ trusted_host_groups/{trusted_host_group_name}/trusted_hosts/(trusted_host_name) | |||
| Method: DELETE | |||
| Description: Deletes the given trusted host. | |||
| Parameter Name | Data Type | Mandatory | Description |
|---|---|---|---|
| Input Parameters: | |||
| ip_address | Alphanumeric | Optional | IP address of the trusted host. |
| mask | Alphanumeric | Optional | Associated subnet mask. |
| comments | Alphanumeric | Optional | Description about the trusted host. |
Example:
Request:
curl http://192.168.0.1:8000/restapi/v1/trusted_host_groups/group1/trusted_hosts/Host1 -u 'eyJldCI6IjEluIn0=\n:' -X DELETE
Response:
{"msg":"Successfully deleted","token":"eyJldCI6IjEIn0=\n"}