HOW TO
When upgrading from ArcGIS Enterprise 11.x to 12.x, some custom data providers may not automatically re-register if they employ configuration options that are no longer supported in ArcGIS Enterprise 12.0. In that case, the custom data provider code will be archived during the upgrade in the config store and any services that use the unsupported provider will be stopped. To restart those services, a new provider with an identical name to the unsupported provider must been recompiled in the ArcGIS Enterprise 12.x version of the ArcGIS Enterprise SDK and registered with ArcGIS Server. This process involves adapting the older code to align with changes introduced in the new SDK and configuration options.
The general procedure is outlined below in three major steps, but full, in-depth details are provided in the custom data feeds documentation.
The first step is creating a new provider in the ArcGIS Enterprise SDK 12.x custom data feeds command line tool. The new provider will not contain the unsupported `config` module. Rather than relying on this module, the developer will create their own JSON file in the provider project and “require in” this file. The contents of this file will likely be identical to the contents in the former `/config/default.json` file. Reference this JSON file anywhere in your code where you formerly used `require(config)`.
Next, if your custom data provider code uses either `host` or `id` as parameters, these need to be replaced with `serviceParameters`. These parameters are accessed in the provider code the same way as `host` and `id` on the `req.params` object but by the developer’s chosen parameter name instead. To make use of these parameters, objects that include `key`, `label`, and `description` are added to the provider’s `cdconfig.json` file in the `serviceParameters` array as shown in Figure 1. Values for these parameters are added to the service configuration similar to how `host` and `id` values were added in prior releases. Below is an example of 'cdconfig.json' file.
{
"name": "csv-provider",
"arcgisVersion": "12.0.0",
"parentServiceType": "FeatureServer",
"customdataRuntimeVersion": "1",
"type": "provider",
"editingEnabled": false,
"properties": {
"serviceParameters": [
{
"key": "file_name",
"label": "File Name",
"description": "Name of the CSV file."
},
{
"key": "lat_column",
"label": "Latitude column",
"description": "Name of CSV column that specifies latitude."
},
{
"key": "long_column",
"label": "Longitude column",
"description": "Name of CSV column that specifies longitude."
}
]
},
"fileName": "csv-provider.cdpk"
}
Lastly, to restart the stopped service, upload and register the replacement provider of the same name that was associated with the stopped service. (If you are working in a Kubernetes deployment, use the `update` API rather than the `register` API in ArcGIS Enterprise Admin at Home > Services > Types > Customdata Providers > Update Customdata Provider by providing the ID of the newly uploaded .cdpk.) In ArcGIS Enterprise Admin or ArcGIS Server Administrator, update the custom data provider information in the service’s JSON configuration to include any service parameters in the `customDataProviderInfo` object. Below is an example of the service JSON with 'serviceparameters' added.
"jsonProperties": {
"customDataProviderInfo": {
"dataProviderName": "csv-provider",
"serviceParameters": {
"file_name": "RunningShoeStores.csv",
"lat_column": "latitude",
"long_column": "longitude"
}
}
},
Start the service.
Article ID: 000039652
Get help from ArcGIS experts
Start chatting now