- URL:https://[root]/portals/[portalID]/datastores/addToServer(POST only)
- Version Introduced:10.7.1
Example usage
Below is a sample ArcGIS Enterprise POST request for the addToServer operation:
POST /webadaptor/sharing/rest/portals/0123456789ABCDEF/datastores/addToServer HTTP/1.1
Host: machine.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []
datastoreId=55d87f404a7e420bb969ccb70254bfec&serverId=9sQswqEpB31ymiCD&bindToServerDatastore=false&f=pjson
Description
The addToServer operation registers a data store to ArcGIS Server. Before registering a data store, it is recommended that you validate the data store with the given server.
At 10.7.1, if your data store was registered with other federated servers using the same name, and you want the data store item in the portal to be recognized by any of your other federated servers, you can use this operation to bind the data store item to an additional federated server or servers.
Note:
You can only bind the data store item to other federated servers if the data store is already registered with the other federated servers, the registered data store has the same name on all the federated servers, and the data store accesses the same data source location. If the data store was registered with the federated servers using a different name, you must create separate data store items for them.
Request parameters
Parameter | Details |
---|---|
datastoreId (Required) | The itemId of the data store that will be registered with the server. A data store can be registered on multiple servers.
|
serverId (Required) | The server with which the data store will be registered.
|
bindToServerDatastore | Specifies whether to bind the data store item to the federated server. For more information about binding a data store to additional federated servers, see Create a data store item for an existing registered data store. The default value is false. Values: true | false |
f | The response format. The default format is html. Values: html | json | pjson |
JSON Response examples
If the operation is successful, addToServer will return the following success message:
{"success": true}
If the operation fails, addToServer will return an error similar to the following message:
{
"error": {
"code": 400,
"message": "Server registration error",
"details": [
"Add data store to server failed."
]
}
}