A Service Group is a container with multiple services. You can use service groups for grouping services for example, all HTTP services can be within a service group.
To Create a Service Group
URL: /v1/vsites/{vsite_id}/service_groups | |||
Method: POST | |||
Description: Creates a service group with the given name under the specified vsite. | |||
Parameter Name | Data Type | Mandatory | Description |
---|---|---|---|
Input Parameters: | |||
name | Alphanumeric | Yes | A name for the service group that needs to be created. |
Example:
Request:
curl http://192.168.0.1:8000/restapi/v1/vsites/default/service_groups -u 'eyJldCI6IjEzODAyNDEzMjciLCJwYXNzd29yZCI6IjkzYjNmMzYyYjc3NGM4OTNjMzI4ZjExZTJk\nM2I1NTAxIiwidXNlciI6ImFkbWluIn0=\n:' -X POST -H Content-Type:application/json -d '{"name":"demo_service_gp"}'
Response:
{"id":"demo_service_gp","token":"eyJldCI6IjEzODAyNDE1MjEiLCJwYXNzd29yZCI6Ijk5Nzc3MmE0ZDY5NWViYmM5Mzc0NDcyODU3\nMWM1YmE4IiwidXNlciI6ImFkbWluIn0=\n"}
To Retrieve Service Groups
URL: /v1/vsites/{vsite_id}/service_groups /v1/vsites/{vsite_id}/service_groups/{service_group_id} | |||
Method: GET | |||
Description: Lists all service groups if “service_group_id” is not specified. | |||
Parameter Name | Data Type | Mandatory | Description |
---|---|---|---|
Input Parameters: | |||
parameters | Alphanumeric | Optional | Any specific parameter name that needs to be retrieved. See Example 2. |
Example1:
Request:
curl http://192.168.0.1:8000/restapi/v1/vsites/default/service_groups/demo_service_gp -u 'eyJldCI6IjEzODAyNDEzMjciLCJwYXNzd29yZCI6IjkzYjNmMzYyYjc3NGM4OTNjMzI4ZjExZTJk\nM2I1NTAxIiwidXNlciI6ImFkbWluIn0=\n:' -X GET
Response:
{"name":"demo_service_gp","id":"demo_service_gp","token":"eyJldCI6IjEzODAyNDE1OTMiLCJwYXNzd29yZCI6ImU1OTJiZTkxNTEwMjliNDAwZThjNDNkNDM1\nZThmZGEyIiwidXNlciI6ImFkbWluIn0=\n","virtual_services":[]}
Example 2:
Request:
curl http://192.168.0.1:8000/restapi/v1/vsites/default/service_groups/demo_service_gp -u 'eyJldCI6IjE1MDE4MjcwNTUiLCJwYXNzd29yZCI6ImYzOTM0NTQ5ODhjZWVkMWExMjQwMzFkMDkw\nZGZlZTIwIiwidXNlciI6ImFkbWluIn0=\n:' -X GET -G -d parameters=name
Response:
{"name":"demo_service_gp","id":"demo_service_gp","token":"eyJldCI6IjE1MDQzMjI0NzEiLCJwYXNzd29yZCI6ImRmMTg3YTZjNzJhMDRmZjhhOTNjYTJmMTRj\nN2I0ZGQ0IiwidXNlciI6ImFkbWluIn0=\n"}
To Update a Service Group
URL: /v1/vsites/{vsite_id}/service_groups/{service_group_id} | |||
Method: PUT | |||
Description: Updates the given service group with the given value. | |||
Parameter Name | Data Type | Mandatory | Description |
---|---|---|---|
Input Parameters: | |||
new_name | Alphanumeric | Yes | A new name for the service group. |
Example:
Request:
curl http://192.168.0.1:8000/restapi/v1/vsites/default/service_groups/demo_service_gp -u 'eyJldCI6IjEzODAyNDEzMjciLCJwYXNzd29yZCI6IjkzYjNmMzYyYjc3NGM4OTNjMzI4ZjExZTJk\nM2I1NTAxIiwidXNlciI6ImFkbWluIn0=\n:' -X PUT -H Content-Type:application/json -d '{"new_name":"new_service_gp"}'
Response:
{"id":"demo_service_gp","token":"eyJldCI6IjEzODAyNDE2NzEiLCJwYXNzd29yZCI6IjRlYjQ5YzgxODY2ZDFkNDkwODExNGUyMjI2\nNTk1N2VmIiwidXNlciI6ImFkbWluIn0=\n"}
To Delete a Service Group
URL: /v1/vsites/{vsite_id}/service_groups/{service_group_id} |
Method: DELETE |
Description: Deletes the given service group. |
Example:
Request:
curl http://192.168.0.1:8000/restapi/v1/vsites/default/service_groups/new_service_gp -u 'eyJldCI6IjEzODAyNDEzMjciLCJwYXNzd29yZCI6IjkzYjNmMzYyYjc3NGM4OTNjMzI4ZjExZTJk\nM2I1NTAxIiwidXNlciI6ImFkbWluIn0=\n:' -X DELETE
Response:
{"msg":"Successfully deleted","token":"eyJldCI6IjEzODAyNDE3NTEiLCJwYXNzd29yZCI6ImM0ZWI4ZDdiMGMyYWY5ZTA1MTk0MDYyOGZi\nYzNiNDk0IiwidXNlciI6ImFkbWluIn0=\n"}