URL:
https://<root>/services/types/customrasterfunctions/register
Methods:
POST
Version Introduced:
12.2

Access requirements

Required privileges

The Server Administrator API requires privilege-based access. An administrator must be assigned a specific user privilege, or role, to access any given endpoint. Listed below are the user privileges or roles an administrator can be assigned that provides access to this endpoint. If multiple privileges are listed, only one needs to be assigned to gain access.



Note that administrators assigned a custom role must also have the administrative View all content privilege assigned to them to access the API directory as an administrator.

Tokens

This API requires token-based authentication. A token is automatically generated for administrators who sign in to the ArcGIS Server Administrator API directory's HTML interface. Tokens generated in this way are stored for the entirety of the session.

Those accessing the API directory outside of the HTML interface will need to acquire a session token from the ArcGIS Server Administrator API generateToken operation. For security reasons, all POST requests made to the ArcGIS Server Administrator API must include a token in the request body.


Learn how to generate a token

Description

The register operation registers a custom raster function with the server. This operation requires uploading a .zip file that contains at least one Python file (.py) and the raster function template file (either an rft.xml or rft.json file format). While the .zip file may only contain one raster function template, multiple Python files can be included in the .zip file. If multiple Python files are included in the .zip file, only the main Python file needs to be referenced in the raster function template. In addition, the main Python file and the raster function template file must have the same name.

When registered successfully, a raster function portal item is created. The item ID is the same as the raster function ID returned by the Custom Raster Functions and Custom Raster Function resources. The name of the portal item will be the same as the name of the raster function template.

This operation will fail if a developer attempts to upload and register a raster function template with the same name as an already registered raster function. If the server has many deployed custom raster functions, it is recommended to first perform the Find operation to determine if a raster function with the same name has already been registered.

Request parameters

ParameterDetails

customRasterFunctionZipFile

(Required)

A .zip file containing at least one Python file and the raster function template with a file format of either rft.xml or rft.json. If multiple Python files are included in the .zip file, only the main Python file needs to be referenced in the raster function template. In addition, the main Python file and the raster function template must have the same name.

description

(Optional)

A user-provided description of the raster function. If a description is provided, it becomes the item description for the raster function portal item.

f

(Optional)

The response format. The default format is html.

Values: html | json | pjson

Example usage

The following is a sample POST request for the register operation:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
POST /<context>/admin/services/types/customrasterfunctions/register HTTP/1.1
Host: organization.example.com
Content-Type: multipart/form-data; boundary=------boundary


------boundary
Content-Disposition: form-data; name="customRasterFunctionZipFile"; filename=""
Content-Type: application/octet-stream

HeatIndex.zip
------boundary
Content-Disposition: form-data; name="description"

This function computes heat index information.
------boundary
Content-Disposition: form-data; name="f"

json
------boundary
Content-Disposition: form-data; name="token"

<ACCESS_TOKEN>
------boundary--

JSON Response example

Use dark colors for code blocksCopy
1
2
3
{
  "status": "success"
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.