Skip to content

Commit 93de005

Browse files
committed
allow execution of performance definitions
1 parent 78ff703 commit 93de005

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Unreleased
44
**Improvements**
55
- public_model task also defines methods mapped to MAS module steps when publishing to MAS.
66
- SSL verification can be disable with `SSLREQCERT` environment variable.
7+
- Added `execute_performance_task`
78

89
**Changes**
910
- Updated method signature for `create_performance_definition` in Model Manager.

src/sasctl/services/model_management.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,3 +162,23 @@ def create_performance_definition(model,
162162
request['outputVariables'] = [v.get('name') for v in project.get('variables', []) if v.get('role') == 'output']
163163

164164
return post(SERVICE_ROOT + '/performanceTasks', json=request, headers={'Content-Type': 'application/vnd.sas.models.performance.task+json'})
165+
166+
167+
def execute_performance_definition(definition):
168+
"""Launches a job to run a performance definition.
169+
170+
Parameters
171+
----------
172+
definition : str or dict
173+
The id or dictionary representation of a performance definition.
174+
175+
Returns
176+
-------
177+
RestObj
178+
The executing job
179+
180+
"""
181+
definition = get_performance_definition(definition)
182+
183+
return post(SERVICE_ROOT + '/performanceTasks/%s' % definition.id)
184+

0 commit comments

Comments
 (0)