Change the status of a service

Use the HTTP method PUT and the status query string option to change the status of a service. The PUT method would also update the service if the service definition has changed.

zosConnect-2.0 Applies to zosConnect-2.0.

The status of a service can be either started, or stopped. If the status information is not available from the service provider, the service would be in an unknown status.

HTTP method
PUT
URI
/zosConnect/services/{serviceName}?status=started|stopped

If the service name contains forward slashes, they must be escaped by using %2F. For example, if the service name is MyService/v1, it must be provided as MyService%2Fv1.

Description
Starts or stops the existing service. When a service is stopped, new requests fail but existing requests are allowed to complete. Administration requests to /zosConnect/services/{serviceName} still function normally and the service appears in the list that is returned by the /zosConnect/services request.
Note:
  1. The Service Provider SPI is called by IBM® z/OS® Connect to notify it that these actions were requested. The method names that are in the SPI for these actions are stop(), start(), and status().
  2. IBM z/OS Connect does not persist any state that is related to the service and instead delegates this state to the service provider.
  3. The enhanced administration interface V1.2.0 includes version information for services in the response body.
Security
If the authorization interceptor provided by IBM z/OS Connect is enabled in the service provider, users with Admin or Operations authority can change the status of a service. Users with Invoke or Reader authority cannot. For more information about user authorization, see Overview of IBM z/OS Connect security.
Request body
To change the status of a service, the request body should have no content. If a service archive is in the request body, the request is to update the service and set the initial status after the update. For more information, see Update a service.
Response body
{
    "zosConnect": {
        "serviceName": "<service name>",
        "serviceDescription": "<service description>",
        "serviceProvider": "<service provider>",
        “version”: “<version>”,
        "serviceURL": "<service URL>",
        "serviceInvokeURL": "<service invocation URL>",
        "dataXformProvider": "<data transformation provider>",
        "serviceStatus": "<service status>"
    }
}
Note: In V1.0.0 of the administration interface, setting the service status requires the use of HTTP POST or PUT method with the action=start or action=stop query string, as shown in the following example:
https://myhost:myport/zosConnect/services/myService?action=start|stop
Errors
400 Bad request
Unknown status specified