删除

Description 说明

object service.delete(array serviceIds)

This method allows to delete services. 此方法允许删除服务。

Services with hard-dependent child services cannot be deleted. 与子级服务有硬依赖关系的服务无法被删除。

Parameters 参数

(array) IDs of the services to delete. (array)要删除的服务ID。

Return values 返回值

(object) Returns an object containing the IDs of the deleted services under the serviceids property. (object)返回一个对象,该对象包含在serviceids属性中被删除服务的ID。

Examples

Deleting multiple services 删除多个服务

Delete two services. 删除两个服务。

Request 请求:

{
           "jsonrpc": "2.0",
           "method": "service.delete",
           "params": [
               "4",
               "5"
           ],
           "auth": "3a57200802b24cda67c4e4010b50c065",
           "id": 1
       }

Response 响应:

{
           "jsonrpc": "2.0",
           "result": {
               "serviceids": [
                   "4",
                   "5"
               ]
           },
           "id": 1
       }

Source 源码

CService::delete() in frontends/php/include/classes/api/services/CService.php. CService::delete()方法可在frontends/php/include/classes/api/services/CService.php中参考。