FRAMES | NO FRAMES | Description | Parameters | Examples | Response |
URL |
http://<datasources-url>/createDatasource
|
---|---|
Parent Resource | Datasources |
The createDatasource operation creates a connection from the SDS instance to a relational database. Datasources are used by feature services to access datasets (layers and tables) within a relational database. Only one datasource per feature service is permitted.
Parameter | Details |
---|---|
f |
Description: The response format. The default
response format is html. Values: html | json | pjson |
name | Description: Required. Descriptive name of the data source. Will be listed in the Datasources resource. |
description |
Description: Optional. More details on
the data source. |
server | Description: Required. The name of the machine on which a relational database is running and the name of the database instance. For SQL Server, the format is <server>\<SQL Server instance name>. |
database | Description: Required for some relational databases. SQL Server instances require a database. |
username | Description: Required if using database authentication. Determines which tables and views are accessible within the database. The user must have read access for query operations on datasets within the database to function. The user must have read\write access for edit operations on datasets within the database to function. |
password | Description: Required if using database authentication. Password for user defined by username. |
useDbAuth |
Description: If Yes (true), the
identity defined in this operation (username/password) are used when connecting
to the database instance. If No (false), the identity of the SDS application is
used. Values: true
| false |
Example 1: Create a datasource with the name "Production Sedona":
http://sampleserver10.arcgisonline.com/arcgis/admin/datasources/createDatasource
Example input (HTML)
Example input (POST body)
name=Production+Sedona& description=SQL+Server+2008+-+production+data& server=sedona%5Csqlexpress2008& database=Demo& username=dbreader& password=pw.read123& useDbAuth=true
{ "success": <true|false>, "error": { "code": <code>, "message": "<description>", "details": [ "<message>" ] } }
{ "success" : true }
{ "error" : { "code" : 400, "message" : "", "details" : [ "Unable to connect to datasource." ] } }