Skip To Content

/createService: Create Service (Relational Catalog Service)

  • URL:https://[root]/content/users/[userName]/createService(POST only)
  • Version Introduced:10.5

Example Usage

URL for Create Service operation


https://services.myserver.com/portal/sharing/rest/content/users/portaladmin/createService   

createParameters= {} //see: Create Parameters JSON object
outputType=relationalCatalogService

Description

The Create Service operation (POST only) allows users to create a relational catalog service on the hosting server.

Note:

This operation is not available for ArcGIS Online, and was added at ArcGIS Enterprise 10.5.

Note:

Create Service is a POST-only operation. With that said, it is still recommended that it be accessed over an SSL connection, as credentials must be passed. Once on the server, any user-defined property named ‘password’ is encrypted before it is stored in the configuration store.

Request Parameters

ParameterDetails
[Common parameters]

For a complete listing, see Common parameters.

createParameters

A JSON object specifying the properties of the newly created service. See the Create Parameters JSON object table (below).

outputType

The newly-created service type.

Value: relationalCatalogService

Example: outputType=relationalCatalogService

Create Parameters JSON object

The createParameters JSON object is described in the table below. All properties are required.

PropertyDetails
name

Name of the service to be created. This name must be unique. If the name already exists, the operation will fail.

provider

"ADS"

connectionProperties

JSON object that describes the properties used to establish a connection with a relational database.

Note:

Each registered relational data store type has slightly different properties.

The following shows an example of the createParameters JSON.

Note that connectionProperties has two properties: relationalDatastoreType and userDefinedProperties.

The relationalDatastoreType refers to the id property of one of the relational data store types registered with the hosting server.

Note that all userDefinedProperties returned from the hosting server that are flagged as required must be specified in the Create Service call. Properties not flagged as required only need to be specified if they help refine the connectionProperties. See Relational Data Store Types.

{  
    "name":"DBConn1",
    "provider":"ADS",
    "connectionProperties":{  
      "relationalDatastoreType":"esri.sqlserver",
      "userDefinedProperties":[  
        {  
          "name":"username",
          "value":"user1"
        },
        {  
          "name":"password",
          "value":"password1"
        },
        {  
          "name":"serverName",
          "value":"dbserver1.esri.com"
        },
        {  
          "name":"databaseName",
          "value":"DB1"
        }
      ]
    }
  }

Response Properties

PropertyDetails
encodedServiceURL

The encoded URL to the hosted service.

itemId

The unique ID for this item.

name

Name of the service item.

serviceItemId

The ID of the new service item.

serviceurl

The URL to the service.

size

The size of the item.

success

Indicates if the operation was successful.

type

The type of service created.

description

The description of the new service item.

tags

The tags used to describe the service item.

snippet

Snippet or summary for the new service item.

JSON Response Syntax

{
  "encodedServiceURL": "",
  "itemId": "",
  "name": "",
  "serviceItemId": "",
  "serviceurl": "",
  "size": -1,
  "success": true | false,
  "type": "",
  "description": "",
  "tags": "",
  "snippet": ""
}

JSON Response Example

{
  "encodedServiceURL": "https://services.myserver.com/server/rest/services/Hosted/SQLServer1/RelationalCatalogServer",
  "itemId": "738972c681674a4c8ed66f5e1b1169b6",
  "name": "SQLServer1",
  "serviceItemId": "738972c681674a4c8ed66f5e1b1169b6",
  "serviceurl": "https://services.myserver.com/server/rest/services/Hosted/SQLServer1/RelationalCatalogServer",
  "size": -1,
  "success": true,
  "type": "Relational Catalog Service",
  "description": "",
  "tags": "",
  "snippet": ""
}