- URL:
- https://<root>/services/types/customrasterfunctions/register
- Methods:
POST- Version Introduced:
- 11.5
Description
The register operation registers a custom raster function with an organization. This operation requires uploading a .zip file that contains at least one Python file (.py) and the raster function template file (either a rft.xml or a 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. As well, 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 Raster Function endpoints. 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 that has the same name as an already registered raster function. If the organization has a number of deployed custom raster functions, it is recommended to first perform the Find operation to determine if a raster function of the same name has already been registered.
Request parameters
| Parameter | Details |
|---|---|
(Required) | A |
(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. |
Example usage
The following is a sample POST request for the register operation:
POST /<context>/services/types/customrasterfunctions/regiter 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="token"
ZSQdguIKc3G6kJGm2WlvAaBmCO9yvdtebnd9KP5zbP5_dQlCSJ1jejEdlYPn4IborV1gO2_0aqSe-7dy9D7pEDWFphiO22yGMUNPSEvX61vy6VZrBxjZ7pDB8MLkD3U9YYR5rR4TjN1WM6qJubaBHAozC8WaA9nchSMtREnfNet5xfqhyzruScNNYuz37JyJbhjCSq9T7azYgQpiDfCUupTFVN9O-XY66PtEOtlRDpMDq13BSqRRgvg6-kI7uLwQ
------boundary