Stored Procedures

Overview

Stored procedures can be executed via the script field in Queries. For example, the following code shows a query where the get_mfa_events.js stored procedure is executed:

POST /redrock/query

{  
   "Script":"@/lib/get_mfa_events.js",
   "Args":{  
      "PageNumber":1,
      "PageSize":100000,
      "Limit":100000,
      "SortBy":"",
      "direction":"False",
      "Caching":-1
   }
}

Stored procedures can also be executed via the script field in in the /JobFlow/StartJob endpoint. For example, the following code shows a query where the server_account_access.js stored procedure is executed as a job:

POST /JobFlow/StartJob

{  
   "script":"/lib/jobs/server_account_access.js",
   "args":{  
      "PVID":"98765432-1118-4326-815a-d33abd18da26",
      "Reason":null,
      "AccessType":"Login",
      "RequestedOptions":{  
         "AssignmentType":"window",
         "StartTime":"Fri, 02 Feb 2018 20:11:00 GMT",
         "EndTime":"Fri, 02 Feb 2018 21:11:00 GMT"
      }
   }
}

Parameters

Some stored procedures take in parameters via an args field in the body and others take in parameters inline with the filename.

The following shows an example of passing multiple parameters via the args field:

POST /redrock/query

{  
   "Script":"@/lib/email_report.js",
   "Args":{  
      "SelectQuery": "Select ID from VaultAccount where User = \"Administrator\"",
      "Parameters":
      [
        {
            "Name" : "TestParam0",
            "DisplayValue" : "Test0",
            "Value" : "TestValue0",
        }
      ],
      "To":"[email protected]",
      "Subject": "Test report",
      "ReportFormat": "html",
      "ReportName" : "MyReport"
   }   
}

Note: the args field may also contain parameters for pagination.

The following shows an example of passing the id parameter inline with the filename:

POST /redrock/query

{
    "Script":"@/lib/server/get_activity_for_discoveryprofile.js(id:'b65cef...')"
}

Stored Procedures

The following is a list of available stored procedures.

Stored Procedures Executed through /RedRock/Query

Name

Description

All_roles_with_members

Gets all roles with members.

app_access

Gets app access.

applist

Gets a list of apps.

devices_by_state

Gets devices that are in a specific state.

email_report

Emails a report.

get_account_checkout

Gets account checkout.

get_account_checkout_check

get_accounts_count_check

get_all_user_activity

Gets all user activity.

get_app_launches_last7days

Gets all application launches in the last seven days.

get_applications

Gets all applications.

get_application_inventory

Gets application inventory.

get_app_launches

Gets application launches.

get_app_launches_with_icon

Gets application launches with icon.

get_app_deployment_to_devices

Gets app deployment to devices.

get_application_launch_events

Gets all application launch events.

get_device_activity

Gets all device activity.

get_device_breakdown

Gets the device breakdown.

get_device_enrollments

Gets the device enrollments.

get_favorite_dashboards

Gets favourite dashboards.

get_favorite_reports

Gets favourite reports.

get_mfa_events

Gets all multi-factor authentication events.

get_mfa_success_events

Gets all multi-factor authentication success events.

get_role_apps_check

get_role_apps

Gets role apps.

get_servers_top_activity

Gets the servers that have the most activity.

get_servers_top_checkouts_check

get_servers_top_checkouts

Gets the servers with the most checkouts.

get_servers_type

Get servers by type.

get_superrights

Gets superrights.

get_user_activity

Get all user activity.

get_user_activity_events

Get all user activity events.

get_user_activity_for_admin

Get all user activity for an admin.

get_user_devs

Gets a user's devices.

get_user_roles

Gets all user roles.

get_user_role_names

Gets the names of all user roles.

polsample

get_accounts

Gets accounts.

get_accounts_count_check

Get the members of a role.

get_activity_for_account_check

get_activity_for_account

get_activity_for_collection

Gets activity for a collection.

get_activity_for_collection_check

get_activity_for_database_check

get_activity_for_database

Get activity for a database.

get_activity_for_discoveryprofile

Gets activity for a discovery profile.

get_activity_for_domain_check

get_activity_for_domain

Gets activity for a domain.

get_activity_for_generic_secret_check

get_activity_for_generic_secret

Gets activity for a generic secret.

get_activity_for_mpaccount_check

get_activity_for_mpaccount

Gets activity for an mpaccount.

get_activity_for_server_check

get_activity_for_server

Gets activity for a server.

get_activity_for_servers_check

get_activity_for_servers

Gets activity for servers.

get_activity_for_subscription_check

get_activity_for_subscription

Gets activity for a subscription.

get_logins_for_server_check

get_logins_for_server

Gets logins for a server.

get_servers_count_check

get_servers_count

Gets a server count.

role_member_list

Gets the members of a role.

server_account_access

Requests access to a computer.

server_admin_activity

Gets server admin activity.

server_user_activity

Gets server user activity.

Stored Procedures Executed through /JobFlow/StartJob

Name

Description

cps_assign_computer_role

Assigns a computer role.

job_history

Gets the history of jobs.

Updated about a year ago

Stored Procedures


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.