0

Suppose i have xyz service, and which applications(web map, web app builder, arcgis online) uses this service.

xyz=http://aaa.bbbbb.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task 

How do I get list of application name or id uses xyz service using ArcGIS API for Python?

I tried in online, didn't find enough information.

1

Based on the sample Notebook: Identify Items That Use Insecure URLs, the answer is yes, you can use the Python API to look through apps to determine their URLs.

You'll write your code like:

  • Make connection to the GIS (ArcGIS Online or your local portal)
  • Do a search of the Org to identify all apps (webmaps, web appbuilder, whatever)
  • Look through each item to discover if they have any URLs that match the URL you care about.

From the above link, pay particularly close attention to the following function. When you do a search using the API you get back a bunch of "Items". An Item may have url property. This is not what you want. That URL is the URL to the item in the Portal. You want URLs inside the app. This function is showing how you get_data() of an app, and that data (which is just JSON that defines how an app is constructed) needs to be searched to find the URL.

def test_https_in_app(app_item):
    """Takes in an `Item` class instance of any 'App' Item.
    Will call `.get_data()` on the Item, and will search through
    EVERY value nested inside the data dict, sorting each URL
    found to either `https_urls` or `http_urls`, returning the 
    tuple of (https_urls, http_url)
    """
    https_urls = []
    http_urls = []
    all_values = get_values_recurs(app_item.get_data())
    for value in all_values:
        if is_https(value):
            https_urls.append(value)
        elif is_http(value):
            http_urls.append(value)
    return (https_urls, http_urls)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.