Hi,
I'm using arcgis api to publish services to different ArcGIS environnements.
This particular case involves a 'Map Image Layer' being published as 'PUBLIC' into the 'HOSTING_SERVER' of my portal.
I obtain my server by listing the servers in my GIS using GIS.admin.servers.list() and then selecting the correct one that matches the name I'm after.
I am creating an sddraft using the method getWebLayerSharingDraft()
I then open the sddraft XML and enrich it with data from another source.
Before stageing my sddraft (creating an sd from the sddraft) I replace the value of the key 'PackageIsPublic' to 'true' (no caps & as string) and 'PackageUnderMyContent', 'PackageUnderMyOrg' & 'PackageShareGroups' to 'false'.
When I publish with server.services.plublish_sd() or with server.publish_sd() : in my portal it shows as private.
I looked into arcpy.server.UploadServiceDefinition() and also the service_config=None parameter from plublish_sd() but neither worked or gave me back comprehensible error messages.
Q: Why do the values of my sddraft not transfer over to my item when I publish it? Am I missing an argument from arcpy.server.StageService() ?
Q: What are the values that CAN go inside the service_config=None parameter from publish_sd?! This information I could not find anywhere!
Q: Am I going at it wrong and should be using item.add() and upload(sd) given that I'm publishing onto Portal + rest?
thanks for getting this far hehe