DiscoveryAPI: in which scope shoudl we create a Scripted REST API to trigger Discovery
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday - last edited 47m ago
Hi ITOM Community,
We are implementing an automation for VM onboarding (virtual machines are created by an external orchestrator). As part of this automation, the orchestrator needs to call ServiceNow to trigger Discovery for the newly created VM(s), so we populate the manual attributes as part of the orchestration.
To achieve this, we plan to build a Scripted REST API endpoint that the orchestrator can invoke, and from that endpoint we would programmatically start a Quick Discovery for the virtual machine IP address.
From the ServiceNow API Reference, it looks like the right approach is to call the DiscoveryAPI (Scoped) methods in the sn_discovery namespace. Specifically, sn_discovery.DiscoveryAPI.discoverIpAddress(ipAddress, application, source) .
Thanks in advance! Cheers!
Is there any recommended / leading practice on whether a Scripted REST API that triggers Discovery should be created:
- in Global scope, or
- in a custom scoped application ?
We want to avoid upgrade issues and follow a stable approach but we also don’t want to run into scope restrictions or cross-scope access issues when calling DiscoveryAPI.
Thanks in advance! Cheers!
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
41m ago
Hi @danielherre
To use the DiscoveryAPI class within a Scripted REST API, you should work in the Global scope
Note: If needed, you can add a cross-scope privilege in ServiceNow when a scoped application needs to read, write, create, delete, or execute scripts on a resource
