You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I was searching for a method on the API to register a Server Object Extension to an ArcGIS Enterprise Server via the /admin/services/types/extensions/register endpoint and noticed that the _register_extension() method is incorrectly attached to the Service class (arcgis.gis.server.admin._services.Service) and not the ServiceManager (arcgis.gis.server.admin._services.ServiceManager) class.
The _register_extension() method calls the /types/extensions/register endpoint from the Service object's _url which does not exist. It should be from the ServiceManager class's _url property instead.
To Reproduce
Steps to reproduce the behavior:
fromarcgisimportGISfromuuidimportuuid4gis=GIS(profile='MyProfile')
# Assuming I have atleast one serverserver=gis.admin.servers.list()[0]
# Use default sample service as exampleservice=server.services.list()
# Create dummy item_iditem_id=str(uuid4())
service._register_extension(item_id)
The method should be attached to arcgis.gis.server.admin._services.ServiceManager()
from arcgis import GIS
gis = GIS(profile='MyProfile')
# Assuming I have atleast one server
server = gis.admin.servers.list()[0]
# The url should be valid
register_url = server.services._url + "/types/extensions/register"
resp = gis._con.get(register_url)
print (resp)
# returns error with POST only method message
resp = gis._con.post(register_url)
print (resp)
# returns 500 error with Required parameter id
error:
The Python json response is below after calling _register_extension
{'status': 'error','messages': ["Could not find resource or operation 'types' on the system."],'code': 404}
Screenshots
Expected behavior
I wanted to register/update a Server Object Extension via the API. I was expecting there was a method in the ServiceManager class to register extensions on the server. Instead, I found _unregister_extension and _update_extension but the _register_extension method was attached to Service incorrectly.
Platform (please complete the following information):
OS: Windows 10
ArcGIS Enterprise 11.1
Python API Version: 2.1.0.2
Additional context
Screenshots are from my IPython session. Inputs are made up - dummy.
The text was updated successfully, but these errors were encountered:
@longdinhgis Thanks for opening this issue but these are private properties and methods and thus are not documented or guaranteed to work as you would expect since these are more likely for internal use.
We recommend you use documented methods and properties for your workflow. If you have a question about this feel free to ask!
Describe the bug
I was searching for a method on the API to register a Server Object Extension to an ArcGIS Enterprise Server via the
/admin/services/types/extensions/register
endpoint and noticed that the_register_extension()
method is incorrectly attached to the Service class (arcgis.gis.server.admin._services.Service
) and not theServiceManager
(arcgis.gis.server.admin._services.ServiceManager
) class.The
_register_extension()
method calls the/types/extensions/register
endpoint from the Service object's_url
which does not exist. It should be from theServiceManager
class's_url
property instead.To Reproduce
Steps to reproduce the behavior:
The method should be attached to
arcgis.gis.server.admin._services.ServiceManager()
error:
The Python json response is below after calling
_register_extension
Screenshots
Expected behavior
I wanted to register/update a Server Object Extension via the API. I was expecting there was a method in the
ServiceManager
class to register extensions on the server. Instead, I found_unregister_extension
and_update_extension
but the_register_extension
method was attached toService
incorrectly.Platform (please complete the following information):
Additional context
Screenshots are from my IPython session. Inputs are made up - dummy.
The text was updated successfully, but these errors were encountered: