Skip to content
This repository was archived by the owner on Aug 11, 2020. It is now read-only.

Commit 4c15dd9

Browse files
committed
add jobs machineType method
1 parent 73512fd commit 4c15dd9

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

paperspace/jobs.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def method(category, method, params):
5858
ignore_files = params.pop('ignoreFiles', [])
5959

6060
if method in ['artifactsGet', 'artifactsList', 'getJob', 'getJobs',
61-
'getLogs']:
61+
'getLogs', 'getClusterAvailableMachineTypes']:
6262

6363
http_method = 'GET'
6464
path = '/' + category + '/' + method
@@ -151,6 +151,10 @@ def destroy(params):
151151
return method('jobs', 'destroy', params)
152152

153153

154+
def machineTypes(params = {}):
155+
return method('jobs', 'getClusterAvailableMachineTypes', params)
156+
157+
154158
def logs(params, tail=False, no_logging=False):
155159
params = params.copy()
156160
if 'apiKey' in params:

tests/test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ def errorcheck(res):
1111
paperspace.print_json_pretty(res)
1212
sys.exit(1)
1313

14+
15+
print("paperspace.jobs.machineTypes()")
16+
machineTypes = paperspace.jobs.machineTypes()
17+
errorcheck(machineTypes)
18+
paperspace.print_json_pretty(machineTypes)
19+
1420
print("paperspace.jobs.list({'project': '%s'})" % project)
1521
jobs = paperspace.jobs.list({'project': project})
1622
errorcheck(jobs)

0 commit comments

Comments
 (0)