GIS Cloud Suite

PUT

URI

http://{server}:{port}/manager/web/api/service/instances

Supported Method

PUT

Parent Resource

service

Introduction

Edit service configuration by API.

Supported Interchange Format: JSON

HTTP Request Method

Execute HTTP request to the URI below. In the URI below, {server} is the server of gateway, replace it by the actual gateway IP. {port} is the port of gateway, replace it by the actual gateway port.

http://{server}:{port}/manager/web/api/service/instances

PUT Request

Edit the service configuration.

The Format of Headers

content-type: application/json
authorization: Bearer {access_token}

Request Params

The necessary parameters to eidt service configuration:

Name Type Explanation
componentName String The name of service component
interfaceName String The name of service interface
serviceXml String The content of the service configuration

Response Structure

Returned the result of the request, made up by the following fields:

Field Type Explanation
isSucceed Boolean The result of the request. Ture means succeed, false means failed.
msg String If the execution failed, the result would return the error information. The result would be empty if succeed.

Response Case

Execute PUT request for http://192.168.17.139:32507/manager/web/api/service/instances, modify the service configuration to editable, input the parameters to edit service configuration:

{
"componentName":"map-China400-d3awywrtby",
"interfaceName":"rest",
"serviceXml":"
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<application>
    <providers>
        <provider class="com.supermap.services.providers.UGCDataProvider" enabled="true" name="Provider-data-China400-nrsvxwjyun">
            <config class="com.supermap.services.providers.UGCDataProviderSetting">
                <datasourceInfos></datasourceInfos>
                <workspacePath>/data/China400.smwu</workspacePath>
                <datasourceNames></datasourceNames>
            </config>
        </provider>
    </providers>
    <components>
        <component class="com.supermap.services.components.impl.DataImpl" enabled="true" interfaceNames="rest" name="data-China400-nrsvxwjyun" providers="Provider-data-China400-nrsvxwjyun">
            <config class="com.supermap.services.components.DataConfig">
                //Allow to edit service configuration
                <editable>true</editable>
            </config>
        </component>
    </components>
    <interfaces>
        <interface class="com.supermap.services.rest.RestServlet" name="rest">
            <config class="com.supermap.services.rest.RestConfig">
                <relationInfos></relationInfos>
                <systemEncoderBeanNames></systemEncoderBeanNames>
                <systemDecoderBeanNames></systemDecoderBeanNames>
                <extensionResourceFinderBeanNames></extensionResourceFinderBeanNames>
                <isDebug>false</isDebug>
                <securityControlEnable>false</securityControlEnable>
                <accessControlAllowOrigin>*</accessControlAllowOrigin>
                <defaultHoldTime>0.0</defaultHoldTime>
            </config>
        </interface>
    </interfaces>
</application>"
}

The returned response in json format:

{
    "isSucceed": true,
    "msg": "
}