Hi - I have been able to add and publish a global scene layer package to ArcGIS online through the 'Add Item' button. When I try to add the same layer package to Portal at 10.7, the 'Add item' method fails (regardless of browser) with a 'cannot write to file' error, even thought the item is clearly visible in Windows Explorer in my D;\arcgisportal\content\items directory.
I am able to add the package from Pro 2.3.3 using the 'share package' tool.
I am able to add the item using the 1.6.1 API item.add method:
import sys, os, arcpy, time, smtplib
from arcpy import env
from arcgis.gis import GIS
arcpy.SetLogHistory(False)
env.configKeyword= "DEFAULTS"
env.overwriteOutput = True
gis = GIS("https://myportal.scgs.net/portal", "myUserName", "myPassword")
slpkPath = r"V:\SarcoBuildingExtract"
thumbPath = r"V:\IconsImages\pdfIcon.png"
slpkExtent = '-82.580256,26.922512,-82.064256,27.438512'
slpkTypes = '[3D,ArcGIS Pro,ArcGIS Server,Scene,Scene Package,slpk]'
pub_params = '[3DObject,ArcGIS Server,Data,Scene Service,Service,Hosted Service]'
try:
for item in os.listdir(slpkPath):
slpkFile = os.path.join(slpkPath, item)
if (item == 'PortalFootprintScene.slpk'):
print (item)
slpkProperties={'type':'Scene Package','typeKeywords':slpkTypes,
'title':'PortalBuildingScenePackage2','snippet':'County Builiding Multipatch Features','description':'County Builiding Multipatch Features','tags': 'Planning', 'extent':slpkExtent}
slpkItem = gis.content.add(item_properties=slpkProperties, data=slpkFile, thumbnail=thumbPath, folder='SceneLayers')
print (slpkProperties)
slpkItem.publish(publish_parameters=pub_params,file_type='scenepackage',build_initial_cache=True)
print ('itemPublihed')
except Exception:
import traceback, sys
tb = sys.exc_info()[2]
e = sys.exc_info()[1]
print(e.args[0])
print ("Line %i" % tb.tb_lineno)
message = message + "\n" + "Line %i" % tb.tb_lineno
message = message + "\n" + str(e)
In either case, whether adding the item from the api or from the share package module in Pro, the Publish fails with the API error: 'Cannot determine service type' even though I am adding the typeKeywords. In either case, Portal should be able to publish the hosted scene layer whether through the api or through the portal Content tab page.