I followed this post to create a service and add layers using the rest API https://community.esri.com/t5/arcgis-geoevent-server-questions/create-a-feature-class-in-spatiotempo...
It works when I create a service with createService and the try to add a layer using addToDefinition but I cannot use our naming convention. All our assets in portal and server start with numbers 00_ through 09_, and this works fine, i.e 00_some_service
When I add new service called 00_test it creates it fine, but when I try to add a layer with
/server/rest/admin/services/Hosted/00_test/FeatureServer/addToDefinition?f=pjson
I get an error. How can I fix it so the rest server accepts my request with this naming?
I do not start my name with those character such as the error message is saying.
{
"error": {
"code": 500,
"message": "Failed to create the template for the data source 'method [PUT], host [https://SDSSRV01D.DEMOCRATIZINGDATA.NET:9220], URI [/_index_template/esri-ds-data_3aeaccea-51fe-2302-e7ed-f4c74689df92_os-2-3-0_template], status line [HTTP/1.1 400 Bad Request]\n{\"error\":{\"root_cause\":[{\"type\":\"invalid_alias_name_exception\",\"reason\":\"Invalid alias name [__test1_testlayer]: must not start with '_', '-', or '+'\"}],\"type\":\"invalid_alias_name_exception\",\"reason\":\"Invalid alias name [__test1_testlayer]: must not start with '_', '-', or '+'\"},\"status\":400}'. Error: {1}",
"details": []
}
}
Whenever the name starts with a number I get this error, but the point is that it's been working on all other parts of the system, so I need to get it work here too.