Closed ajturner closed 3 years ago
This cannot work for a few reasons:
itemid
(unique identifier). If you want to search for something based on any other property (title, tags, owner, etc) you use the search
method. search
method doesn't allow for searching by url since many items don't have a url property. Web Mapping Application
(including DC) which does not filter when you have the default search condition of typekeywords:hubSite
. And if I eliminate that condition, it returns initiatives/apps/maps every item that the title string matches. Not very helpful for the user again.url
parameter to our search
method. So what it does is fetches all sites using portal api and then filters those that have this url string in the url
property of the Site Object. Again, doesn't work for sites of another item-type because the api call fails to include it in the first place.https://opendata.arcgis.com/utilities/domains/<domain>
siteId
, then make rest of calls.This domain lookup should be its own Python method on sites - something like getDomain(string)
and getItemByDomain(string)
and getOrgByDomain(string)
.
These can then be used in search as well as finding a Hub given the Domain URL. We've discussed before that getting the org id or the maps.arcgis.com domain will be unknown for civic devs that only know their Hub domain.
fix added here https://github.com/Esri/hub-py/pull/100
Developers likely won't know the site item id. They should also have the option to get a site by the domain.
These should all work: