Creates a service by specifying parameters, such as the region ID, deployment type, service type, and service name.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
computenestsupplier:CreateService |
create |
*Service
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID. |
cn-hangzhou |
| ClientToken |
string |
No |
A client token used to ensure the idempotence of the request. Generate a unique value for this parameter from your client. `ClientToken` supports only ASCII characters. |
10CM943JP0EN9D51H |
| ServiceId |
string |
No |
The service ID. |
service-0e6fca6a51a544xxxxxx |
| DeployType |
string |
Yes |
The deployment type. Valid values:
|
ros |
| DeployMetadata |
string |
No |
The deployment configuration of the service. The information stored varies by deployment type. Different deployment types have different data formats. The data is stored in a JSON string. |
{\"TemplateConfigs\":[{\"Name\":\"模板1\",\"Url\":\"oss://computenest-test/template" + ".json?RegionId=cn-beijing\",\"PredefinedParameters\":[{\"Name\":\"低配版\"," + "\"Parameters\":{\"InstanceType\":\"ecs.g5.large\",\"DataDiskSize\":40}},{\"Name\":\"高配版\"," + "\"Parameters\":{\"InstanceType\":\"ecs.g5.large\",\"DataDiskSize\":200}}]}]} |
| ServiceType |
string |
No |
The service type. Valid values:
|
private |
| ServiceInfo |
array<object> |
No |
The service details. |
|
|
array<object> |
No |
The service details. |
||
| Locale |
string |
Yes |
The language of the service. Valid values:
|
zh-CN |
| ShortDescription |
string |
No |
A brief description of the service. |
TiDB是A公司自主设计、研发的开源分布式关系型数据库。 |
| Image |
string |
No |
The URL of the service icon. |
http://img.tidb.oss.url |
| Name |
string |
Yes |
The service name. |
TiDB Database |
| LongDescriptionUrl |
string |
No |
The detailed description of the service. |
http://description.tidb.oss.url |
| Agreements |
array<object> |
No |
The information about the service agreements. |
|
|
object |
No |
The information about the service agreements. |
||
| Name |
string |
No |
The name of the agreement. |
Name |
| Url |
string |
No |
The URL of the agreement. |
https://aliyun.com/xxxxxxxx.html |
| Softwares |
array<object> |
No |
The information about the software used in the service. |
|
|
object |
No |
The information about the software used in the service. |
||
| Name |
string |
No |
The software name. |
MySQL |
| Version |
string |
No |
The software version. |
5.7 |
| IsSupportOperated |
boolean |
No |
Specifies whether to enable O&M. Default value: false. Valid values:
Note
This parameter is required when `ServiceType` is set to `private`. |
false |
| PolicyNames |
string |
No |
The policy name. The name of a single policy can be up to 128 characters in length. Separate multiple names with commas (,). Only policies related to O&M parameters are supported. |
policyName1, policyName2 |
| Duration |
integer |
No |
The O&M duration. Unit: seconds. |
0 |
| AlarmMetadata |
string |
No |
The alert configurations for the service. Note
This configuration takes effect only after an alert-related access policy is configured in `PolicyNames`. |
{ "TemplateUrl": "http://template.file.url", // 应用分组级别告警元数据 "ApplicationGroups": [ { "Name": "applicationGroup1", "TemplateUrl": "url1" }, { "Name": "applicationGroup2", "TemplateUrl": "url2" } ] } |
| ShareType |
string |
No |
The sharing type. Valid values:
|
Public |
| ApprovalType |
string |
No |
The approval type for service usage requests. Valid values:
|
Manual |
| VersionName |
string |
No |
The version name. |
Draft |
| UpgradeMetadata |
string |
No |
The upgrade metadata. |
{\"Description\":\"xxx\",\"SupportRollback\":true,\"SupportUpgradeFromVersions\":[],\"UpgradeComponents\":[\"Configuration\"]} |
| TrialDuration |
integer |
No |
The trial duration. Unit: days. The maximum trial duration is 30 days. |
7 |
| Tag |
array<object> |
No |
The custom tags. |
|
|
object |
No |
The custom tags. |
||
| Key |
string |
No |
The tag key. |
Usage |
| Value |
string |
No |
The tag value. |
Web |
| TenantType |
string |
No |
The tenant type. Valid values:
|
SingleTenant |
| LicenseMetadata |
string |
No |
The license metadata. |
{\"RetentionDays\":3} |
| OperationMetadata |
string |
No |
The O&M configuration. |
{\"PrometheusConfigMap\":{\"New_Vpc_Ack_And_Jumpserver\":{}}} |
| ResourceGroupId |
string |
No |
The resource group ID. |
rg-aek25refu7r3opq |
| LogMetadata |
string |
No |
The application log configuration. |
{ "Logstores": \[ { "LogstoreName": "access-log", "LogPath": "/home/admin/app/logs", # This parameter is not required for containers. Configure the parameter in the YAML file. "FilePattern": "access.log\*" # This parameter is not required for containers. Configure the parameter in the YAML file. } ] } |
| SourceServiceId |
string |
No |
The ID of the source service for distribution. |
service-70a3b15bb62643xxxxxx |
| SourceServiceVersion |
string |
No |
The version of the source service for distribution. |
1 |
| Resellable |
boolean |
No |
Specifies whether the service can be distributed. Valid values:
|
false |
| BuildParameters |
string |
No |
The parameters for building the service. |
{ "ServiceTemplateId": "st-xxxxx"} |
| DryRun |
boolean |
No |
Specifies whether to perform a dry run to check the request. |
true |
| ComplianceMetadata |
object |
No |
The compliance check metadata. |
|
| CompliancePacks |
array |
No |
The selected compliance packages. |
|
|
string |
No |
The selected compliance package. Valid value:
|
VpcDataRisk |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Status |
string |
The service status. |
Created |
| RequestId |
string |
The request ID. |
4DB0F536-B3BE-4F0D-BD29-E83FB56D550C |
| Version |
string |
The service version. |
draft |
| ServiceId |
string |
The service ID. |
service-0e6fca6a51a544xxxxxx |
| DryRunResult |
object |
The check result. |
|
| RolePolicy |
object |
The access policy of the deployment role. |
|
| Policy |
string |
The access policy required for the deployment role. |
{ "Statement": [{ "Action": ["oos:CancelExecutions", "oos:DeleteExecutions", "oos:GetTemplate", "oos:ListExecutions", "oos:ListTemplates", "oos:NotifyExecution", "oos:StartExecution"], "Effect": "Allow", "Resource": "*" }, { "Action": ["ram:PassRole"], "Effect": "Allow", "Resource": "*" }, { "Action": ["ros:CreateStack", "ros:GetStack", "ros:UpdateStack", "ros:ListStackEvents", "ros:ListStackResources", "ros:ListStackResources", "ros:DeleteStack", "ram:GetRole"], "Effect": "Allow", "Resource": "*" }], "Version": "1" } |
| MissingPolicy |
array<object> |
The missing access policies for the deployment role. |
|
|
object |
The missing access policies for the deployment role. |
||
| ServiceName |
string |
The service name in the access policy. |
ecs |
| Resource |
string |
The resource in the access policy. |
* |
| Action |
array |
The operations in the access policy. |
|
|
string |
The operations in the access policy. |
CreateStack |
Examples
Success response
JSON format
{
"Status": "Created",
"RequestId": "4DB0F536-B3BE-4F0D-BD29-E83FB56D550C",
"Version": "draft",
"ServiceId": "service-0e6fca6a51a544xxxxxx",
"DryRunResult": {
"RolePolicy": {
"Policy": "{\n\t\"Statement\": [{\n\t\t\"Action\": [\"oos:CancelExecutions\", \"oos:DeleteExecutions\", \"oos:GetTemplate\", \"oos:ListExecutions\", \"oos:ListTemplates\", \"oos:NotifyExecution\", \"oos:StartExecution\"],\n\t\t\"Effect\": \"Allow\",\n\t\t\"Resource\": \"*\"\n\t}, {\n\t\t\"Action\": [\"ram:PassRole\"],\n\t\t\"Effect\": \"Allow\",\n\t\t\"Resource\": \"*\"\n\t}, {\n\t\t\"Action\": [\"ros:CreateStack\", \"ros:GetStack\", \"ros:UpdateStack\", \"ros:ListStackEvents\", \"ros:ListStackResources\", \"ros:ListStackResources\", \"ros:DeleteStack\", \"ram:GetRole\"],\n\t\t\"Effect\": \"Allow\",\n\t\t\"Resource\": \"*\"\n\t}],\n\t\"Version\": \"1\"\n}",
"MissingPolicy": [
{
"ServiceName": "ecs",
"Resource": "*",
"Action": [
"CreateStack"
]
}
]
}
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.