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, refer to How to Configure Trusted Hosts.
To Create 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 'eyJldCI6IjE0NDc5MjU4MDkiLCJwYXNzd29yZCI6Ijg4YzgzMGNlNGY4YzUxMWNkZDBlMWZmOTc5\nYTg0NDA0IiwidXNlciI6ImFkbWluIn0=\n:' -X POST -H Content-Type:application/json -d '{"name":"Group1"}'
Response:
{"id":"Group1","token":"eyJldCI6IjE0NDc5MjU5MjkiLCJwYXNzd29yZCI6ImNlZjczY2FkYzljOTcyNjJmNjExMDA4YzA2\nZDMxMTk3IiwidXNlciI6ImFkbWluIn0=\n"}
To Delete 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 'eyJldCI6IjE0NDc5MjU4MDkiLCJwYXNzd29yZCI6Ijg4YzgzMGNlNGY4YzUxMWNkZDBlMWZmOTc5\nYTg0NDA0IiwidXNlciI6ImFkbWluIn0=\n:' -X DELETE
Response:
{"msg":"Successfully deleted","token":"eyJldCI6IjE0NDc5MjU5MTMiLCJwYXNzd29yZCI6IjU1OGMxOTdkNjk3N2U2YWE1YTg4ZDlmODIx\nMWEzM2ExIiwidXNlciI6ImFkbWluIn0=\n"}
To Add 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 'eyJldCI6IjE0NDc5MjU4MDkiLCJwYXNzd29yZCI6Ijg4YzgzMGNlNGY4YzUxMWNkZDBlMWZmOTc5\nYTg0NDA0IiwidXNlciI6ImFkbWluIn0=\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":"eyJldCI6IjE0NDc5MjYwMzciLCJwYXNzd29yZCI6ImJmMzVlNzA0NTVlYTFlZDEyNjI3ZTNjNzcx\nYjQyMjczIiwidXNlciI6ImFkbWluIn0=\n"}
To Update 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 'eyJldCI6IjE0NDc5MjU4MDkiLCJwYXNzd29yZCI6Ijg4YzgzMGNlNGY4YzUxMWNkZDBlMWZmOTc5\nYTg0NDA0IiwidXNlciI6ImFkbWluIn0=\n:' -X PUT -H Content-Type:application/json -d '{"name":"host_raj", "ip_address":"99.99.107.69", "mask":"255.255.0.0"}'
Response:
{"id":"Host1","token":"eyJldCI6IjE0NDc5MjkyNjEiLCJwYXNzd29yZCI6ImMzMjQ1Yzk4NGFhOGI2NWVhODI3MmI3MGNj\nOTE4NTc3IiwidXNlciI6ImFkbWluIn0=\n"}
To Delete 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 'eyJldCI6IjE0NDc5MjU4MDkiLCJwYXNzd29yZCI6Ijg4YzgzMGNlNGY4YzUxMWNkZDBlMWZmOTc5\nYTg0NDA0IiwidXNlciI6ImFkbWluIn0=\n:' -X DELETE
Response:
{"msg":"Successfully deleted","token":"eyJldCI6IjE0NDc5MjYxNDkiLCJwYXNzd29yZCI6IjZlMTJlMDYxYTI0MjFhYzBiYTA0YmUxMzY5\nMDNjYzEyIiwidXNlciI6ImFkbWluIn0=\n"}