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:
<SPAN class="keyword token">import</SPAN> sys<SPAN class="punctuation token">,</SPAN> os<SPAN class="punctuation token">,</SPAN> arcpy<SPAN class="punctuation token">,</SPAN> time<SPAN class="punctuation token">,</SPAN> smtplib
<SPAN class="keyword token">from</SPAN> arcpy <SPAN class="keyword token">import</SPAN> env
<SPAN class="keyword token">from</SPAN> arcgis<SPAN class="punctuation token">.</SPAN>gis <SPAN class="keyword token">import</SPAN> GIS
arcpy<SPAN class="punctuation token">.</SPAN>SetLogHistory<SPAN class="punctuation token">(</SPAN><SPAN class="token boolean">False</SPAN><SPAN class="punctuation token">)</SPAN>
env<SPAN class="punctuation token">.</SPAN>configKeyword<SPAN class="operator token">=</SPAN> <SPAN class="string token">"DEFAULTS"</SPAN>
env<SPAN class="punctuation token">.</SPAN>overwriteOutput <SPAN class="operator token">=</SPAN> <SPAN class="token boolean">True</SPAN>
gis <SPAN class="operator token">=</SPAN> GIS<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"https://myportal.scgs.net/portal"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"myUserName"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"myPassword"</SPAN><SPAN class="punctuation token">)</SPAN>
slpkPath <SPAN class="operator token">=</SPAN> r<SPAN class="string token">"V:\SarcoBuildingExtract"</SPAN>
thumbPath <SPAN class="operator token">=</SPAN> r<SPAN class="string token">"V:\IconsImages\pdfIcon.png"</SPAN>
slpkExtent <SPAN class="operator token">=</SPAN> <SPAN class="string token">'-82.580256,26.922512,-82.064256,27.438512'</SPAN>
slpkTypes <SPAN class="operator token">=</SPAN> <SPAN class="string token">'[3D,ArcGIS Pro,ArcGIS Server,Scene,Scene Package,slpk]'</SPAN>
pub_params <SPAN class="operator token">=</SPAN> <SPAN class="string token">'[3DObject,ArcGIS Server,Data,Scene Service,Service,Hosted Service]'</SPAN>
<SPAN class="keyword token">try</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">for</SPAN> item <SPAN class="keyword token">in</SPAN> os<SPAN class="punctuation token">.</SPAN>listdir<SPAN class="punctuation token">(</SPAN>slpkPath<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
slpkFile <SPAN class="operator token">=</SPAN> os<SPAN class="punctuation token">.</SPAN>path<SPAN class="punctuation token">.</SPAN>join<SPAN class="punctuation token">(</SPAN>slpkPath<SPAN class="punctuation token">,</SPAN> item<SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token">#print (item)</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>item <SPAN class="operator token">==</SPAN> <SPAN class="string token">'PortalFootprintScene.slpk'</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">print</SPAN> <SPAN class="punctuation token">(</SPAN>item<SPAN class="punctuation token">)</SPAN>
slpkProperties<SPAN class="operator token">=</SPAN><SPAN class="punctuation token">{</SPAN><SPAN class="string token">'type'</SPAN><SPAN class="punctuation token">:</SPAN><SPAN class="string token">'Scene Package'</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">'typeKeywords'</SPAN><SPAN class="punctuation token">:</SPAN>slpkTypes<SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">'title'</SPAN><SPAN class="punctuation token">:</SPAN><SPAN class="string token">'PortalBuildingScenePackage2'</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">'snippet'</SPAN><SPAN class="punctuation token">:</SPAN><SPAN class="string token">'County Builiding Multipatch Features'</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">'description'</SPAN><SPAN class="punctuation token">:</SPAN><SPAN class="string token">'County Builiding Multipatch Features'</SPAN><SPAN class="punctuation token">,</SPAN><SPAN class="string token">'tags'</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'Planning'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'extent'</SPAN><SPAN class="punctuation token">:</SPAN>slpkExtent<SPAN class="punctuation token">}</SPAN>
slpkItem <SPAN class="operator token">=</SPAN> gis<SPAN class="punctuation token">.</SPAN>content<SPAN class="punctuation token">.</SPAN>add<SPAN class="punctuation token">(</SPAN>item_properties<SPAN class="operator token">=</SPAN>slpkProperties<SPAN class="punctuation token">,</SPAN> data<SPAN class="operator token">=</SPAN>slpkFile<SPAN class="punctuation token">,</SPAN> thumbnail<SPAN class="operator token">=</SPAN>thumbPath<SPAN class="punctuation token">,</SPAN> folder<SPAN class="operator token">=</SPAN><SPAN class="string token">'SceneLayers'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN> <SPAN class="punctuation token">(</SPAN>slpkProperties<SPAN class="punctuation token">)</SPAN>
slpkItem<SPAN class="punctuation token">.</SPAN>publish<SPAN class="punctuation token">(</SPAN>publish_parameters<SPAN class="operator token">=</SPAN>pub_params<SPAN class="punctuation token">,</SPAN>file_type<SPAN class="operator token">=</SPAN><SPAN class="string token">'scenepackage'</SPAN><SPAN class="punctuation token">,</SPAN>build_initial_cache<SPAN class="operator token">=</SPAN><SPAN class="token boolean">True</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="string token">'itemPublihed'</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">except</SPAN> Exception<SPAN class="punctuation token">:</SPAN>
<SPAN class="comment token"># If an error occurred, print line number and error message</SPAN>
<SPAN class="keyword token">import</SPAN> traceback<SPAN class="punctuation token">,</SPAN> sys
tb <SPAN class="operator token">=</SPAN> sys<SPAN class="punctuation token">.</SPAN>exc_info<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">2</SPAN><SPAN class="punctuation token">]</SPAN>
e <SPAN class="operator token">=</SPAN> sys<SPAN class="punctuation token">.</SPAN>exc_info<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">]</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN>e<SPAN class="punctuation token">.</SPAN>args<SPAN class="punctuation token">[</SPAN><SPAN class="number token">0</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Line %i"</SPAN> <SPAN class="operator token">%</SPAN> tb<SPAN class="punctuation token">.</SPAN>tb_lineno<SPAN class="punctuation token">)</SPAN>
message <SPAN class="operator token">=</SPAN> message <SPAN class="operator token">+</SPAN> <SPAN class="string token">"\n"</SPAN> <SPAN class="operator token">+</SPAN> <SPAN class="string token">"Line %i"</SPAN> <SPAN class="operator token">%</SPAN> tb<SPAN class="punctuation token">.</SPAN>tb_lineno
message <SPAN class="operator token">=</SPAN> message <SPAN class="operator token">+</SPAN> <SPAN class="string token">"\n"</SPAN> <SPAN class="operator token">+</SPAN> str<SPAN class="punctuation token">(</SPAN>e<SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>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.