REST API Admin
- Version Introduced:10.0
At 10.1 and later, the REST API administrative endpoint (http://<host>:<port>/<instance>/arcgis/rest/admin) is no longer supported. The administrative tasks previously supported in the REST API Admin are now supported in the ArcGIS Server Admin API.
Also note that at 10.1 and later, ArcGIS Server automatically clears the REST cache when you add, update, or remove services and folders. This eliminates the need for clearing the REST cache manually when a change is made to the services or folders.
If you need to perform administrative tasks that were previously supported in REST API Admin such as Generate Admin Token, Clear REST Cache, and options to enable or disable the Services Directory, use the ArcGIS Server Admin API accessible via the following URL:
The ArcGIS Server Administrator is secured so that only users that have ADMINISTER or PUBLISH privileges have permissions to access the admin.
The REST API caches content pertaining to catalogs, services, maps, models, and so on. For example, resources such as service resource, layer resource, legend resource, geoprocessing task resource, and so on, are cached the first time a resource is accessed. If subsequent requests are made to the same resource, REST will return the response from its cache rather than asking the service to execute the request. For static resources that do not change often, caching such content allows significant performance improvements when working with the REST API.
It is important to note that results from operations are not cached by REST. For example, if a query operation is executed against a map service layer, the response for the query will not be cached in the REST cache. However, browsers may cache the response and use its cache if the same request is repeated from that browser, and the server returns a 304 NOT MODIFIED status in its response or if the CACHE-CONTROL response header MAX-AGE value indicates that the browser can reuse the cache for a stipulated time period.
Prior to 10.1, each time a service or folder was updated, it was required that the REST cache be cleared manually using the clear cache operation. At 10.1 and later, ArcGIS Server automatically clears the cache when you add, update, or remove services and folders. In addition, if you have a multiple machine configuration, the REST cache will be cleared on all machines. If necessary, you can manually clear the REST cache using the following URL:
The Clear Cache Parameters page appears as follows:
You can provide a folder name and/or a service name and service type to clear the cache for a specific folder or a service. Clicking Clear Cache without providing a folder or service name/service type clears the entire REST API cache.
The Services Directory provides an HTML view of the services published using ArcGIS Server. The ArcGIS Server Admin API gives you the ability to enable or disable the REST Services Directory using the following URL:
Disabling the Services Directory is recommended as a best practice for ArcGIS Server systems that are public. You can enable the Service Directory on production systems only if there is a need to make the HTML pages and forms available to the end users. Once disabled, users cannot view and use the services using the Services Directory HTML pages, that is, requests that are made for HTML output format (f=html or when parameter f is not specified). They'll receive an error message if they attempt to access the Services Directory once it has been disabled by the admin. All client applications (web APIs, desktop, mobile, and so on) that programmatically access the services using JSON or other output formats will continue to function as expected.
The Services Directory options page typically appears as shown below. To disable the Services Directory view, click the Edit link and uncheck the Services Directory Enabled check box. or programmatically call the URL http://<host>:<port>/<instance>/admin/system/handlers/rest/servicesdirectory/edit using HTTP POST and set a token obtained for an Administrative user and a parameter servicesDirEnabled to false. In a multiple machine configuration, this will disable the Services Directory on all machines.
When the Services Directory is disabled, the Services Directory options page appears as shown below. To enable the Services Directory, check the Services Directory Enabled check box and click the edit button, or programmatically call the URL http://<host>:<port>/<instance>/admin/system/handlers/rest/servicesdirectory/edit using HTTP POST, and set a token obtained for an Administrative user and a parameter servicesDirEnabled to true. In a multiple-machine configuration, this will enable the Services Directory on all machines.