Creating a Service Group
Function
This API is used to create a service group.
URI
POST /v1/{project_id}/service-set
Parameter | Mandatory | Type | Description |
|---|---|---|---|
project_id | Yes | String | Project ID, which can be obtained by calling an API or from the console. For details, see Obtaining a Project ID. |
Parameter | Mandatory | Type | Description |
|---|---|---|---|
enterprise_project_id | No | String | Enterprise project ID, which is the ID of a project planned based on organizations. If the enterprise project function is not enabled, the value is 0. |
fw_instance_id | No | String | Firewall ID, which can be obtained by referring to Obtaining a Firewall ID. |
Request Parameters
Parameter | Mandatory | Type | Description |
|---|---|---|---|
X-Auth-Token | Yes | String | User token. It can be obtained by calling the IAM API (value of X-Subject-Token in the response header). |
Parameter | Mandatory | Type | Description |
|---|---|---|---|
object_id | Yes | String | Protected object ID, which is used to distinguish between Internet border protection and VPC border protection after a cloud firewall is created. You can obtain the ID by calling the API for querying firewall instances. In the return value, find the ID in data.records.protect_objects.object_id (The period [.] is used to separate different levels of objects). If the value of type is 0, object_id is the protected object ID on the Internet border. If the value of type is 1, object_id is the protected object ID on the VPC border. You can obtain the value of type from data.records.protect_objects.type (The period [.] is used to separate different levels of objects). Here, only the protected object ID of the type with the value 0 can be used. |
name | Yes | String | Service group name. |
description | No | String | Service group description. |
Response Parameters
Status code: 200
Parameter | Type | Description |
|---|---|---|
data | ServiceSetId object | Data returned for creating a service group. |
Status code: 400
Parameter | Type | Description |
|---|---|---|
error_code | String | Definition Error code. Range N/A |
error_msg | String | Definition Error description. Range N/A |
Example Requests
Add a service group whose project ID is 9d80d070b6d44942af73c9c3d38e0429, protected object is cfebd347-b655-4b84-b938-3c54317599b2, and name is ceshi.
https://{Endpoint}/v1/9d80d070b6d44942af73c9c3d38e0429/service-set
{
"object_id" : "cfebd347-b655-4b84-b938-3c54317599b2",
"name" : "ceshi",
"description" : ""
} Example Responses
Status code: 200
OK
{
"data" : {
"id" : "221cfdca-3abf-4c30-ab0d-516a03c70866"
}
} Status code: 400
Bad Request
{
"error_code" : "CFW.00200024",
"error_msg" : "Exceeded the upper limit."
} Status Codes
Status Code | Description |
|---|---|
200 | OK |
400 | Bad Request |
401 | Unauthorized: Request error. |
403 | Forbidden: Access forbidden. |
404 | Not Found: Web page not found. |
500 | Internal Server Error |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot
