Creates services.
Operation description
This operation supports creating multiple services.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
apig:CreateService |
none |
*Service
|
None | None |
Request syntax
POST /v1/services HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The request body. |
|
| gatewayId |
string |
No |
The gateway ID. |
gw-cq7l5s5lhtg*** |
| sourceType |
string |
No |
The service source. Valid values:
Valid values:
|
MSE_NACOS |
| serviceConfigs |
array<object> |
No |
The list of service configurations. At least one service configuration is required. |
|
|
array<object> |
No |
The service configuration information. |
||
| name |
string |
No |
The service name. |
user-service |
| namespace |
string |
No |
The namespace of the service.
This parameter is required when sourceType is set to K8S or MSE_NACOS. |
PUBLIC |
| groupName |
string |
No |
The service group name. This parameter is required when sourceType is set to MSE_NACOS. |
DEFAULT_GROUP |
| addresses |
array |
No |
The list of domain names or fixed addresses. |
|
|
string |
No |
The domain name or fixed address. |
dev.com:8080 |
|
| qualifier |
string |
No |
The function version or alias. |
LATEST |
| aiServiceConfig | AiServiceConfig |
No |
The AI service configuration. |
|
| agentServiceConfig | AgentServiceConfig |
No |
The Agent service configuration. This parameter is required when sourceType is set to AGENT. |
|
| modelProviderId |
string |
No |
The model provider ID. |
mp-xxx**** |
| dnsServers |
array |
No |
The list of DNS server addresses. |
|
|
string |
No |
The DNS server address. |
100.100.1.156:53 |
|
| sourceId |
string |
No |
The service source ID. This parameter is required in multi-Nacos instance scenarios. |
nacos-instance-001 |
| validationOptions |
object |
No |
The validation options. Configuration options related to service validation. |
|
| skipVerifyAIChatCompletion |
boolean |
No |
Specifies whether to skip AI chat completion verification. |
|
| expressType |
string |
No |
The service expression type. Identifies the special type or mode of the service. |
Standard |
| resourceGroupId |
string |
No |
The resource group ID. |
rg-xxx |
| clientToken |
string |
No |
The client token. |
xxx |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response body. |
||
| requestId |
string |
The request ID. |
C67DED2B-F19B-5BEC-88C1-D6EB854CD0D4 |
| code |
string |
The response status code. |
Ok |
| message |
string |
The response message. |
success |
| data |
object |
The response data. |
|
| serviceIds |
array |
The list of service IDs. |
|
|
string |
The service ID. |
svc-crbgq0dlhtgrdb*** |
Examples
Success response
JSON format
{
"requestId": "C67DED2B-F19B-5BEC-88C1-D6EB854CD0D4",
"code": "Ok",
"message": "success",
"data": {
"serviceIds": [
"svc-crbgq0dlhtgrdb***"
]
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.