https://ESRIwebgis.webgistesting.net/server/rest/services'

Get list of folders
In [10]:
hosting_server.content.folders
Out[10]:
['root', 'custom_streets', 'Hosted', 'System', 'Utilities']
Get the contents of each folder
In [7]:
# set current folder as 'root' and get list of services
hosting_server.content.folder='custom_streets'
In [11]:
hosting_server.content.services
Out[11]:
[<FeatureLayerCollection url:"https://ESRIwebgis.webgistesting.net/server/rest/services/custom_streets/set3_Streets/FeatureServer">,
 <MapImageLayer url:"https://ESRIwebgis.webgistesting.net/server/rest/services/custom_streets/set3_Streets/MapServer">]
In [7]:
# set current folder and explore the contents
hosting_server.content.folder='custom_streets'
hosting_server.content.services
Out[7]:
[<FeatureLayerCollection url:"https://ESRIwebgis.webgistesting.net/server/rest/services/custom_streets/set3_Streets/FeatureServer">,
 <MapImageLayer url:"https://ESRIwebgis.webgistesting.net/server/rest/services/custom_streets/set3_Streets/MapServer">]
In [12]:
# find hosted services
hosting_server.content.folder='Hosted'
hosting_server.content.services
Out[12]:
[<FeatureLayerCollection url:"https://ESRIwebgis.webgistesting.net/server/rest/services/Hosted/At_Risk_Infrastructure_2017_03_06_07_05_30/FeatureServer">,
 <FeatureLayerCollection url:"https://ESRIwebgis.webgistesting.net/server/rest/services/Hosted/CA_Fires_facilities/FeatureServer">,
 <FeatureLayerCollection url:"https://ESRIwebgis.webgistesting.net/server/rest/services/Hosted/Emergency_Response_Incidents_NYC_/FeatureServer">,
 <FeatureLayerCollection url:"https://ESRIwebgis.webgistesting.net/server/rest/services/Hosted/Emergency_Response_Incidents_NYC_SV/FeatureServer">,
 <FeatureLayerCollection url:"https://ESRIwebgis.webgistesting.net/server/rest/services/Hosted/Fire_Buffers_2017_03_06_07_05_30/FeatureServer">,
 <MapImageLayer url:"https://ESRIwebgis.webgistesting.net/server/rest/services/Hosted/Hyperspectral_WTL1_del1/MapServer">,
 <FeatureLayerCollection url:"https://ESRIwebgis.webgistesting.net/server/rest/services/Hosted/NYC_BoroughBoundaries_PolygonShapefile2/FeatureServer">,
 <FeatureLayerCollection url:"https://ESRIwebgis.webgistesting.net/server/rest/services/Hosted/NYC_BoroughBoundaries_PolygonShapefile/FeatureServer">,
 <FeatureLayerCollection url:"https://ESRIwebgis.webgistesting.net/server/rest/services/Hosted/NYC_ManhattanCensusTracts_PolygonShapefile/FeatureServer">,
 <FeatureLayerCollection url:"https://ESRIwebgis.webgistesting.net/server/rest/services/Hosted/ports_west_USA/FeatureServer">,
 <FeatureLayerCollection url:"https://ESRIwebgis.webgistesting.net/server/rest/services/Hosted/Reconstructed_Tracks_MO1UC2/FeatureServer">,
 <FeatureLayerCollection url:"https://ESRIwebgis.webgistesting.net/server/rest/services/Hosted/SS_Emergency_Response_Incidents_NYC_/FeatureServer">]
In [12]:
# find system and utility services
folder_list = ['System','Utilities']

for f in folder_list:
    hosting_server.content.folder=f
    service_list = hosting_server.content.services
    for serv in service_list:
        print(serv.url)
https://ESRIwebgis.webgistesting.net/server/rest/services/System/CachingControllers/GPServer
https://ESRIwebgis.webgistesting.net/server/rest/services/System/CachingToolsEx/GPServer
https://ESRIwebgis.webgistesting.net/server/rest/services/System/CachingTools/GPServer
https://ESRIwebgis.webgistesting.net/server/rest/services/System/DynamicMappingHost/MapServer
https://ESRIwebgis.webgistesting.net/server/rest/services/System/PublishingToolsEx/GPServer
https://ESRIwebgis.webgistesting.net/server/rest/services/System/PublishingTools/GPServer
https://ESRIwebgis.webgistesting.net/server/rest/services/System/ReportingTools/GPServer
https://ESRIwebgis.webgistesting.net/server/rest/services/System/SceneCachingControllers/GPServer
https://ESRIwebgis.webgistesting.net/server/rest/services/System/SceneCachingTools/GPServer
https://ESRIwebgis.webgistesting.net/server/rest/services/System/SpatialAnalysisTools/GPServer
https://ESRIwebgis.webgistesting.net/server/rest/services/System/SyncTools/GPServer
https://ESRIwebgis.webgistesting.net/server/rest/services/Utilities/GeocodingTools/GPServer
https://ESRIwebgis.webgistesting.net/server/rest/services/Utilities/PrintingTools/GPServer

Inspect users & roles

In [13]:
hosting_server.users.get_primary_site_administrator
Out[13]:
{'disabled': False}
In [14]:
hosting_server.users.get_user_roles('admin')
Out[14]:
{'hasMore': False, 'roles': ['org_admin']}
In [ ]:
hosting_server.users.add_user('Sunday','1sunday23','sunday monday','from code','email@company.com')