Wallaroo MLOps API Essentials Guide: Assays V2 Management
Wallaroo provides the ability to monitor the input and outputs of models to detect model drift by using model insights. Changes in the inputs or model predictions that fall outside of expected norms, known as data drift, can occur due to errors in the data processing pipeline or due to changes in the environment such as user preference or behavior.
Monitoring tasks called assays provides model insights by comparing a model’s predictions or the input data coming into the model against an established baseline. Changes in the distribution of this data can be an indication of model drift, or of a change in the environment that the model trained for. This can provide tips on whether a model needs to be retrained or the environment data analyzed for accuracy or other needs.
Model Insights provides interactive assays to explore data from a pipeline and learn how the data is behaving. With this information and the knowledge of your particular business use case you can then choose appropriate settings to launch an assay to run on a given frequency as more data is collected.
This tutorial and the assets are available as part of the Wallaroo Tutorials repository.
Wallaroo MLOps API Assay V2 Management Tutorial
This tutorial focuses on using the Wallaroo MLOps API for assay management and other minor commands. For this tutorial, we will be using the Wallaroo SDK to provide authentication credentials for ease of use examples. See the Wallaroo API Guide for full details on using the Wallaroo MLOps API.
References
The following references are available for more information about Wallaroo and the Wallaroo MLOps API:
- Wallaroo Documentation Site: The Wallaroo Documentation Site.
- Wallaroo MLOps API Documentation from a Wallaroo instance: A Swagger UI based documentation is available from your Wallaroo instance at
https://{Wallaroo Domain}/v1/api/docs
. For example, if the Wallaroo Domain isexample.wallaroo.ai
, the Wallaroo MLOps API Documentation is athttps://example.wallaroo.ai/v1/api/docs
. Note the.
is part of the prefix.
IMPORTANT NOTE: The Wallaroo MLOps API is provided as an early access features. Future iterations may adjust the methods and returns to provide a better user experience. Please refer to this guide for updates.
Prerequisites
- An installed Wallaroo instance.
- The following Python libraries installed:
requests
json
wallaroo
: The Wallaroo SDK. Included with the Wallaroo JupyterHub service by default.
Connection Steps
Import Libraries
For these examples, we will rely on the wallaroo
SDK and requests
library for making connections to our sample Wallaroo Ops instance.
pyarrow
is the Apache Arrow library used for data schemas in Wallaroo, while base64
is used to convert data schemas to base64 format for model uploads.
Import Libraries
For the examples, the Python requests
library will be used to make the REST HTTP(S) connections.
import wallaroo
import requests
import json
import pandas as pd
import datetime
import time
Connect to the Wallaroo Instance
The next step is to connect to Wallaroo through the Wallaroo client. The Python library is included in the Wallaroo install and available through the Jupyter Hub interface provided with your Wallaroo environment.
This is accomplished using the wallaroo.Client()
command, which provides a URL to grant the SDK permission to your specific Wallaroo environment. When displayed, enter the URL into a browser and confirm permissions. Store the connection into a variable that can be referenced later.
If logging into the Wallaroo instance through the internal JupyterHub service, use wl = wallaroo.Client()
. For more information on Wallaroo Client settings, see the Client Connection guide.
# Login through local Wallaroo instance
wl = wallaroo.Client()
Retrieve API Service URL
The Wallaroo SDK provides the API endpoint through the wallaroo.client.api_endpoint
variable. This is derived from the Wallaroo OPs DNS settings.
The method wallaroo.client.auth.auth_header()
retrieves the HTTP authorization headers for the API connection.
Both of these are used to authenticate for the Wallaroo MLOps API calls used in the future examples.
- References
display(wl.api_endpoint)
display(wl.auth.auth_header())
'http://api-lb:8080'
{'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJoVUcyQ1puTTZpa0EtQlNRVFNsVkJnaEd0dk45QXItN0g2R3NLcHlrY0ZjIn0.eyJleHAiOjE3NDQzMTk0NDIsImlhdCI6MTc0NDMxMjI0MiwiYXV0aF90aW1lIjoxNzQ0MzExODYwLCJqdGkiOiI3NTkzZTViMi0wYWQwLTQxMTgtODhjYy0xZjAxYTAzOGE1NzgiLCJpc3MiOiJodHRwczovL2F1dG9zY2FsZS11YXQtZ2NwLndhbGxhcm9vLmRldi9hdXRoL3JlYWxtcy9tYXN0ZXIiLCJhdWQiOlsibWFzdGVyLXJlYWxtIiwiYWNjb3VudCJdLCJzdWIiOiI3ZDYwMzg1OC04OGUwLTQ3MmUtOGY3MS1lNDEwOTRhZmQ3ZWMiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJzZGstY2xpZW50Iiwic2Vzc2lvbl9zdGF0ZSI6IjE0NWMxZWIwLWJhMzUtNDI3Mi1hODcxLTVkMGMxYzk1NzI0OCIsImFjciI6IjAiLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsiY3JlYXRlLXJlYWxtIiwiZGVmYXVsdC1yb2xlcy1tYXN0ZXIiLCJvZmZsaW5lX2FjY2VzcyIsImFkbWluIiwidW1hX2F1dGhvcml6YXRpb24iXX0sInJlc291cmNlX2FjY2VzcyI6eyJtYXN0ZXItcmVhbG0iOnsicm9sZXMiOlsidmlldy1pZGVudGl0eS1wcm92aWRlcnMiLCJ2aWV3LXJlYWxtIiwibWFuYWdlLWlkZW50aXR5LXByb3ZpZGVycyIsImltcGVyc29uYXRpb24iLCJjcmVhdGUtY2xpZW50IiwibWFuYWdlLXVzZXJzIiwicXVlcnktcmVhbG1zIiwidmlldy1hdXRob3JpemF0aW9uIiwicXVlcnktY2xpZW50cyIsInF1ZXJ5LXVzZXJzIiwibWFuYWdlLWV2ZW50cyIsIm1hbmFnZS1yZWFsbSIsInZpZXctZXZlbnRzIiwidmlldy11c2VycyIsInZpZXctY2xpZW50cyIsIm1hbmFnZS1hdXRob3JpemF0aW9uIiwibWFuYWdlLWNsaWVudHMiLCJxdWVyeS1ncm91cHMiXX0sImFjY291bnQiOnsicm9sZXMiOlsibWFuYWdlLWFjY291bnQiLCJtYW5hZ2UtYWNjb3VudC1saW5rcyIsInZpZXctcHJvZmlsZSJdfX0sInNjb3BlIjoiZW1haWwgb3BlbmlkIHByb2ZpbGUiLCJzaWQiOiIxNDVjMWViMC1iYTM1LTQyNzItYTg3MS01ZDBjMWM5NTcyNDgiLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsImh0dHBzOi8vaGFzdXJhLmlvL2p3dC9jbGFpbXMiOnsieC1oYXN1cmEtdXNlci1pZCI6IjdkNjAzODU4LTg4ZTAtNDcyZS04ZjcxLWU0MTA5NGFmZDdlYyIsIngtaGFzdXJhLXVzZXItZW1haWwiOiJqb2huLmh1bW1lbEB3YWxsYXJvby5haSIsIngtaGFzdXJhLWRlZmF1bHQtcm9sZSI6ImFkbWluX3VzZXIiLCJ4LWhhc3VyYS1hbGxvd2VkLXJvbGVzIjpbInVzZXIiLCJhZG1pbl91c2VyIl0sIngtaGFzdXJhLXVzZXItZ3JvdXBzIjoie30ifSwibmFtZSI6IkpvaG4gSGFuc2FyaWNrIiwicHJlZmVycmVkX3VzZXJuYW1lIjoiam9obi5odW1tZWxAd2FsbGFyb28uYWkiLCJnaXZlbl9uYW1lIjoiSm9obiIsImZhbWlseV9uYW1lIjoiSGFuc2FyaWNrIiwiZW1haWwiOiJqb2huLmh1bW1lbEB3YWxsYXJvby5haSJ9.kIhF1OsDM90GAhtyX0eyeUzycyGqmJGxuAWvzSFNk63o3nAGj_vf6_H3xdtnVKpKHoU6BP6DAaAh-4hG9wFnT2WNld64EzwpvdUpCPqQ4iRn6yiEKBZQ-U7oIgC585W_b2mOK3NE3IGwdKZaQmVZktvessuUAINTdaW2DaurUb1zWrp-WtLp-68HMBhXlU1qJrojOzqPM16Lygp1wgTXwN9wEUgh2nJ_XGIAmGqLx070WaCZsBtdgBEuaPqWQ1CYozGcCxr4ggmTY4UIlb5eydUvHWao2v193zXkcyAcYiTBX0TaoORuE51IrcU_Pi-5yu95PQpByaakD2u8UcizKw'}
Enablement Management
Enablement Management allows users to see what Wallaroo features have been activated.
List Enablement Features
Lists the enablement features for the Wallaroo instance.
List Enablement Features Parameters
An empty set {}
List Enablement Features Returns
Field | Type | Description |
---|---|---|
features | String | Enabled features. |
name | String | Name of the Wallaroo instance. |
is_auth_enabled | Boolean | Whether authentication is enabled. |
# List enablement features
# Retrieve the token
headers = wl.auth.auth_header()
endpoint = f"{wl.api_endpoint}/v1/api/features/list"
data = {
}
response = requests.post(endpoint, json=data, headers=headers, verify=True).json()
response
{'features': {'plateau': 'true'},
'name': 'Wallaroo Dev',
'is_auth_enabled': True}
!curl {wl.api_endpoint}/v1/api/features/list \
-H "Authorization: {wl.auth.auth_header()['Authorization']}" \
-H "Content-Type: application/json" \
--data '{{}}'
{"features":{"plateau":"true"},"name":"Wallaroo Dev","is_auth_enabled":true}
Assays
IMPORTANT NOTE
Wallaroo provides two versions of Wallaroo Assays:
The following guide is based on Assays V2. The endpoints demonstrated below provide sample parameters and returns. For full details, see the Wallaroo MLOps API Reference Guide.
Get List of Assays
- Endpoint:
/v2/api/assays/get
Get List of Assays Parameters
Field | Type | Description |
---|---|---|
active | String (Required) | The status of assays to return. Values include:
|
pipeline_name | String (Optional) | The name of the pipeline the assay is associated with. |
workspace_id | Integer (Optional) | The numerical id of the workspace the assay is associated with. |
Get List of Assays Returns
Returns a List of assays with the following parameters.
Field | Type | Description |
---|---|---|
id | String | The id of the assay in UUID format. |
name | Dict | The scheduling runs including the first run, run frequency, etc. |
baseline | Dict | The assay baseline data. |
window | Dict | The assay window. |
summarizer | Dict | The assay summarizer details including the bin mode, aggregation, etc. |
targeting | Dict | The assay targets including the pipeline id, workspace name and id, etc. |
iopath | Dict | The iopath details for the assay, specifying whether to monitor inputs or outputs, which field to monitor, etc. |
created_at | String($date-time) | String showing the returned date and time the assay was created. |
updated_at | String($date-time) | String showing the returned date and time the assay was updated. |
active | Boolean | Whether the assay is active or not. |
The following demonstrates retrieving a list of active assays via requests, then curl.
headers = wl.auth.auth_header()
endpoint = f"{wl.api_endpoint}/v2/api/assays/get"
data = {'active': 'ActiveOnly'}
# display(data)
response = requests.post(endpoint, json=data, headers=headers, verify=True)
# display only one record
display(response.json()[0])
# store for next example
assay_id = response.json()[0]['id']
{'id': '1af7b34b-ef0a-42cf-a821-758c92215d01',
'name': "assay baseline from csv ''",
'scheduling': {'first_run': '2025-03-19T10:37:00-06:00',
'end': None,
'run_frequency': {'SimpleRunFrequency': {'unit': 'Minute', 'quantity': 1}}},
'baseline': {'Summary': {'out.Model_Confidence_Level': {'name': "assay baseline from csv ''",
'bins': {'mode': {'Quantile': 5},
'edges': [0.388652376,
0.5923209300000001,
0.78850774,
0.895255028,
'INFINITY'],
'labels': ['< 20%', '20% - 40%', '40% - 60%', '60% - 80%', '> 80%']},
'aggregated_values': [0.2, 0.2, 0.2, 0.2, 0.2],
'aggregation': 'Density',
'statistics': {'count': 100,
'min': 0.3479154,
'max': 0.9972307,
'mean': 0.7354536938095237,
'median': 0.779883915,
'std': 0.1851688980561408},
'start': None,
'end': None}}},
'window': {'width': {'seconds': 60}},
'summarizer': {'UnivariateContinuous': {'bin_mode': {'Quantile': 5},
'aggregation': 'Density',
'metric': 'PSI',
'bin_weights': None}},
'targeting': {'data_origin': {'pipeline_name': 'rum-assay-nan-jcw',
'pipeline_id': 777,
'workspace_name': 'realpage-rum-assays-jcw',
'workspace_id': 1529,
'model_id': 'rum-ma-nan-values-jcw',
'locations': None},
'iopath': [{'field': 'out.Model_Confidence_Level',
'indexes': None,
'thresholds': {'warning': 0.1, 'alert': 0.1}}]},
'created_at': '2025-03-19T16:37:12.229442Z',
'updated_at': '2025-03-19T16:37:12.229442Z',
'active': True}
!curl {wl.api_endpoint}/v2/api/assays/get \
-H "Authorization: {wl.auth.auth_header()['Authorization']}" \
-H "Content-Type: application/json" \
--data '{json.dumps(data)}' > curl_assay_list.json
f = open('curl_assay_list.json')
# returns JSON object as
# a dictionary
curl_assay_list = json.load(f)
curl_assay_list[0]
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 25289 100 25265 100 24 700k 681 --:--:-- --:--:-- --:--:-- 705k
{'id': '1af7b34b-ef0a-42cf-a821-758c92215d01',
'name': "assay baseline from csv ''",
'scheduling': {'first_run': '2025-03-19T10:37:00-06:00',
'end': None,
'run_frequency': {'SimpleRunFrequency': {'unit': 'Minute', 'quantity': 1}}},
'baseline': {'Summary': {'out.Model_Confidence_Level': {'name': "assay baseline from csv ''",
'bins': {'mode': {'Quantile': 5},
'edges': [0.388652376,
0.5923209300000001,
0.78850774,
0.895255028,
'INFINITY'],
'labels': ['< 20%', '20% - 40%', '40% - 60%', '60% - 80%', '> 80%']},
'aggregated_values': [0.2, 0.2, 0.2, 0.2, 0.2],
'aggregation': 'Density',
'statistics': {'count': 100,
'min': 0.3479154,
'max': 0.9972307,
'mean': 0.7354536938095237,
'median': 0.779883915,
'std': 0.1851688980561408},
'start': None,
'end': None}}},
'window': {'width': {'seconds': 60}},
'summarizer': {'UnivariateContinuous': {'bin_mode': {'Quantile': 5},
'aggregation': 'Density',
'metric': 'PSI',
'bin_weights': None}},
'targeting': {'data_origin': {'pipeline_name': 'rum-assay-nan-jcw',
'pipeline_id': 777,
'workspace_name': 'realpage-rum-assays-jcw',
'workspace_id': 1529,
'model_id': 'rum-ma-nan-values-jcw',
'locations': None},
'iopath': [{'field': 'out.Model_Confidence_Level',
'indexes': None,
'thresholds': {'warning': 0.1, 'alert': 0.1}}]},
'created_at': '2025-03-19T16:37:12.229442Z',
'updated_at': '2025-03-19T16:37:12.229442Z',
'active': True}
Get Assay by Id
Retrieves a specific assay based on the supplied id
field.
- Endpoint: /v2/api/assays/get/:id`
Get Assay by Id Parameters
Field | Type | Description |
---|---|---|
id | String (Required) | The status of assays to return. Values include:
|
pipeline_name | String (Optional) | The name of the pipeline the assay is associated with. |
workspace_id | Integer (Optional) | The numerical id of the workspace the assay is associated with. |
Get Assay by Id Returns
Field | Type | Description |
---|---|---|
id | String | The id of the assay in UUID format. |
name | Dict | The scheduling runs including the first run, run frequency, etc. |
baseline | Dict | The assay baseline data. |
window | Dict | The assay window. |
summarizer | Dict | The assay summarizer details including the bin mode, aggregation, etc. |
targeting | Dict | The assay targets including the pipeline id, workspace name and id, etc. |
iopath | Dict | The iopath details for the assay, specifying whether to monitor inputs or outputs, which field to monitor, etc. |
created_at | String($date-time) | String showing the returned date and time the assay was created. |
updated_at | String($date-time) | String showing the returned date and time the assay was updated. |
active | Boolean | Whether the assay is active or not. |
The following demonstrates retrieving a specific assay from our previous list assays request.
headers = wl.auth.auth_header()
endpoint = f"{wl.api_endpoint}/v2/api/assays/get/:id"
data = {'id': assay_id}
# display(data)
response = requests.post(endpoint, json=data, headers=headers, verify=True)
# display only one record
display(response.json())
{'id': '1af7b34b-ef0a-42cf-a821-758c92215d01',
'name': "assay baseline from csv ''",
'scheduling': {'first_run': '2025-03-19T10:37:00-06:00',
'end': None,
'run_frequency': {'SimpleRunFrequency': {'unit': 'Minute', 'quantity': 1}}},
'baseline': {'Summary': {'out.Model_Confidence_Level': {'name': "assay baseline from csv ''",
'bins': {'mode': {'Quantile': 5},
'edges': [0.388652376,
0.5923209300000001,
0.78850774,
0.895255028,
'INFINITY'],
'labels': ['< 20%', '20% - 40%', '40% - 60%', '60% - 80%', '> 80%']},
'aggregated_values': [0.2, 0.2, 0.2, 0.2, 0.2],
'aggregation': 'Density',
'statistics': {'count': 100,
'min': 0.3479154,
'max': 0.9972307,
'mean': 0.7354536938095237,
'median': 0.779883915,
'std': 0.1851688980561408},
'start': None,
'end': None}}},
'window': {'width': {'seconds': 60}},
'summarizer': {'UnivariateContinuous': {'bin_mode': {'Quantile': 5},
'aggregation': 'Density',
'metric': 'PSI',
'bin_weights': None}},
'targeting': {'data_origin': {'pipeline_name': 'rum-assay-nan-jcw',
'pipeline_id': 777,
'workspace_name': 'realpage-rum-assays-jcw',
'workspace_id': 1529,
'model_id': 'rum-ma-nan-values-jcw',
'locations': None},
'iopath': [{'field': 'out.Model_Confidence_Level',
'indexes': None,
'thresholds': {'warning': 0.1, 'alert': 0.1}}]},
'created_at': '2025-03-19T16:37:12.229442Z',
'updated_at': '2025-03-19T16:37:12.229442Z',
'active': True}
!curl {wl.api_endpoint}/v2/api/assays/get/:id \
-H "Authorization: {wl.auth.auth_header()['Authorization']}" \
-H "Content-Type: application/json" \
--data '{json.dumps(data)}'
{"id":"1af7b34b-ef0a-42cf-a821-758c92215d01","name":"assay baseline from csv ''","scheduling":{"first_run":"2025-03-19T10:37:00-06:00","end":null,"run_frequency":{"SimpleRunFrequency":{"unit":"Minute","quantity":1}}},"baseline":{"Summary":{"out.Model_Confidence_Level":{"name":"assay baseline from csv ''","bins":{"mode":{"Quantile":5},"edges":[0.388652376,0.5923209300000001,0.78850774,0.895255028,"INFINITY"],"labels":["< 20%","20% - 40%","40% - 60%","60% - 80%","> 80%"]},"aggregated_values":[0.2,0.2,0.2,0.2,0.2],"aggregation":"Density","statistics":{"count":100,"min":0.3479154,"max":0.9972307,"mean":0.7354536938095237,"median":0.779883915,"std":0.1851688980561408},"start":null,"end":null}}},"window":{"width":{"seconds":60}},"summarizer":{"UnivariateContinuous":{"bin_mode":{"Quantile":5},"aggregation":"Density","metric":"PSI","bin_weights":null}},"targeting":{"data_origin":{"pipeline_name":"rum-assay-nan-jcw","pipeline_id":777,"workspace_name":"realpage-rum-assays-jcw","workspace_id":1529,"model_id":"rum-ma-nan-values-jcw","locations":null},"iopath":[{"field":"out.Model_Confidence_Level","indexes":null,"thresholds":{"warning":0.1,"alert":0.1}}]},"created_at":"2025-03-19T16:37:12.229442Z","updated_at":"2025-03-19T16:37:12.229442Z","active":true}
Get Assay Results
Retrieves the results from an uploaded assay.
- Endpoint: /v2/api/assays/get_results
Get Assay Results Parameters
Field | Type | Description |
---|---|---|
id | String (Required) | The id of the assay in UUID format. |
workspace_id | Integer (Optional) | The id the workspace the assay is associated with. |
start | String($date-time) (Optional) | The start date of to pull assay results from. |
end | String($date-time) (Optional) | The end date of to pull assay results from. |
Get Assay Results Returns
A List of assay analysis results with the following fields.
Field | Type | Description |
---|
| id | Integer | The id of the assay analysis. |
| assay_id | String | The id of the assay in UUID format. |
| analyzed_at | String($date-time) | The date and time the analysis took place. |
| elapsed_millis | Integer | Number of milliseconds to complete the analysis. |
| scores | Dict | The scores from the assay analysis. |
| status | String | The status of the analysis: Alert
, Warning
, or OK
. |
| summaries | Dict | The analysis summarie including the bins, binning mode, etc. |
| window_end | String($date-time) | The analysis window end date and time. |
| window_start | String($date-time) | The analysis window start date and time. |
| created_at | String($date-time) | The date and time the assay was created. |
| updated_at | String($date-time) | The date and time the assay was updated. |
| workspace_id | Integer | The numerical id of the workspace the assay is associated with. |
| workspace_name | String | The name of the workspace the assay is associated with. |
| pipeline_id | Integer | The identifier of the pipeline the assay is associated with. |
| warning_threshold | Float | The warning threshold for the assay. |
| alert_threshold | | Float | The alert threshold for the assay. |
The following demonstrates retrieving an assay result and showing the first analysis via requests and curl.
headers = wl.auth.auth_header()
endpoint = f"{wl.api_endpoint}/v2/api/assays/get_results"
data = {'id': assay_id}
# display(data)
response = requests.post(endpoint, json=data, headers=headers, verify=True)
# display only one record
display(response.json()[0])
{'id': 2440953,
'assay_id': '1af7b34b-ef0a-42cf-a821-758c92215d01',
'analyzed_at': '2025-03-19T16:44:02.168798Z',
'elapsed_millis': 322,
'scores': {'out.Model_Confidence_Level': {'score': 4.1648763041561505,
'scores': [1.2875503299472804,
0.7193314935522176,
0.7193314935522176,
0.7193314935522176,
0.7193314935522176],
'bin_index': None}},
'status': 'Alert',
'summaries': {'out.Model_Confidence_Level': {'name': 'out.Model_Confidence_Level',
'bins': {'mode': {'Quantile': 5},
'edges': [0.388652376,
0.5923209300000001,
0.78850774,
0.895255028,
'INFINITY'],
'labels': ['< 20%', '20% - 40%', '40% - 60%', '60% - 80%', '> 80%']},
'aggregated_values': [1.0, 0.0, 0.0, 0.0, 0.0],
'aggregation': 'Density',
'statistics': {'count': 256,
'min': 0.0,
'max': 0.0,
'mean': 0.0,
'median': 0.0,
'std': 0.0},
'start': '2025-03-19T16:43:00Z',
'end': '2025-03-19T16:44:00Z'}},
'window_end': '2025-03-19T16:44:00Z',
'window_start': '2025-03-19T16:43:00Z',
'created_at': '2025-03-19T16:44:02.16068Z',
'updated_at': '2025-03-19T16:44:02.493836Z',
'workspace_id': 1529,
'workspace_name': 'realpage-rum-assays-jcw',
'pipeline_id': 777,
'warning_threshold': 0.1,
'alert_threshold': 0.1}
!curl {wl.api_endpoint}/v2/api/assays/get_results \
-H "Authorization: {wl.auth.auth_header()['Authorization']}" \
-H "Content-Type: application/json" \
--data '{json.dumps(data)}' > curl_assay_results.json
f = open('curl_assay_results.json')
# returns JSON object as
# a dictionary
curl_assay_list = json.load(f)
curl_assay_list[0]
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 8269 100 8223 100 46 4749 26 0:00:01 0:00:01 --:--:-- 4774
{'id': 2440953,
'assay_id': '1af7b34b-ef0a-42cf-a821-758c92215d01',
'analyzed_at': '2025-03-19T16:44:02.168798Z',
'elapsed_millis': 322,
'scores': {'out.Model_Confidence_Level': {'score': 4.1648763041561505,
'scores': [1.2875503299472804,
0.7193314935522176,
0.7193314935522176,
0.7193314935522176,
0.7193314935522176],
'bin_index': None}},
'status': 'Alert',
'summaries': {'out.Model_Confidence_Level': {'name': 'out.Model_Confidence_Level',
'bins': {'mode': {'Quantile': 5},
'edges': [0.388652376,
0.5923209300000001,
0.78850774,
0.895255028,
'INFINITY'],
'labels': ['< 20%', '20% - 40%', '40% - 60%', '60% - 80%', '> 80%']},
'aggregated_values': [1.0, 0.0, 0.0, 0.0, 0.0],
'aggregation': 'Density',
'statistics': {'count': 256,
'min': 0.0,
'max': 0.0,
'mean': 0.0,
'median': 0.0,
'std': 0.0},
'start': '2025-03-19T16:43:00Z',
'end': '2025-03-19T16:44:00Z'}},
'window_end': '2025-03-19T16:44:00Z',
'window_start': '2025-03-19T16:43:00Z',
'created_at': '2025-03-19T16:44:02.16068Z',
'updated_at': '2025-03-19T16:44:02.493836Z',
'workspace_id': 1529,
'workspace_name': 'realpage-rum-assays-jcw',
'pipeline_id': 777,
'warning_threshold': 0.1,
'alert_threshold': 0.1}
Get Next Assay Run
Gets the next and last run for the specified assay.
- Endpoint:
/v2/api/assays/get_next_run
Get Next Assay Run Parameters
Field | Type | Description |
---|---|---|
assay_id | String (Required) | The id of the assay in UUID format. |
Get Next Assay Run Returns
Field | Type | Description |
---|---|---|
last_run | String($date-time) | The assay’s last run. |
next_run | String($date-time) | The assay’s next scheduled run. |
The following demonstrates requesting the last and next run for an assay via requests and curl.
headers = wl.auth.auth_header()
endpoint = f"{wl.api_endpoint}/v2/api/assays/get_next_run"
data = {'assay_id': assay_id}
# display(data)
response = requests.post(endpoint, json=data, headers=headers, verify=True)
display(response.json())
{'last_run': '2025-04-10T19:37:00Z', 'next_run': '2025-04-10T19:38:00Z'}
!curl {wl.api_endpoint}/v2/api/assays/get_next_run \
-H "Authorization: {wl.auth.auth_header()['Authorization']}" \
-H "Content-Type: application/json" \
--data '{json.dumps(data)}'
{"last_run":"2025-04-10T19:37:00Z","next_run":"2025-04-10T19:38:00Z"}
Set Assay Active Status
Set Assay Active Status Parameters
Field | Type | Description |
---|---|---|
assay_id | String (Required) | The id of the assay in UUID format. |
active | Boolean (Required) | The status to set the assay active status. |
Set Assay Active Status Returns
If successful, null
is returned.
The following shows an assay active status set to False, then True via requests and curl.
headers = wl.auth.auth_header()
endpoint = f"{wl.api_endpoint}/v2/api/assays/set_active"
# turn assay off
data_off = {
'active': False,
'assay_id': assay_id
}
# display(data)
response = requests.post(endpoint, json=data, headers=headers, verify=True)
display(response)
# turn assay on
data_on = {
'active': True,
'assay_id': assay_id
}
# display(data)
response = requests.post(endpoint, json=data_on, headers=headers, verify=True)
display(response.json())
# turn assay off
!curl {wl.api_endpoint}/v2/api/assays/set_active \
-H "Authorization: {wl.auth.auth_header()['Authorization']}" \
-H "Content-Type: application/json" \
--data '{json.dumps(data_off)}'
null
# turn assay on
!curl {wl.api_endpoint}/v2/api/assays/set_active \
-H "Authorization: {wl.auth.auth_header()['Authorization']}" \
-H "Content-Type: application/json" \
--data '{json.dumps(data_on)}'
null