Skip to content

Commit df0e4ff

Browse files
committed
0042 to 0044
1 parent d5047e2 commit df0e4ff

1 file changed

Lines changed: 28 additions & 28 deletions

File tree

coldfront/plugins/slurmrest/utils.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def _call_api(self, api_func, *, noop=False, **api_kwargs):
5757

5858
# account methods
5959
def get_account(self, account_name, with_assocs='true', with_coords='true'):
60-
account = self.slurmdb_api.slurmdb_v0042_get_account(
60+
account = self.slurmdb_api.slurmdb_v0044_get_account(
6161
account_name=account_name,
6262
with_assocs=with_assocs,
6363
with_coords=with_coords,
@@ -67,7 +67,7 @@ def get_account(self, account_name, with_assocs='true', with_coords='true'):
6767
return account.to_dict()
6868

6969
def get_accounts(self, with_associations='true', with_coordinators='true'):
70-
accounts = self.slurmdb_api.slurmdb_v0042_get_accounts(
70+
accounts = self.slurmdb_api.slurmdb_v0044_get_accounts(
7171
with_associations=with_associations,
7272
with_coordinators=with_coordinators,
7373
)
@@ -84,12 +84,12 @@ def add_account(self, account_name, specs=None, noop=SLURMREST_NOOP):
8484
if specs is None:
8585
specs = []
8686
account_dict = {
87-
'v0042_openapi_accounts_resp': {
87+
'v0044_openapi_accounts_resp': {
8888
'accounts': {'name': account_name, 'specs': specs}
8989
}
9090
}
9191
response = self._call_api(
92-
self.slurmdb_api.slurmdb_v0042_post_accounts,
92+
self.slurmdb_api.slurmdb_v0044_post_accounts,
9393
noop=noop,
9494
**account_dict
9595
)
@@ -102,15 +102,15 @@ def remove_account(self, account_name, noop=SLURMREST_NOOP):
102102
noop (bool, default False): if True, don't actually execute the action
103103
"""
104104
response = self._call_api(
105-
self.slurmdb_api.slurmdb_v0042_delete_account,
105+
self.slurmdb_api.slurmdb_v0044_delete_account,
106106
noop=noop,
107107
**{'account_name': account_name}
108108
)
109109
logger.info('removed account: %s', response)
110110
return response
111111

112112
def get_assocs(self):
113-
associations = self.slurmdb_api.slurmdb_v0042_get_associations()
113+
associations = self.slurmdb_api.slurmdb_v0044_get_associations()
114114
return associations.to_dict()
115115

116116
# association methods
@@ -127,7 +127,7 @@ def get_assoc(self, *, user_name=None, account_name=None, assoc_id=None):
127127
args['parent_account'] = 'root'
128128
else:
129129
args['user'] = user_name
130-
associations = self.slurmdb_api.slurmdb_v0042_get_association(**args)
130+
associations = self.slurmdb_api.slurmdb_v0044_get_association(**args)
131131
return associations.to_dict()
132132

133133
def post_assoc(self, account_name, user_name, change_dict, noop=SLURMREST_NOOP):
@@ -139,16 +139,16 @@ def post_assoc(self, account_name, user_name, change_dict, noop=SLURMREST_NOOP):
139139
for key, value in change_dict.items():
140140
associations[0][key] = value
141141
response = self._call_api(
142-
self.slurmdb_api.slurmdb_v0042_post_associations,
142+
self.slurmdb_api.slurmdb_v0044_post_associations,
143143
noop=noop,
144-
**{'v0042_openapi_assocs_resp':{'associations': associations}}
144+
**{'v0044_openapi_assocs_resp':{'associations': associations}}
145145
)
146146
logger.info('updated association: %s', response)
147147
return response
148148

149149
def add_assoc(self, account_name, user_name, noop=SLURMREST_NOOP):
150150
association_dict = {
151-
"v0042_openapi_assocs_resp": {
151+
"v0044_openapi_assocs_resp": {
152152
"associations": [{
153153
'account': account_name,
154154
'user': user_name,
@@ -157,7 +157,7 @@ def add_assoc(self, account_name, user_name, noop=SLURMREST_NOOP):
157157
}
158158
}
159159
response = self._call_api(
160-
self.slurmdb_api.slurmdb_v0042_post_associations,
160+
self.slurmdb_api.slurmdb_v0044_post_associations,
161161
noop=noop,
162162
**association_dict
163163
)
@@ -187,7 +187,7 @@ def remove_assoc(self, user_name=None, account_name=None, assoc_id=None, noop=SL
187187
args['cluster'] = self.active_cluster['name']
188188

189189
response = self._call_api(
190-
self.slurmdb_api.slurmdb_v0042_delete_association,
190+
self.slurmdb_api.slurmdb_v0044_delete_association,
191191
noop=noop,
192192
**args
193193
)
@@ -197,55 +197,55 @@ def remove_assoc(self, user_name=None, account_name=None, assoc_id=None, noop=SL
197197

198198
# config methods
199199
def get_config(self):
200-
config = self.slurmdb_api.slurmdb_v0042_get_config()
200+
config = self.slurmdb_api.slurmdb_v0044_get_config()
201201
if config.errors:
202202
raise Exception('error/s found in get_config output: %s', config.errors)
203203
return config.to_dict()
204204

205205

206206
# cluster methods
207207
def get_clusters(self):
208-
clusters = self.slurmdb_api.slurmdb_v0042_get_clusters()
208+
clusters = self.slurmdb_api.slurmdb_v0044_get_clusters()
209209
if clusters.errors:
210210
raise Exception('error/s found in get_clusters output: %s', clusters.errors)
211211
return clusters.to_dict()
212212

213213
# license methods
214214
def get_licenses(self):
215-
licenses = self.slurm_api.slurm_v0042_get_licenses()
215+
licenses = self.slurm_api.slurm_v0044_get_licenses()
216216
if licenses.errors:
217217
raise Exception('error/s found in get_licenses output: %s', licenses.errors)
218218
return licenses.to_dict()
219219

220220
# node methods
221221
def get_node(self, node_name):
222-
node = self.slurm_api.slurm_v0042_get_node(node_name=node_name)
222+
node = self.slurm_api.slurm_v0044_get_node(node_name=node_name)
223223
if node.errors:
224224
raise Exception('error/s found in get_node output: %s', node.errors)
225225
return node.to_dict()
226226

227227
def get_nodes(self, update_time=None, flags=None):
228-
nodes = self.slurm_api.slurm_v0042_get_nodes(update_time=update_time, flags=flags)
228+
nodes = self.slurm_api.slurm_v0044_get_nodes(update_time=update_time, flags=flags)
229229
if nodes.errors:
230230
raise Exception('error/s found in get_nodes output: %s', nodes.errors)
231231
return nodes.to_dict()
232232

233233

234234
# partition methods
235235
def get_partitions(self, update_time=None, flags=None):
236-
partitions = self.slurm_api.slurm_v0042_get_partitions(update_time=update_time, flags=flags)
236+
partitions = self.slurm_api.slurm_v0044_get_partitions(update_time=update_time, flags=flags)
237237
return partitions.to_dict()
238238

239239

240240
# user methods
241241
def get_user(self, user_name):
242-
user = self.slurmdb_api.slurmdb_v0042_get_user(user_name)
242+
user = self.slurmdb_api.slurmdb_v0044_get_user(user_name)
243243
if user.errors:
244244
raise Exception('error/s found in get_user output: %s', user.errors)
245245
return user.to_dict()
246246

247247
def get_users(self):
248-
users = self.slurmdb_api.slurmdb_v0042_get_users()
248+
users = self.slurmdb_api.slurmdb_v0044_get_users()
249249
if users.errors:
250250
raise Exception('error/s found in get_users output: %s', users.errors)
251251
return users.to_dict()
@@ -255,7 +255,7 @@ def update_user(self, user_name, change_dict, noop=SLURMREST_NOOP):
255255
for key, value in change_dict.items():
256256
user_dict[key] = value
257257
response = self._call_api(
258-
self.slurmdb_api.slurmdb_v0042_post_users,
258+
self.slurmdb_api.slurmdb_v0044_post_users,
259259
noop=noop,
260260
**user_dict
261261
)
@@ -266,14 +266,14 @@ def update_user(self, user_name, change_dict, noop=SLURMREST_NOOP):
266266
# qos methods
267267
def get_qos_list(self):
268268
"""Get the list of QoS (Quality of Service) entries."""
269-
qos_list = self.slurmdb_api.slurmdb_v0042_get_qos()
269+
qos_list = self.slurmdb_api.slurmdb_v0044_get_qos()
270270
if qos_list.errors:
271271
raise Exception('error/s found in get_qos_list output: %s', qos_list.errors)
272272
return qos_list.to_dict()
273273

274274
def get_qos(self, qos_name):
275275
"""Get QoS entry by name."""
276-
qos = self.slurmdb_api.slurmdb_v0042_get_single_qos(qos_name=qos_name)
276+
qos = self.slurmdb_api.slurmdb_v0044_get_single_qos(qos_name=qos_name)
277277
if qos.errors:
278278
raise Exception('error/s found in get_qos output: %s', qos.errors)
279279
return qos.to_dict()
@@ -287,12 +287,12 @@ def add_or_update_qos(self, qos_name, specs=None, noop=SLURMREST_NOOP):
287287
if specs is None:
288288
specs = []
289289
qos_dict = {
290-
'v0042_openapi_qos_resp': {
290+
'v0044_openapi_qos_resp': {
291291
'qos': {'name': qos_name, 'specs': specs}
292292
}
293293
}
294294
response = self._call_api(
295-
self.slurmdb_api.slurmdb_v0042_post_qos,
295+
self.slurmdb_api.slurmdb_v0044_post_qos,
296296
noop=noop,
297297
**qos_dict
298298
)
@@ -301,7 +301,7 @@ def add_or_update_qos(self, qos_name, specs=None, noop=SLURMREST_NOOP):
301301

302302
def remove_qos(self, qos_name, noop=SLURMREST_NOOP):
303303
response = self._call_api(
304-
self.slurmdb_api.slurmdb_v0042_delete_qos,
304+
self.slurmdb_api.slurmdb_v0044_delete_qos,
305305
noop=noop,
306306
**{'qos': qos_name}
307307
)
@@ -314,15 +314,15 @@ def get_shares(self, accounts=None, users=None):
314314
accounts (string, default None): accounts for which to get shares
315315
users (string, default None): users for which to get shares
316316
"""
317-
shares = self.slurm_api.slurm_v0042_get_shares(accounts=accounts, users=users)
317+
shares = self.slurm_api.slurm_v0044_get_shares(accounts=accounts, users=users)
318318
if shares.errors:
319319
raise Exception('error/s found in get_shares output: %s', shares.errors)
320320
return shares.to_dict()
321321

322322

323323
# wckey methods
324324
def get_wckeys(self):
325-
wckeys = self.slurmdb_api.slurmdb_v0042_get_wckeys()
325+
wckeys = self.slurmdb_api.slurmdb_v0044_get_wckeys()
326326
if wckeys.errors:
327327
raise Exception('error/s found in get_wckeys output: %s', wckeys.errors)
328328
return wckeys.to_dict()

0 commit comments

Comments
 (0)