Delete service API

This API deletes a service running on zCX or Linux® on IBM® Z.

HTTP method and URI path

DELETE /v3/services/{service_id}

Where:

service_id (required) is the ID of the service. You can get it from the response of the Get services API.

Standard headers

Use the following standard HTTP header with this request:
  • Content-Type: application/json
  • Authorization: <Bearer token>

Required authorizations

The user ID associated with the token which is specified in the request header needs to be granted with the following role:
  • sysadm

Query parameter

Table 1. Query parameter for the delete service API

In this table, the Parameter column lists the query parameters, the Type column lists the data type for the parameter, and the Description column provides a brief description of the parameter.

Parameter

Type

Description

deleteData

String

Optionally specify service data preservation on host (Default is true): DELETE /v3/services/{service_id}?deleteData=false

Expected response

On completion, the service returns an HTTP response, which includes a status code that indicates whether your request is completed. Status code 200 indicates a successful completion.

Asynchronous operations

Deleting a service will launch an asynchronous operation to clean up service assets on host.

HTTP status codes

Table 2. Response from HTTP status codes

In this table, the HTTP status code column and Error response columns list the returned fields, and the Description column provides a brief description of the field.

HTTP status code

Error response

Description

401

ALNC810E

Unauthorized to make request

403

ALNC403E

Forbidden (sysadm role required)

404

ALNC916E

Service ID not found