How to automatically update image services without using ArcGISPro and Map?

711
4
08-04-2021 07:12 AM
RehanChaudhary
Occasional Contributor

I have published an image service to ArcGIS Portal by creating a service definition file through a python script and without using any of desktop solutions from ESRI such as ArcGIS Pro. NOW i want to be able to update this same service with the new raster dataset without having to republish the service. Is there a possibility through Python scripting or API that i can do that?

I saw there are some operations within the API for updating raster of a service but i am not sure if that would work. Any suggestions! 

0 Kudos
4 Replies
JeffK
by MVP Regular Contributor
MVP Regular Contributor

Take a look at using UploadServiceDefinition_server  to update your service.

0 Kudos
RehanChaudhary
Occasional Contributor

@JeffK thanks for hinting out to Upload Service Definition. So, i intend to overwrite the raster data shown by the service as soon as i have new data available locally. My question would be should i create a sd file each time new raster data is available and then overwrite the existing service with "upload service definition server".

Also which parameter should be used from "Upload Service Definition" for overwriting the data itself a because from the documentation it seems that we can modify only the properties of the service.
Currently i am using the "CreateImageSddraft" for creating draft file and copying the data to server.

0 Kudos
mody_buchbinder
Occasional Contributor

Hi Rehan

If you published a Mosaic dataset by reference you do not need to republish if you just add or remove rasters from the mosaic. It just like adding records to a layer - no need to republish.

You might need to stop/start or overwrite if the new rasters expend the boundary.

Have Fun

0 Kudos
RehanChaudhary
Occasional Contributor

@mody_buchbinder i am publishing as a web layer and not a mosaic dataset. I am using the Publish Web layer option and then "Copy Data to Server" option rather than referencing. i dont want to use mosaics as i have only one raster data that is going to be updated from time to time with new data so i just want to overwrite it. i don't want to display all the records old and new which is the case in mosaics. just the recent one by overwriting the layer but without arcgispro or arcmap

0 Kudos