- URL:
- https://<adminservicecatalog-url>/services/<serviceName>/FeatureServer/<layerId>/addToDefinition
- Methods:
POST
Description
The add operation supports adding a definition property in a hosted feature service layer. The result of this operation is a response indicating success or a response indicating failure with an error code and description.
The parameter allows the creator to add a definition property to a hosted feature service layer.
Parameters
| Parameter | Details |
|---|---|
add | The add parameter supports adding a definition property in a hosted feature service layer. |
async | Supports options for asynchronous processing. The default format is Values: |
f | The response format. The default response format is Values: |
Example usage
The examples below are some of the definition properties that can be added to a hosted feature layer.
https://services.myserver.com/OrgID/ArcGIS/rest/admin/services/example/FeatureServer/0/addToDefinition- Example one: Add fields to a feature service layer
- Example two: Add indexes to a feature service layer
- Example three: Add a non-clustered columnstore index
Example one: Add fields to a feature service layer
Below is a sample JSON object for the add parameter that demonstrates how to add fields to a feature service layer:
{
"fields": [
{
"name": "GlobalID", 50/1
"type": "esriFieldTypeGlobalID",
"alias": "GlobalID",
"nullable": false,
"editable": false
},
{
"name": "date1",
"type": "esriFieldTypeDate",
"alias": "date1",
"nullable": true,
"editable": false,
"domain": null,
"defaultValue": "GetDate() WITH VALUES"
},
{
"name": "str2",
"type": "esriFieldTypeString",
"alias": "str2",
"nullable": true,
"editable": true,
"domain": null,
"defaultValue": "'A' WITH VALUES"
}
]
}Example two: Add indexes to a feature service layer
Below is a sample JSON object for the add parameter that demonstrates how to add indexes to a feature service layer:
{
"indexes": [
{
"name": "index1",
"fields": "GlobalID, date1",
"isUnique": false,
"isAscending": false,
"description": "index1"
},
{
"name": "index2",
"fields": "date1",
"isUnique": false,
"isAscending": false,
"description": "index2"
}
]
}Example three: Add a non-clustered columnstore index
A non-clustered columnstore index help to improve the speed and efficiency of data retrieval. They act like a table of contents or catalog for large datasets, allowing you to quickly locate specific information. A columnstore index is a column oriented index structure optimized for very large analytical data.
| Parameter | Details |
|---|---|
name (Optional) | The name of the columnstore index. If the name isn't defined, the system will create a name for it. The user can find the name in the layer's properties. |
fields (Required) | The list of fields to be in the columnstore index. |
description (Required) | The description of the index. |
index (Required) | The value of the index type. Values: |
Below is a sample JSON syntex of a non-clustered columnstore index:
{
"indexes" : [
{
"name" : "<name of the columnstore index",
"fields": "<field1,field2,field3,...>",
"description": "Description of the index",
"indexType": "ColumnStore"
}
]
}Below is a sample JSON object that demonstrates how to add a non-clustered columnstore index:
{
"indexes" : [
{
"name" : "IXC__ALLWEAR",
"fields": "Qty,InvoiceDat,Customer,SalesAmtHo,GlobalID,Creator",
"description": "it's a non-clustered ColumnStore",
"indexType": "ColumnStore"
}
]
}JSON non-clustered columnstore index response examples
When add non-clustered columnstore index succeeds: The URL is available to a 'addToDefinition' job endpoint.
{
"statusURL" : "https://services.myserver.com/myorgID/ArcGIS/rest/admin/services/serviceName/FeatureServer/0/addToDefinition/JobID"
}This example is the response when add non-clustered columnstore index succeeds.
{"submissionTime":1758310905350,"lastUpdatedTime":1758310905937,"status":"Completed"}This example is the response when add non-clustered columnstore index fails.
{"submissionTime":1758311440693,"lastUpdatedTime":1758311441010,"status":"Failed","error":{"code":500,"description":"Editing definition error - Parcels "}}Add to definition JSON response examples
This example is the Add to definition JSON Response syntax
{
"success": <true|false>,
"error": {
"code": <code>,
"message": "<description>",
"details": [
"<message>"
]
}
}This example is the response when add succeeds.
{
"success": true
}This example is the response when add fails:
{
"error": {
"code": 400,
"message": "",
"details": [
"Unable to add feature service layer definition."
]
}
}