doc-exports/docs/modelarts/api-ref/CreateService.html
Wuwan, Qi f81ead2467 ModelArts API 24.3.0 20241128 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Wuwan, Qi <wuwanqi1@noreply.gitea.eco.tsi-dev.otc-service.com>
Co-committed-by: Wuwan, Qi <wuwanqi1@noreply.gitea.eco.tsi-dev.otc-service.com>
2024-11-29 09:04:54 +00:00

940 lines
54 KiB
HTML

<a name="EN-US_TOPIC_0000002079004369"></a><a name="EN-US_TOPIC_0000002079004369"></a>
<h1 class="topictitle1">Deploying Services</h1>
<div><div class="section"><h4 class="sectiontitle">Function</h4><p>This API is used to deploy a model as a service.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000002079004369__atuogenerate_2"><h4 class="sectiontitle">URI</h4><p>POST /v1/{project_id}/services</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path Parameters</caption><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.1"><p>Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.2"><p>Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.3"><p>Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.2.3.2.5.1.4"><p>Description</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p>project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.3.2.5.1.4 "><p>Project ID. For details, see <a href="modelarts_03_0147.html">Obtaining a Project ID and Name</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section"><h4 class="sectiontitle">Request Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002079004369__HeaderParameter" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request header parameters</caption><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.1"><p>Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.2"><p>Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.3"><p>Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.2.2.5.1.4"><p>Description</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p>X-Auth-Token</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p>User token. It can be obtained by calling the IAM API that is used to obtain a user token. The value of <strong>X-Subject-Token</strong> in the response header is the user token.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002079004369__request_DeployServiceRequest" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Request body parameters</caption><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.1"><p>Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.2"><p>Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.3"><p>Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.3.2.5.1.4"><p>Description</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p>workspace_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p>ID of the workspace to which a service belongs. The default value is <strong>0</strong>, indicating the default workspace.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p>schedule</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p>Array of <a href="#EN-US_TOPIC_0000002079004369__request_Schedule">Schedule</a> objects</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p>Service scheduling configuration, which can be configured only for real-time services. By default, this parameter is not used. Services run for a long time.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p>cluster_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p>Dedicated resource pool ID. By default, this parameter is left blank, indicating that dedicated resource pools are not used. When using a dedicated resource pool to deploy services, ensure that the cluster is running properly. After this parameter is configured, the network configuration of the cluster is used, and the <strong>vpc_id</strong> parameter does not take effect. If both this parameter and <strong>cluster_id</strong> in <strong>real-time config</strong> are configured, <strong>cluster_id</strong> in <strong>real-time config</strong> is preferentially used. If a dedicated resource pool is used, either <strong>cluster_id</strong> or <strong>pool_name</strong> must be specified.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p>pool_name</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p>ID of a new-version dedicated resource pool. This parameter is left blank by default, indicating that no dedicated resource pool is used. When using a dedicated resource pool to deploy services, ensure that the cluster is running properly. If both this parameter and <strong>pool_name</strong> in <strong>real-time config</strong> are configured, <strong>pool_name</strong> in <strong>real-time config</strong> is preferentially used. If a dedicated resource pool is used, either <strong>cluster_id</strong> or <strong>pool_name</strong> must be specified.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p>infer_type</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p>Inference mode. The value is real-time/batch.</p>
<ul><li><p>real-time indicates a real-time service. A model is deployed as a web service. Service, which provides online test UI and monitoring capabilities. The service keeps running.</p>
</li><li><p>Batch is a batch service. A batch service can perform inference on batch data and automatically stops after data processing is complete.</p>
</li><li><p>must be created on Intelligent EdgeFabric (IEF) in advance.</p>
</li></ul>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p>vpc_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p>ID of the VPC to which a real-time service instance is deployed. By default, this parameter is left blank. In this case, ModelArts allocates a dedicated VPC to each user, and users are isolated from each other. To access other service components in the VPC of the service instance, set this parameter to the ID of the corresponding VPC. Once a VPC is configured, it cannot be modified. If both <strong>vpc_id</strong> and <strong>cluster_id</strong> are configured, only the dedicated resource pool takes effect.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p>service_name</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p>Service name, which consists of 1 to 64 characters.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p>description</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p>Service remarks. By default, this parameter is left blank. The value contains a maximum of 100 characters and cannot contain!. &lt; &gt; + &amp;"'</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p>security_group_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p>Security group. By default, this parameter is left blank. This parameter is mandatory if <strong>vpc_id</strong> is configured. A security group is a virtual firewall that provides secure network access control policies for service instances. A security group must contain at least one inbound rule to permit the requests whose protocol is TCP, source address is 0.0.0.0/0, and port number is 8080.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p>subnet_network_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p>ID of a subnet. By default, this parameter is left blank. This parameter is mandatory if <strong>vpc_id</strong> is configured. Enter the network ID displayed in the subnet details on the VPC management console. A subnet provides dedicated network resources that are isolated from other networks.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p>config</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p>Array of <a href="#EN-US_TOPIC_0000002079004369__request_ServiceConfig">ServiceConfig</a> objects</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p>Model running configurations. If <strong>infer_type</strong> is <strong>batch</strong>, you can configure only one model. If <strong>infer_type</strong> is <strong>real-time</strong>, you can configure multiple models and assign weights based on service requirements. However, the versions of multiple models must be unique.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p>additional_properties</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p>Map&lt;String,<a href="#EN-US_TOPIC_0000002079004369__request_ServiceAdditionalProperties">ServiceAdditionalProperties</a>&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p>Additional service attribute, which facilitates service management</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000002079004369__request_Schedule"></a><a name="request_Schedule"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002079004369__request_Schedule" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Schedule</caption><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.4.2.5.1.1"><p>Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.4.2.5.1.2"><p>Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.4.2.5.1.3"><p>Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.4.2.5.1.4"><p>Description</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.1 "><p>duration</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.2 "><p>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.3 "><p>Integer</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.4.2.5.1.4 "><p>Value mapping a time unit. For example, if the task stops after two hours, set <strong>time_unit</strong> to <strong>HOURS</strong> and <strong>duration</strong> to <strong>2</strong>.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.1 "><p>time_unit</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.2 "><p>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.4.2.5.1.4 "><p>Scheduling time unit. Possible values are <strong>DAYS</strong>, <strong>HOURS</strong>, and <strong>MINUTES</strong>.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.1 "><p>type</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.2 "><p>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.4.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.4.2.5.1.4 "><p>Scheduling type. Only the value <strong>stop</strong> is supported.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000002079004369__request_ServiceConfig"></a><a name="request_ServiceConfig"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002079004369__request_ServiceConfig" frame="border" border="1" rules="all"><caption><b>Table 5 </b>ServiceConfig</caption><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.5.2.5.1.1"><p>Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.5.2.5.1.2"><p>Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.5.2.5.1.3"><p>Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.5.2.5.1.4"><p>Description</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.1 "><p>custom_spec</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.3 "><p><a href="#EN-US_TOPIC_0000002079004369__request_CustomSpec">CustomSpec</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.5.2.5.1.4 "><p>Custom resource specifications</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.1 "><p>envs</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.3 "><p>Map&lt;String,String&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.5.2.5.1.4 "><p>Common parameter. (Optional) Environment variable key-value pair required for running a model. By default, this parameter is left blank.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.1 "><p>specification</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.2 "><p>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.5.2.5.1.4 "><p>Common parameters Resource specifications. You can obtain the specification list by querying the supported service deployment specifications. In the current version, modelarts.vm.cpu.2u/modelarts.vm.gpu.p4 (needs to be applied for), modelsarts.vm.ai1.a310 (needs to be applied for), and custom (supported only when deployed in a dedicated resource pool) are available. [Submit a service ticket.] (tag: hc, hk) ModelArts O&amp;M engineers add permissions. If this parameter is set to custom, the custom_spec parameter must be specified.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.1 "><p>weight</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.3 "><p>Integer</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.5.2.5.1.4 "><p>This parameter is mandatory for <strong>real-time</strong>. Weight of traffic allocated to a model. This parameter is mandatory only when <strong>infer_type</strong> is set to <strong>real-time</strong>. The sum of all weights must be equal to 100. If multiple model versions are configured with different traffic weights in a real-time service, ModelArts will continuously access the prediction API of the service and forward prediction requests to the model instances of the corresponding versions based on the weights.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.1 "><p>deploy_timeout_in_seconds</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.3 "><p>Integer</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.5.2.5.1.4 "><p>Timeout interval for deploying a single model instance</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.1 "><p>model_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.2 "><p>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.5.2.5.1.4 "><p>Common parameters Model ID. You can obtain the value by calling the API for querying the AI application list.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.1 "><p>src_path</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.5.2.5.1.4 "><p>Mandatory for batch services. OBS path to the input data of a batch job</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.1 "><p>req_uri</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.5.2.5.1.4 "><p>Mandatory for batch services. Inference API called in a batch task, which is the RESTful API exposed in the model image. You must select an API URL from the <strong>config.json</strong> file of the model for inference. If a built-in inference image of ModelArts is used, the API is displayed as <strong>/</strong>.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.1 "><p>mapping_type</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.5.2.5.1.4 "><p>The batch service type is mandatory. Mapping type of the input data. The value can be file or csv.</p>
<ul><li><p>If file is selected, each inference request corresponds to a file in the input data directory. When this mode is used, req_uri corresponding to the model can have only one input parameter and the parameter type is file.</p>
</li><li><p>If csv is selected, each inference request corresponds to a row of data in the CSV file. If this mode is used, the file name extension in the input data directory must be .csv, and the mapping_rule parameter must be configured to indicate the CSV index corresponding to each parameter in the inference request body.</p>
</li></ul>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.1 "><p>cluster_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.5.2.5.1.4 "><p>Optional for real-time services. ID of a dedicated resource pool. This parameter is left blank by default, indicating that no dedicated resource pool is used. When using a dedicated resource pool to deploy services, ensure that the resource pool is running properly. After this parameter is configured, the network configuration of the cluster is used, and the <strong>vpc_id</strong> parameter does not take effect.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.1 "><p>pool_name</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.5.2.5.1.4 "><p>Specifies the ID of the new dedicated resource pool. By default, this parameter is left blank, indicating that the dedicated resource pool is not used. This parameter corresponds to the ID of the new resource pool. When using dedicated resource pool to deploy services, ensure that the cluster status is normal. If pool_name in real-time config and pool_name in real-time config are configured at the same time, pool_name in real-time config is preferred.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.1 "><p>nodes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.3 "><p>Array of strings</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.5.2.5.1.4 "><p>Mandatory for edge services. Edge node ID array. The node ID is the edge node ID on IEF, which can be obtained after the edge node is created on IEF.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.1 "><p>mapping_rule</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.3 "><p>Object</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.5.2.5.1.4 "><p>Optional for batch services. Mapping between input parameters and CSV data. This parameter is mandatory only when <strong>mapping_type</strong> is set to <strong>csv</strong>. The mapping rule is similar to the definition of the input parameters in the <strong>config.json</strong> file. You only need to configure the index parameters under each parameter of the string, number, integer, or boolean type, and specify the value of this parameter to the values of the index parameters in the CSV file to send an inference request. Use commas (,) to separate multiple pieces of CSV data. The values of the index parameters start from <strong>0</strong>. If the value of the index parameter is <strong>-1</strong>, ignore this parameter. For details, see the sample of creating a batch service.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.1 "><p>src_type</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.5.2.5.1.4 "><p>Mandatory for batch services. Data source type, which can be <strong>ManifestFile</strong>. By default, this parameter is left blank, indicating that only files in the <strong>src_path</strong> directory are read. If this parameter is set to <strong>ManifestFile</strong>, <strong>src_path</strong> must be set to a specific manifest path. Multiple data paths can be specified in the manifest file. For details, see the manifest inference specifications.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.1 "><p>dest_path</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.5.2.5.1.4 "><p>Mandatory for batch services. OBS path to the output data of a batch job</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.1 "><p>instance_count</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.2 "><p>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.3 "><p>Integer</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.5.2.5.1.4 "><p>Common parameter. Number of instances deployed for a model. The maximum number of instances is 5. To use more instances, submit a service ticket.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.1 "><p>additional_properties</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.5.2.5.1.3 "><p>Map&lt;String,<a href="#EN-US_TOPIC_0000002079004369__request_ModelAdditionalProperties">ModelAdditionalProperties</a>&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.5.2.5.1.4 "><p>Additional attributes for model deployment, facilitating service instance management</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000002079004369__request_CustomSpec"></a><a name="request_CustomSpec"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002079004369__request_CustomSpec" frame="border" border="1" rules="all"><caption><b>Table 6 </b>CustomSpec</caption><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.6.2.5.1.1"><p>Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.6.2.5.1.2"><p>Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.6.2.5.1.3"><p>Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.6.2.5.1.4"><p>Description</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.6.2.5.1.1 "><p>gpu_p4</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.6.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.6.2.5.1.3 "><p>Float</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.6.2.5.1.4 "><p>Number of GPUs, which can be a decimal. The value cannot be smaller than 0, with the third decimal place is rounded off. This parameter is optional and is not used by default.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.6.2.5.1.1 "><p>memory</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.6.2.5.1.2 "><p>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.6.2.5.1.3 "><p>Integer</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.6.2.5.1.4 "><p>Memory in MB, which must be an integer</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.6.2.5.1.1 "><p>cpu</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.6.2.5.1.2 "><p>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.6.2.5.1.3 "><p>Float</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.6.2.5.1.4 "><p>Number of CPU cores, which can be a decimal. The value cannot be smaller than 0.01, with the third decimal place is rounded off.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.6.2.5.1.1 "><p>ascend_a310</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.6.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.6.2.5.1.3 "><p>Integer</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.6.2.5.1.4 "><p>Number of Ascend chips. This parameter is optional and is not used by default. Either this parameter or <strong>gpu_p4</strong> is configured.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000002079004369__request_ModelAdditionalProperties"></a><a name="request_ModelAdditionalProperties"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002079004369__request_ModelAdditionalProperties" frame="border" border="1" rules="all"><caption><b>Table 7 </b>ModelAdditionalProperties</caption><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.7.2.5.1.1"><p>Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.7.2.5.1.2"><p>Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.7.2.5.1.3"><p>Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.7.2.5.1.4"><p>Description</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.7.2.5.1.1 "><p>log_volume</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.7.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.7.2.5.1.3 "><p>Array of <a href="#EN-US_TOPIC_0000002079004369__request_log_volume">log_volume</a> objects</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.7.2.5.1.4 "><p>Host directory mounting. This parameter takes effect only if a dedicated resource pool is used. If a public resource pool is used to deploy services, this parameter cannot be configured. Otherwise, an error will occur.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.7.2.5.1.1 "><p>max_surge</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.7.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.7.2.5.1.3 "><p>Float</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.7.2.5.1.4 "><p>The value must be greater than 0. If this parameter is not set, the default value 1 is used. If the value is less than 1, it indicates the percentage of instances to be added during the rolling upgrade. If the value is greater than 1, it indicates the maximum number of instances to be added during the rolling upgrade.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.7.2.5.1.1 "><p>max_unavailable</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.7.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.7.2.5.1.3 "><p>Float</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.7.2.5.1.4 "><p>The value must be greater than 0. If this parameter is not set, the default value 0 is used. If the value is less than 1, it indicates the percentage of instances that can be scaled in during the rolling upgrade. If the value is greater than 1, it indicates the number of instances that can be scaled in during the rolling upgrade.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.7.2.5.1.1 "><p>termination_grace_period_seconds</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.7.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.7.2.5.1.3 "><p>Integer</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.7.2.5.1.4 "><p>Graceful stop time of a container</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.7.2.5.1.1 "><p>persistent_volumes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.7.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.7.2.5.1.3 "><p>Array of <a href="#EN-US_TOPIC_0000002079004369__request_persistent_volumes">persistent_volumes</a> objects</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.7.2.5.1.4 "><p>Persistent Storage Mounting Configuration</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000002079004369__request_log_volume"></a><a name="request_log_volume"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002079004369__request_log_volume" frame="border" border="1" rules="all"><caption><b>Table 8 </b>log_volume</caption><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.8.2.5.1.1"><p>Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.8.2.5.1.2"><p>Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.8.2.5.1.3"><p>Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.8.2.5.1.4"><p>Description</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.8.2.5.1.1 "><p>host_path</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.8.2.5.1.2 "><p>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.8.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.8.2.5.1.4 "><p>Log path to be mapped on the host</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.8.2.5.1.1 "><p>mount_path</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.8.2.5.1.2 "><p>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.8.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.8.2.5.1.4 "><p>Path to the logs in the container</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000002079004369__request_persistent_volumes"></a><a name="request_persistent_volumes"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002079004369__request_persistent_volumes" frame="border" border="1" rules="all"><caption><b>Table 9 </b>persistent_volumes</caption><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.9.2.5.1.1"><p>Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.9.2.5.1.2"><p>Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.9.2.5.1.3"><p>Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.9.2.5.1.4"><p>Description</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.9.2.5.1.1 "><p>name</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.9.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.9.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.9.2.5.1.4 "><p>Specifies the name of the storage volume.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.9.2.5.1.1 "><p>mount_path</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.9.2.5.1.2 "><p>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.9.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.9.2.5.1.4 "><p>Mount path of the storage volume in the container.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000002079004369__request_ServiceAdditionalProperties"></a><a name="request_ServiceAdditionalProperties"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002079004369__request_ServiceAdditionalProperties" frame="border" border="1" rules="all"><caption><b>Table 10 </b>ServiceAdditionalProperties</caption><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.10.2.5.1.1"><p>Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.10.2.5.1.2"><p>Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.10.2.5.1.3"><p>Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.10.2.5.1.4"><p>Description</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.10.2.5.1.1 "><p>smn_notification</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.10.2.5.1.2 "><p>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.10.2.5.1.3 "><p>Map&lt;String,<a href="#EN-US_TOPIC_0000002079004369__request_SmnNotification">SmnNotification</a>&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.10.2.5.1.4 "><p>SMN message notification structure, which is used to notify the user of the service status change</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.10.2.5.1.1 "><p>log_report_channels</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.10.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.10.2.5.1.3 "><p>Array of <a href="#EN-US_TOPIC_0000002079004369__request_LogReportPipeline">LogReportPipeline</a> objects</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.10.2.5.1.4 "><p>Log channel group. If this parameter is not specified or the array length is 0, LTS log interconnection is disabled. This function cannot be modified after being enabled.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.10.2.5.1.1 "><p>websocket_upgrade</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.10.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.10.2.5.1.3 "><p>Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.10.2.5.1.4 "><p>Whether the service interface is upgraded to WebSocket. During service deployment, the default value is <strong>false</strong>. During service configuration update, the default value is the value set last time.</p>
<ul><li><p><strong>false</strong>: Do not upgrade to WebSocket.</p>
</li><li><p><strong>true</strong>: Upgrade to WebSocket. This parameter cannot be modified after WebSocket is enabled. WebSocket cannot be enabled together with <strong>Traffic Limit</strong>.</p>
</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000002079004369__request_SmnNotification"></a><a name="request_SmnNotification"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002079004369__request_SmnNotification" frame="border" border="1" rules="all"><caption><b>Table 11 </b>SmnNotification</caption><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.11.2.5.1.1"><p>Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.11.2.5.1.2"><p>Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.11.2.5.1.3"><p>Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.11.2.5.1.4"><p>Description</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.11.2.5.1.1 "><p>topic_urn</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.11.2.5.1.2 "><p>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.11.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.11.2.5.1.4 "><p>URN of an SMN topic</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.11.2.5.1.1 "><p>events</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.11.2.5.1.2 "><p>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.11.2.5.1.3 "><p>Array of integers</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.11.2.5.1.4 "><p>Event ID. Options:</p>
<p><strong>1</strong>: failed <strong>3</strong>: running <strong>7</strong>: concerning <strong>11</strong>: pending</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000002079004369__request_LogReportPipeline"></a><a name="request_LogReportPipeline"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002079004369__request_LogReportPipeline" frame="border" border="1" rules="all"><caption><b>Table 12 </b>LogReportPipeline</caption><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.12.2.5.1.1"><p>Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.12.2.5.1.2"><p>Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.12.2.5.1.3"><p>Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.12.2.5.1.4"><p>Description</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.12.2.5.1.1 "><p>type</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.12.2.5.1.2 "><p>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.12.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.12.2.5.1.4 "><p>Log channel type. Currently, LTS is supported.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.12.2.5.1.1 "><p>configuration</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.12.2.5.1.2 "><p>No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.12.2.5.1.3 "><p><a href="#EN-US_TOPIC_0000002079004369__request_LtsConfiguration">LtsConfiguration</a> object</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.12.2.5.1.4 "><p>LTS Log Configuration</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000002079004369__request_LtsConfiguration"></a><a name="request_LtsConfiguration"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002079004369__request_LtsConfiguration" frame="border" border="1" rules="all"><caption><b>Table 13 </b>LtsConfiguration</caption><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.13.2.5.1.1"><p>Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.13.2.5.1.2"><p>Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.13.2.5.1.3"><p>Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.13.2.5.1.4"><p>Description</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.13.2.5.1.1 "><p>log_group_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.13.2.5.1.2 "><p>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.13.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.13.2.5.1.4 "><p>Specifies the LTS log group ID. The value contains 64 characters.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.13.2.5.1.1 "><p>log_stream_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.13.2.5.1.2 "><p>Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.13.2.5.1.3 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.13.2.5.1.4 "><p>LTS log stream ID. The value contains 64 characters.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section"><h4 class="sectiontitle">Response Parameters</h4><p><strong>Status code: 200</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002079004369__response_DeployServiceResponse" frame="border" border="1" rules="all"><caption><b>Table 14 </b>Response body parameters</caption><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.3.2.4.1.1"><p>Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.3.2.4.1.2"><p>Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="60%" id="mcps1.3.4.3.2.4.1.3"><p>Description</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.1 "><p>service_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.2 "><p>String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.3.2.4.1.3 "><p>Service ID</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.1 "><p>resource_ids</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.2 "><p>Array of strings</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.3.2.4.1.3 "><p>Resource ID array for the resource IDs generated by the target model</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section"><h4 class="sectiontitle">Example Requests</h4><ul><li><p>Sample request of creating a real-time service</p>
<pre class="screen">POST https://{endpoint}/v1/{project_id}/services
{
"infer_type" : "real-time",
"service_name" : "mnist",
"description" : "mnist service",
"config" : [ {
"specification" : "modelarts.vm.cpu.2u",
"weight" : 100,
"model_id" : "0e07b41b-173e-42db-8c16-8e1b44cc0d44",
"instance_count" : 1
} ]
}</pre>
</li><li><p>Sample request of creating a real-time service and configuring multiple versions for traffic distribution</p>
<pre class="screen">POST https://{endpoint}/v1/{project_id}/services
{
"service_name" : "mnist",
"description" : "mnist service",
"infer_type" : "real-time",
"config" : [ {
"model_id" : "xxxmodel-idxxx",
"weight" : "70",
"specification" : "modelarts.vm.cpu.2u",
"instance_count" : 1,
"envs" : {
"model_name" : "mxnet-model-1",
"load_epoch" : "0"
}
}, {
"model_id" : "xxxxxx",
"weight" : "30",
"specification" : "modelarts.vm.cpu.2u",
"instance_count" : 1
} ]
}</pre>
</li><li><p>Sample request of creating a real-time service in a dedicated resource pool with custom specifications</p>
<pre class="screen">POST https://{endpoint}/v1/{project_id}/services
{
"service_name" : "realtime-demo",
"description" : "",
"infer_type" : "real-time",
"cluster_id" : "8abf68a969c3cb3a0169c4acb24b0000",
"config" : [ {
"model_id" : "eb6a4a8c-5713-4a27-b8ed-c7e694499af5",
"weight" : "100",
"cluster_id" : "8abf68a969c3cb3a0169c4acb24b0000",
"specification" : "custom",
"custom_spec" : {
"cpu" : 1.5,
"memory" : 7500,
"gpu_p4" : 0,
"ascend_a310" : 0
},
"instance_count" : 1
} ]
}</pre>
</li><li><p>Sample request of creating a real-time service and configuring it to automatically stop</p>
<pre class="screen">POST https://{endpoint}/v1/{project_id}/services
{
"service_name" : "service-demo",
"description" : "demo",
"infer_type" : "real-time",
"config" : [ {
"model_id" : "xxxmodel-idxxx",
"weight" : "100",
"specification" : "modelarts.vm.cpu.2u",
"instance_count" : 1
} ],
"schedule" : [ {
"type" : "stop",
"time_unit" : "HOURS",
"duration" : 1
} ]
}</pre>
</li><li><p>Sample request of creating a batch service and setting <strong>mapping_type</strong> to <strong>file</strong></p>
<pre class="screen">POST https://{endpoint}/v1/{project_id}/services
{
"service_name" : "batchservicetest",
"description" : "",
"infer_type" : "batch",
"cluster_id" : "8abf68a969c3cb3a0169c4acb24b****",
"config" : [ {
"model_id" : "598b913a-af3e-41ba-a1b5-bf065320f1e2",
"specification" : "modelarts.vm.cpu.2u",
"instance_count" : 1,
"src_path" : "https://infers-data.obs.xxxxx.com/xgboosterdata/",
"dest_path" : "https://infers-data.obs.xxxxx.com/output/",
"req_uri" : "/",
"mapping_type" : "file"
} ]
}</pre>
</li><li><p>Sample request of creating a batch service and setting <strong>mapping_type</strong> to <strong>csv</strong></p>
<pre class="screen">POST https://{endpoint}/v1/{project_id}/services
{
"service_name" : "batchservicetest",
"description" : "",
"infer_type" : "batch",
"config" : [ {
"model_id" : "598b913a-af3e-41ba-a1b5-bf065320f1e2",
"specification" : "modelarts.vm.cpu.2u",
"instance_count" : 1,
"src_path" : "https://infers-data.obs.xxxxx.com/xgboosterdata/",
"dest_path" : "https://infers-data.obs.xxxxx.com/output/",
"req_uri" : "/",
"mapping_type" : "csv",
"mapping_rule" : {
"type" : "object",
"properties" : {
"data" : {
"type" : "object",
"properties" : {
"req_data" : {
"type" : "array",
"items" : [ {
"type" : "object",
"properties" : {
"input5" : {
"type" : "number",
"index" : 0
},
"input4" : {
"type" : "number",
"index" : 1
},
"input3" : {
"type" : "number",
"index" : 2
},
"input2" : {
"type" : "number",
"index" : 3
},
"input1" : {
"type" : "number",
"index" : 4
}
}
} ]
}
}
}
}
}
} ]
}</pre>
</li><li><p>Sample request for creating an edge service</p>
<pre class="screen">POST https://{endpoint}/v1/{project_id}/services
{
"service_name" : "service-edge-demo",
"description" : "",
"infer_type" : "edge",
"config" : [ {
"model_id" : "eb6a4a8c-5713-4a27-b8ed-c7e694499af5",
"specification" : "custom",
"instance_count" : 1,
"custom_spec" : {
"cpu" : 1.5,
"memory" : 7500,
"gpu_p4" : 0,
"ascend_a310" : 0
},
"envs" : { },
"nodes" : [ "2r8c4fb9-t497-40u3-89yf-skui77db0472" ]
} ]
}</pre>
</li></ul>
</div>
<div class="section"><h4 class="sectiontitle">Example Responses</h4><p><strong>Status code: 200</strong></p>
<p>Service deployed</p>
<pre class="screen">{
"service_id" : "10eb0091-887f-4839-9929-cbc884f1e20e",
"resource_ids" : [ "INF-f878991839647358@1598319442708" ]
}</pre>
</div>
<div class="section"><h4 class="sectiontitle">Status Codes</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002079004369__status_code" frame="border" border="1" rules="all"><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.7.2.1.3.1.1"><p>Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="85%" id="mcps1.3.7.2.1.3.1.2"><p>Description</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p>200</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p>Service deployed</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section"><h4 class="sectiontitle">Error Codes</h4><p>See <a href="modelarts_03_0095.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="service_management.html">Service Management</a></div>
</div>
</div>