We'd really like to build some automation into our management of ArcGIS Online Hosted Feature Service Metadata, but can't figure out the syntax for referring to these services using the arcpy.metadata.Metadata() module. The documentation suggests that a URI is sufficient, but apparently a URL doesn't qualify:
desc = arcpy.Describe("https://services.arcgis.com/cJ9YHowT8TU7DUyn/ArcGIS/rest/services/FAC_Superfund_Site_Boundaries_EPA_Public/FeatureServer/0")
print(desc.name)
L0Superfund_Site_Boundaries
print(desc.dataType)
FeatureClass
print(desc.dataElementType)
DEFeatureClass
target_metadata = arcpy.metadata.Metadata("https://services.arcgis.com/cJ9YHowT8TU7DUyn/ArcGIS/rest/services/FAC_Superfund_Site_Boundaries_EPA_Public/FeatureServer/0")
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\thultgre\AppData\Local\Programs\ArcGIS\Pro\Resources\ArcPy\arcpy\metadata.py", line 102, in __init__
self._arc_object = arcgisscripting.metadata.Metadata(uri)
RuntimeErrorWe can edit the metadata for these hosted feature services in ArcGIS Pro and use the import/export tools on the toolbar, but we'd really like to use python to manipulate these records as well. What are we missing? Hopefully it's something straightforward.