Currently flc.manager.create_view(...) doesn't seem to publish any tables that are part of the service. Is there a way to do that using the API with some other parameters,etc? I have tried to use view_layers explicitly defining the layer as well but it doesn't seem to make any difference. Ideas?
<SPAN class="keyword token">from</SPAN> arcgis<SPAN class="punctuation token">.</SPAN>gis <SPAN class="keyword token">import</SPAN> GIS
<SPAN class="keyword token">import</SPAN> getpass
password <SPAN class="operator token">=</SPAN> getpass<SPAN class="punctuation token">.</SPAN>getpass<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Enter password: "</SPAN><SPAN class="punctuation token">)</SPAN>
gis <SPAN class="operator token">=</SPAN> GIS<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'organization'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'username'</SPAN><SPAN class="punctuation token">,</SPAN> password<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Connected to: {}\nConnected as: {}"</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN>
gis<SPAN class="punctuation token">.</SPAN>properties<SPAN class="punctuation token">.</SPAN>urlKey <SPAN class="operator token">+</SPAN> <SPAN class="string token">"."</SPAN> <SPAN class="operator token">+</SPAN> gis<SPAN class="punctuation token">.</SPAN>properties<SPAN class="punctuation token">.</SPAN>customBaseUrl<SPAN class="punctuation token">,</SPAN>
gis<SPAN class="punctuation token">.</SPAN>users<SPAN class="punctuation token">.</SPAN>me<SPAN class="punctuation token">.</SPAN>username<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN>
folder_name <SPAN class="operator token">=</SPAN> <SPAN class="string token">'TestFolder'</SPAN>
folder <SPAN class="operator token">=</SPAN> gis<SPAN class="punctuation token">.</SPAN>content<SPAN class="punctuation token">.</SPAN>create_folder<SPAN class="punctuation token">(</SPAN>folder<SPAN class="operator token">=</SPAN>folder_name<SPAN class="punctuation token">)</SPAN>
folder
created_item <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><SPAN class="punctuation token">{</SPAN>
<SPAN class="string token">'title'</SPAN> <SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'Test'</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">'type'</SPAN> <SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'Service Definition'</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">'tags'</SPAN> <SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="string token">'TEST'</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN>
folder <SPAN class="operator token">=</SPAN> folder_name<SPAN class="punctuation token">,</SPAN>
data<SPAN class="operator token">=</SPAN> r<SPAN class="string token">'./data-publish/HSLCityBikes.sd'</SPAN><SPAN class="punctuation token">)</SPAN>
published_service_item <SPAN class="operator token">=</SPAN> created_item<SPAN class="punctuation token">.</SPAN>publish<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
published_service_item<SPAN class="punctuation token">.</SPAN>update<SPAN class="punctuation token">(</SPAN>thumbnail<SPAN class="operator token">=</SPAN><SPAN class="string token">"./data-publish/esriDefaultMarker_189_Green.png"</SPAN><SPAN class="punctuation token">)</SPAN>
published_service_item
<SPAN class="keyword token">from</SPAN> arcgis<SPAN class="punctuation token">.</SPAN>features <SPAN class="keyword token">import</SPAN> FeatureLayerCollection
capabilities <SPAN class="operator token">=</SPAN> <SPAN class="string token">"Query"</SPAN>
title <SPAN class="operator token">=</SPAN> published_service_item<SPAN class="punctuation token">.</SPAN>title <SPAN class="operator token">+</SPAN> <SPAN class="string token">" (ReadOnly)"</SPAN>
flc <SPAN class="operator token">=</SPAN> FeatureLayerCollection<SPAN class="punctuation token">.</SPAN>fromitem<SPAN class="punctuation token">(</SPAN>published_service_item<SPAN class="punctuation token">)</SPAN>
created_view_item <SPAN class="operator token">=</SPAN> flc<SPAN class="punctuation token">.</SPAN>manager<SPAN class="punctuation token">.</SPAN>create_view<SPAN class="punctuation token">(</SPAN>name<SPAN class="operator token">=</SPAN>title<SPAN class="punctuation token">,</SPAN> capabilities <SPAN class="operator token">=</SPAN> capabilities<SPAN class="punctuation token">)</SPAN>
created_view_item<SPAN class="punctuation token">.</SPAN>move<SPAN class="punctuation token">(</SPAN>folder<SPAN class="operator token">=</SPAN>folder_name<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>Original service

Created view
