cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
clusters_api.py
Go to the documentation of this file.
1 # coding: utf-8
2 
3 """
4  cloudFPGA Resource Manager API
5 
6  No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
7 
8  OpenAPI spec version: 0.8
9 
10  Generated by: https://github.com/swagger-api/swagger-codegen.git
11 """
12 
13 from __future__ import absolute_import
14 
15 import re # noqa: F401
16 
17 # python 2 and python 3 compatibility library
18 import six
19 
20 from swagger_client.api_client import ApiClient
21 
22 
23 class ClustersApi(object):
24  """NOTE: This class is auto generated by the swagger code generator program.
25 
26  Do not edit the class manually.
27  Ref: https://github.com/swagger-api/swagger-codegen
28  """
29 
30  def __init__(self, api_client=None):
31  if api_client is None:
32  api_client = ApiClient()
33  self.api_clientapi_client = api_client
34 
35  def cf_manager_rest_api_delete_cluster(self, username, password, cluster_id, **kwargs): # noqa: E501
36  """Delete a cluster # noqa: E501
37 
38  This method makes a synchronous HTTP request by default. To make an
39  asynchronous HTTP request, please pass async_req=True
40  >>> thread = api.cf_manager_rest_api_delete_cluster(username, password, cluster_id, async_req=True)
41  >>> result = thread.get()
42 
43  :param async_req bool
44  :param str username: OpenStack username (required)
45  :param str password: OpenStack password (required)
46  :param int cluster_id: ID of a cluster (required)
47  :return: None
48  If the method is called asynchronously,
49  returns the request thread.
50  """
51  kwargs['_return_http_data_only'] = True
52  if kwargs.get('async_req'):
53  return self.cf_manager_rest_api_delete_cluster_with_http_infocf_manager_rest_api_delete_cluster_with_http_info(username, password, cluster_id, **kwargs) # noqa: E501
54  else:
55  (data) = self.cf_manager_rest_api_delete_cluster_with_http_infocf_manager_rest_api_delete_cluster_with_http_info(username, password, cluster_id, **kwargs) # noqa: E501
56  return data
57 
58  def cf_manager_rest_api_delete_cluster_with_http_info(self, username, password, cluster_id, **kwargs): # noqa: E501
59  """Delete a cluster # noqa: E501
60 
61  This method makes a synchronous HTTP request by default. To make an
62  asynchronous HTTP request, please pass async_req=True
63  >>> thread = api.cf_manager_rest_api_delete_cluster_with_http_info(username, password, cluster_id, async_req=True)
64  >>> result = thread.get()
65 
66  :param async_req bool
67  :param str username: OpenStack username (required)
68  :param str password: OpenStack password (required)
69  :param int cluster_id: ID of a cluster (required)
70  :return: None
71  If the method is called asynchronously,
72  returns the request thread.
73  """
74 
75  all_params = ['username', 'password', 'cluster_id'] # noqa: E501
76  all_params.append('async_req')
77  all_params.append('_return_http_data_only')
78  all_params.append('_preload_content')
79  all_params.append('_request_timeout')
80 
81  params = locals()
82  for key, val in six.iteritems(params['kwargs']):
83  if key not in all_params:
84  raise TypeError(
85  "Got an unexpected keyword argument '%s'"
86  " to method cf_manager_rest_api_delete_cluster" % key
87  )
88  params[key] = val
89  del params['kwargs']
90  # verify the required parameter 'username' is set
91  if ('username' not in params or
92  params['username'] is None):
93  raise ValueError("Missing the required parameter `username` when calling `cf_manager_rest_api_delete_cluster`") # noqa: E501
94  # verify the required parameter 'password' is set
95  if ('password' not in params or
96  params['password'] is None):
97  raise ValueError("Missing the required parameter `password` when calling `cf_manager_rest_api_delete_cluster`") # noqa: E501
98  # verify the required parameter 'cluster_id' is set
99  if ('cluster_id' not in params or
100  params['cluster_id'] is None):
101  raise ValueError("Missing the required parameter `cluster_id` when calling `cf_manager_rest_api_delete_cluster`") # noqa: E501
102 
103  collection_formats = {}
104 
105  path_params = {}
106  if 'cluster_id' in params:
107  path_params['cluster_id'] = params['cluster_id'] # noqa: E501
108 
109  query_params = []
110  if 'username' in params:
111  query_params.append(('username', params['username'])) # noqa: E501
112  if 'password' in params:
113  query_params.append(('password', params['password'])) # noqa: E501
114 
115  header_params = {}
116 
117  form_params = []
118  local_var_files = {}
119 
120  body_params = None
121  # Authentication setting
122  auth_settings = [] # noqa: E501
123 
124  return self.api_clientapi_client.call_api(
125  '/clusters/{cluster_id}', 'DELETE',
126  path_params,
127  query_params,
128  header_params,
129  body=body_params,
130  post_params=form_params,
131  files=local_var_files,
132  response_type=None, # noqa: E501
133  auth_settings=auth_settings,
134  async_req=params.get('async_req'),
135  _return_http_data_only=params.get('_return_http_data_only'),
136  _preload_content=params.get('_preload_content', True),
137  _request_timeout=params.get('_request_timeout'),
138  collection_formats=collection_formats)
139 
140  def cf_manager_rest_api_extend_cluster(self, body, username, password, cluster_id, **kwargs): # noqa: E501
141  """Add nodes to an existing cluster # noqa: E501
142 
143  This adds nodes to an existing cluster, as specified in the parameter `cluster_details`. **Details** on how to describe a cluster can be found at the **Implementation Notes of the `POST /clusters` API call**. All mentioned rules apply for this method as well. After creating all new nodes, the runtime information of all nodes will be updated. The Roles of the already existing FPGA nodes are **not** reset during this method. If errors occur during this method (e.g. 424 or 507), the original cluster will be unaffected. # noqa: E501
144  This method makes a synchronous HTTP request by default. To make an
145  asynchronous HTTP request, please pass async_req=True
146  >>> thread = api.cf_manager_rest_api_extend_cluster(body, username, password, cluster_id, async_req=True)
147  >>> result = thread.get()
148 
149  :param async_req bool
150  :param list[ClustersBody] body: Mapping of Node-IDs to Images (required)
151  :param str username: OpenStack username (required)
152  :param str password: OpenStack password (required)
153  :param int cluster_id: ID of a cluster (required)
154  :param int dont_verify_memory: If 1, don't verify the DDR4 memory during setup
155  :return: Cluster
156  If the method is called asynchronously,
157  returns the request thread.
158  """
159  kwargs['_return_http_data_only'] = True
160  if kwargs.get('async_req'):
161  return self.cf_manager_rest_api_extend_cluster_with_http_infocf_manager_rest_api_extend_cluster_with_http_info(body, username, password, cluster_id, **kwargs) # noqa: E501
162  else:
163  (data) = self.cf_manager_rest_api_extend_cluster_with_http_infocf_manager_rest_api_extend_cluster_with_http_info(body, username, password, cluster_id, **kwargs) # noqa: E501
164  return data
165 
166  def cf_manager_rest_api_extend_cluster_with_http_info(self, body, username, password, cluster_id, **kwargs): # noqa: E501
167  """Add nodes to an existing cluster # noqa: E501
168 
169  This adds nodes to an existing cluster, as specified in the parameter `cluster_details`. **Details** on how to describe a cluster can be found at the **Implementation Notes of the `POST /clusters` API call**. All mentioned rules apply for this method as well. After creating all new nodes, the runtime information of all nodes will be updated. The Roles of the already existing FPGA nodes are **not** reset during this method. If errors occur during this method (e.g. 424 or 507), the original cluster will be unaffected. # noqa: E501
170  This method makes a synchronous HTTP request by default. To make an
171  asynchronous HTTP request, please pass async_req=True
172  >>> thread = api.cf_manager_rest_api_extend_cluster_with_http_info(body, username, password, cluster_id, async_req=True)
173  >>> result = thread.get()
174 
175  :param async_req bool
176  :param list[ClustersBody] body: Mapping of Node-IDs to Images (required)
177  :param str username: OpenStack username (required)
178  :param str password: OpenStack password (required)
179  :param int cluster_id: ID of a cluster (required)
180  :param int dont_verify_memory: If 1, don't verify the DDR4 memory during setup
181  :return: Cluster
182  If the method is called asynchronously,
183  returns the request thread.
184  """
185 
186  all_params = ['body', 'username', 'password', 'cluster_id', 'dont_verify_memory'] # noqa: E501
187  all_params.append('async_req')
188  all_params.append('_return_http_data_only')
189  all_params.append('_preload_content')
190  all_params.append('_request_timeout')
191 
192  params = locals()
193  for key, val in six.iteritems(params['kwargs']):
194  if key not in all_params:
195  raise TypeError(
196  "Got an unexpected keyword argument '%s'"
197  " to method cf_manager_rest_api_extend_cluster" % key
198  )
199  params[key] = val
200  del params['kwargs']
201  # verify the required parameter 'body' is set
202  if ('body' not in params or
203  params['body'] is None):
204  raise ValueError("Missing the required parameter `body` when calling `cf_manager_rest_api_extend_cluster`") # noqa: E501
205  # verify the required parameter 'username' is set
206  if ('username' not in params or
207  params['username'] is None):
208  raise ValueError("Missing the required parameter `username` when calling `cf_manager_rest_api_extend_cluster`") # noqa: E501
209  # verify the required parameter 'password' is set
210  if ('password' not in params or
211  params['password'] is None):
212  raise ValueError("Missing the required parameter `password` when calling `cf_manager_rest_api_extend_cluster`") # noqa: E501
213  # verify the required parameter 'cluster_id' is set
214  if ('cluster_id' not in params or
215  params['cluster_id'] is None):
216  raise ValueError("Missing the required parameter `cluster_id` when calling `cf_manager_rest_api_extend_cluster`") # noqa: E501
217 
218  collection_formats = {}
219 
220  path_params = {}
221  if 'cluster_id' in params:
222  path_params['cluster_id'] = params['cluster_id'] # noqa: E501
223 
224  query_params = []
225  if 'username' in params:
226  query_params.append(('username', params['username'])) # noqa: E501
227  if 'password' in params:
228  query_params.append(('password', params['password'])) # noqa: E501
229  if 'dont_verify_memory' in params:
230  query_params.append(('dont_verify_memory', params['dont_verify_memory'])) # noqa: E501
231 
232  header_params = {}
233 
234  form_params = []
235  local_var_files = {}
236 
237  body_params = None
238  if 'body' in params:
239  body_params = params['body']
240  # HTTP header `Accept`
241  header_params['Accept'] = self.api_clientapi_client.select_header_accept(
242  ['application/json']) # noqa: E501
243 
244  # HTTP header `Content-Type`
245  header_params['Content-Type'] = self.api_clientapi_client.select_header_content_type( # noqa: E501
246  ['application/json']) # noqa: E501
247 
248  # Authentication setting
249  auth_settings = [] # noqa: E501
250 
251  return self.api_clientapi_client.call_api(
252  '/clusters/{cluster_id}/extend', 'PUT',
253  path_params,
254  query_params,
255  header_params,
256  body=body_params,
257  post_params=form_params,
258  files=local_var_files,
259  response_type='Cluster', # noqa: E501
260  auth_settings=auth_settings,
261  async_req=params.get('async_req'),
262  _return_http_data_only=params.get('_return_http_data_only'),
263  _preload_content=params.get('_preload_content', True),
264  _request_timeout=params.get('_request_timeout'),
265  collection_formats=collection_formats)
266 
267  def cf_manager_rest_api_get_cluster_single(self, username, password, cluster_id, **kwargs): # noqa: E501
268  """Get a cluster # noqa: E501
269 
270  This method makes a synchronous HTTP request by default. To make an
271  asynchronous HTTP request, please pass async_req=True
272  >>> thread = api.cf_manager_rest_api_get_cluster_single(username, password, cluster_id, async_req=True)
273  >>> result = thread.get()
274 
275  :param async_req bool
276  :param str username: OpenStack username (required)
277  :param str password: OpenStack password (required)
278  :param int cluster_id: ID of a cluster (required)
279  :return: Cluster
280  If the method is called asynchronously,
281  returns the request thread.
282  """
283  kwargs['_return_http_data_only'] = True
284  if kwargs.get('async_req'):
285  return self.cf_manager_rest_api_get_cluster_single_with_http_infocf_manager_rest_api_get_cluster_single_with_http_info(username, password, cluster_id, **kwargs) # noqa: E501
286  else:
287  (data) = self.cf_manager_rest_api_get_cluster_single_with_http_infocf_manager_rest_api_get_cluster_single_with_http_info(username, password, cluster_id, **kwargs) # noqa: E501
288  return data
289 
290  def cf_manager_rest_api_get_cluster_single_with_http_info(self, username, password, cluster_id, **kwargs): # noqa: E501
291  """Get a cluster # noqa: E501
292 
293  This method makes a synchronous HTTP request by default. To make an
294  asynchronous HTTP request, please pass async_req=True
295  >>> thread = api.cf_manager_rest_api_get_cluster_single_with_http_info(username, password, cluster_id, async_req=True)
296  >>> result = thread.get()
297 
298  :param async_req bool
299  :param str username: OpenStack username (required)
300  :param str password: OpenStack password (required)
301  :param int cluster_id: ID of a cluster (required)
302  :return: Cluster
303  If the method is called asynchronously,
304  returns the request thread.
305  """
306 
307  all_params = ['username', 'password', 'cluster_id'] # noqa: E501
308  all_params.append('async_req')
309  all_params.append('_return_http_data_only')
310  all_params.append('_preload_content')
311  all_params.append('_request_timeout')
312 
313  params = locals()
314  for key, val in six.iteritems(params['kwargs']):
315  if key not in all_params:
316  raise TypeError(
317  "Got an unexpected keyword argument '%s'"
318  " to method cf_manager_rest_api_get_cluster_single" % key
319  )
320  params[key] = val
321  del params['kwargs']
322  # verify the required parameter 'username' is set
323  if ('username' not in params or
324  params['username'] is None):
325  raise ValueError("Missing the required parameter `username` when calling `cf_manager_rest_api_get_cluster_single`") # noqa: E501
326  # verify the required parameter 'password' is set
327  if ('password' not in params or
328  params['password'] is None):
329  raise ValueError("Missing the required parameter `password` when calling `cf_manager_rest_api_get_cluster_single`") # noqa: E501
330  # verify the required parameter 'cluster_id' is set
331  if ('cluster_id' not in params or
332  params['cluster_id'] is None):
333  raise ValueError("Missing the required parameter `cluster_id` when calling `cf_manager_rest_api_get_cluster_single`") # noqa: E501
334 
335  collection_formats = {}
336 
337  path_params = {}
338  if 'cluster_id' in params:
339  path_params['cluster_id'] = params['cluster_id'] # noqa: E501
340 
341  query_params = []
342  if 'username' in params:
343  query_params.append(('username', params['username'])) # noqa: E501
344  if 'password' in params:
345  query_params.append(('password', params['password'])) # noqa: E501
346 
347  header_params = {}
348 
349  form_params = []
350  local_var_files = {}
351 
352  body_params = None
353  # HTTP header `Accept`
354  header_params['Accept'] = self.api_clientapi_client.select_header_accept(
355  ['application/json']) # noqa: E501
356 
357  # Authentication setting
358  auth_settings = [] # noqa: E501
359 
360  return self.api_clientapi_client.call_api(
361  '/clusters/{cluster_id}', 'GET',
362  path_params,
363  query_params,
364  header_params,
365  body=body_params,
366  post_params=form_params,
367  files=local_var_files,
368  response_type='Cluster', # noqa: E501
369  auth_settings=auth_settings,
370  async_req=params.get('async_req'),
371  _return_http_data_only=params.get('_return_http_data_only'),
372  _preload_content=params.get('_preload_content', True),
373  _request_timeout=params.get('_request_timeout'),
374  collection_formats=collection_formats)
375 
376  def cf_manager_rest_api_get_clusters(self, username, password, **kwargs): # noqa: E501
377  """Get all clusters of a user # noqa: E501
378 
379  This method makes a synchronous HTTP request by default. To make an
380  asynchronous HTTP request, please pass async_req=True
381  >>> thread = api.cf_manager_rest_api_get_clusters(username, password, async_req=True)
382  >>> result = thread.get()
383 
384  :param async_req bool
385  :param str username: OpenStack username (required)
386  :param str password: OpenStack password (required)
387  :param int limit:
388  :return: list[Cluster]
389  If the method is called asynchronously,
390  returns the request thread.
391  """
392  kwargs['_return_http_data_only'] = True
393  if kwargs.get('async_req'):
394  return self.cf_manager_rest_api_get_clusters_with_http_infocf_manager_rest_api_get_clusters_with_http_info(username, password, **kwargs) # noqa: E501
395  else:
396  (data) = self.cf_manager_rest_api_get_clusters_with_http_infocf_manager_rest_api_get_clusters_with_http_info(username, password, **kwargs) # noqa: E501
397  return data
398 
399  def cf_manager_rest_api_get_clusters_with_http_info(self, username, password, **kwargs): # noqa: E501
400  """Get all clusters of a user # noqa: E501
401 
402  This method makes a synchronous HTTP request by default. To make an
403  asynchronous HTTP request, please pass async_req=True
404  >>> thread = api.cf_manager_rest_api_get_clusters_with_http_info(username, password, async_req=True)
405  >>> result = thread.get()
406 
407  :param async_req bool
408  :param str username: OpenStack username (required)
409  :param str password: OpenStack password (required)
410  :param int limit:
411  :return: list[Cluster]
412  If the method is called asynchronously,
413  returns the request thread.
414  """
415 
416  all_params = ['username', 'password', 'limit'] # noqa: E501
417  all_params.append('async_req')
418  all_params.append('_return_http_data_only')
419  all_params.append('_preload_content')
420  all_params.append('_request_timeout')
421 
422  params = locals()
423  for key, val in six.iteritems(params['kwargs']):
424  if key not in all_params:
425  raise TypeError(
426  "Got an unexpected keyword argument '%s'"
427  " to method cf_manager_rest_api_get_clusters" % key
428  )
429  params[key] = val
430  del params['kwargs']
431  # verify the required parameter 'username' is set
432  if ('username' not in params or
433  params['username'] is None):
434  raise ValueError("Missing the required parameter `username` when calling `cf_manager_rest_api_get_clusters`") # noqa: E501
435  # verify the required parameter 'password' is set
436  if ('password' not in params or
437  params['password'] is None):
438  raise ValueError("Missing the required parameter `password` when calling `cf_manager_rest_api_get_clusters`") # noqa: E501
439 
440  collection_formats = {}
441 
442  path_params = {}
443 
444  query_params = []
445  if 'username' in params:
446  query_params.append(('username', params['username'])) # noqa: E501
447  if 'password' in params:
448  query_params.append(('password', params['password'])) # noqa: E501
449  if 'limit' in params:
450  query_params.append(('limit', params['limit'])) # noqa: E501
451 
452  header_params = {}
453 
454  form_params = []
455  local_var_files = {}
456 
457  body_params = None
458  # HTTP header `Accept`
459  header_params['Accept'] = self.api_clientapi_client.select_header_accept(
460  ['application/json']) # noqa: E501
461 
462  # Authentication setting
463  auth_settings = [] # noqa: E501
464 
465  return self.api_clientapi_client.call_api(
466  '/clusters', 'GET',
467  path_params,
468  query_params,
469  header_params,
470  body=body_params,
471  post_params=form_params,
472  files=local_var_files,
473  response_type='list[Cluster]', # noqa: E501
474  auth_settings=auth_settings,
475  async_req=params.get('async_req'),
476  _return_http_data_only=params.get('_return_http_data_only'),
477  _preload_content=params.get('_preload_content', True),
478  _request_timeout=params.get('_request_timeout'),
479  collection_formats=collection_formats)
480 
481  def cf_manager_rest_api_post_clusters(self, body, username, password, **kwargs): # noqa: E501
482  """Request a cluster # noqa: E501
483 
484  This triggers the configuration of all *FPGA nodes* of a cluster as specified in the parameter `cluster_details`. The entry for an FPGA node must look like: ```json { \"node_id\": unique integer, \"image_id\": \"XXX-XX-XXX\" } ``` The parameters `instance_id` and `node_ip` are set by the Resource Manager. The `node_id`s must be unique for the whole cluster (FPGAs and CPUs). It is necessary to submit the information about the CPU nodes of a heterogeneous cluster to compile and distribute the *network routing configuration for the FPGAs correctly*. Hence, the entry for a CPU must look like: ```json { \"node_id\": unique integer, \"image_id\": \"NON_FPGA\", \"node_ip\": \"10.12.47.11\" } ``` The setup of the CPU nodes must be done by the users themselves. The `node_ip` of a CPU must be in the OpenStack user subnetwork (i.e. `10.12.X.Y`). Currently, the maximum supported size of a cluster is 64 (FPGA + CPU nodes). # noqa: E501
485  This method makes a synchronous HTTP request by default. To make an
486  asynchronous HTTP request, please pass async_req=True
487  >>> thread = api.cf_manager_rest_api_post_clusters(body, username, password, async_req=True)
488  >>> result = thread.get()
489 
490  :param async_req bool
491  :param list[ClustersBody] body: Mapping of Node-IDs to Images (required)
492  :param str username: OpenStack username (required)
493  :param str password: OpenStack password (required)
494  :param str project_name: Name of the OpenStack project the quota should be acounted to, if a user has multiple projects.
495  :param int dont_verify_memory: If 1, don't verify the DDR4 memory during setup
496  :return: Cluster
497  If the method is called asynchronously,
498  returns the request thread.
499  """
500  kwargs['_return_http_data_only'] = True
501  if kwargs.get('async_req'):
502  return self.cf_manager_rest_api_post_clusters_with_http_infocf_manager_rest_api_post_clusters_with_http_info(body, username, password, **kwargs) # noqa: E501
503  else:
504  (data) = self.cf_manager_rest_api_post_clusters_with_http_infocf_manager_rest_api_post_clusters_with_http_info(body, username, password, **kwargs) # noqa: E501
505  return data
506 
507  def cf_manager_rest_api_post_clusters_with_http_info(self, body, username, password, **kwargs): # noqa: E501
508  """Request a cluster # noqa: E501
509 
510  This triggers the configuration of all *FPGA nodes* of a cluster as specified in the parameter `cluster_details`. The entry for an FPGA node must look like: ```json { \"node_id\": unique integer, \"image_id\": \"XXX-XX-XXX\" } ``` The parameters `instance_id` and `node_ip` are set by the Resource Manager. The `node_id`s must be unique for the whole cluster (FPGAs and CPUs). It is necessary to submit the information about the CPU nodes of a heterogeneous cluster to compile and distribute the *network routing configuration for the FPGAs correctly*. Hence, the entry for a CPU must look like: ```json { \"node_id\": unique integer, \"image_id\": \"NON_FPGA\", \"node_ip\": \"10.12.47.11\" } ``` The setup of the CPU nodes must be done by the users themselves. The `node_ip` of a CPU must be in the OpenStack user subnetwork (i.e. `10.12.X.Y`). Currently, the maximum supported size of a cluster is 64 (FPGA + CPU nodes). # noqa: E501
511  This method makes a synchronous HTTP request by default. To make an
512  asynchronous HTTP request, please pass async_req=True
513  >>> thread = api.cf_manager_rest_api_post_clusters_with_http_info(body, username, password, async_req=True)
514  >>> result = thread.get()
515 
516  :param async_req bool
517  :param list[ClustersBody] body: Mapping of Node-IDs to Images (required)
518  :param str username: OpenStack username (required)
519  :param str password: OpenStack password (required)
520  :param str project_name: Name of the OpenStack project the quota should be acounted to, if a user has multiple projects.
521  :param int dont_verify_memory: If 1, don't verify the DDR4 memory during setup
522  :return: Cluster
523  If the method is called asynchronously,
524  returns the request thread.
525  """
526 
527  all_params = ['body', 'username', 'password', 'project_name', 'dont_verify_memory'] # noqa: E501
528  all_params.append('async_req')
529  all_params.append('_return_http_data_only')
530  all_params.append('_preload_content')
531  all_params.append('_request_timeout')
532 
533  params = locals()
534  for key, val in six.iteritems(params['kwargs']):
535  if key not in all_params:
536  raise TypeError(
537  "Got an unexpected keyword argument '%s'"
538  " to method cf_manager_rest_api_post_clusters" % key
539  )
540  params[key] = val
541  del params['kwargs']
542  # verify the required parameter 'body' is set
543  if ('body' not in params or
544  params['body'] is None):
545  raise ValueError("Missing the required parameter `body` when calling `cf_manager_rest_api_post_clusters`") # noqa: E501
546  # verify the required parameter 'username' is set
547  if ('username' not in params or
548  params['username'] is None):
549  raise ValueError("Missing the required parameter `username` when calling `cf_manager_rest_api_post_clusters`") # noqa: E501
550  # verify the required parameter 'password' is set
551  if ('password' not in params or
552  params['password'] is None):
553  raise ValueError("Missing the required parameter `password` when calling `cf_manager_rest_api_post_clusters`") # noqa: E501
554 
555  collection_formats = {}
556 
557  path_params = {}
558 
559  query_params = []
560  if 'username' in params:
561  query_params.append(('username', params['username'])) # noqa: E501
562  if 'password' in params:
563  query_params.append(('password', params['password'])) # noqa: E501
564  if 'project_name' in params:
565  query_params.append(('project_name', params['project_name'])) # noqa: E501
566  if 'dont_verify_memory' in params:
567  query_params.append(('dont_verify_memory', params['dont_verify_memory'])) # noqa: E501
568 
569  header_params = {}
570 
571  form_params = []
572  local_var_files = {}
573 
574  body_params = None
575  if 'body' in params:
576  body_params = params['body']
577  # HTTP header `Accept`
578  header_params['Accept'] = self.api_clientapi_client.select_header_accept(
579  ['application/json']) # noqa: E501
580 
581  # HTTP header `Content-Type`
582  header_params['Content-Type'] = self.api_clientapi_client.select_header_content_type( # noqa: E501
583  ['application/json']) # noqa: E501
584 
585  # Authentication setting
586  auth_settings = [] # noqa: E501
587 
588  return self.api_clientapi_client.call_api(
589  '/clusters', 'POST',
590  path_params,
591  query_params,
592  header_params,
593  body=body_params,
594  post_params=form_params,
595  files=local_var_files,
596  response_type='Cluster', # noqa: E501
597  auth_settings=auth_settings,
598  async_req=params.get('async_req'),
599  _return_http_data_only=params.get('_return_http_data_only'),
600  _preload_content=params.get('_preload_content', True),
601  _request_timeout=params.get('_request_timeout'),
602  collection_formats=collection_formats)
603 
604  def cf_manager_rest_api_reduce_cluster(self, body, username, password, cluster_id, **kwargs): # noqa: E501
605  """Remove nodes from an existing cluster # noqa: E501
606 
607  This remove nodes the nodes in the `nodes_to_remove` list from an existing cluster. The `nodes_to_remove` list must contain the `node_id`s of the nodes that should be removed. After removing all specified nodes, the runtime information of all remaining nodes will be updated. The Roles of the remaining FPGA nodes are **not** reset during this method. If the last remaining FPGA node is removed, the complete cluster will be deleted (like `DELETE /cluster/{cluster_id}`). If errors occur during this method, the original/remaining cluster will be unaffected. # noqa: E501
608  This method makes a synchronous HTTP request by default. To make an
609  asynchronous HTTP request, please pass async_req=True
610  >>> thread = api.cf_manager_rest_api_reduce_cluster(body, username, password, cluster_id, async_req=True)
611  >>> result = thread.get()
612 
613  :param async_req bool
614  :param list[int] body: List of Node-IDs that should be removed (required)
615  :param str username: OpenStack username (required)
616  :param str password: OpenStack password (required)
617  :param int cluster_id: ID of a cluster (required)
618  :return: Cluster
619  If the method is called asynchronously,
620  returns the request thread.
621  """
622  kwargs['_return_http_data_only'] = True
623  if kwargs.get('async_req'):
624  return self.cf_manager_rest_api_reduce_cluster_with_http_infocf_manager_rest_api_reduce_cluster_with_http_info(body, username, password, cluster_id, **kwargs) # noqa: E501
625  else:
626  (data) = self.cf_manager_rest_api_reduce_cluster_with_http_infocf_manager_rest_api_reduce_cluster_with_http_info(body, username, password, cluster_id, **kwargs) # noqa: E501
627  return data
628 
629  def cf_manager_rest_api_reduce_cluster_with_http_info(self, body, username, password, cluster_id, **kwargs): # noqa: E501
630  """Remove nodes from an existing cluster # noqa: E501
631 
632  This remove nodes the nodes in the `nodes_to_remove` list from an existing cluster. The `nodes_to_remove` list must contain the `node_id`s of the nodes that should be removed. After removing all specified nodes, the runtime information of all remaining nodes will be updated. The Roles of the remaining FPGA nodes are **not** reset during this method. If the last remaining FPGA node is removed, the complete cluster will be deleted (like `DELETE /cluster/{cluster_id}`). If errors occur during this method, the original/remaining cluster will be unaffected. # noqa: E501
633  This method makes a synchronous HTTP request by default. To make an
634  asynchronous HTTP request, please pass async_req=True
635  >>> thread = api.cf_manager_rest_api_reduce_cluster_with_http_info(body, username, password, cluster_id, async_req=True)
636  >>> result = thread.get()
637 
638  :param async_req bool
639  :param list[int] body: List of Node-IDs that should be removed (required)
640  :param str username: OpenStack username (required)
641  :param str password: OpenStack password (required)
642  :param int cluster_id: ID of a cluster (required)
643  :return: Cluster
644  If the method is called asynchronously,
645  returns the request thread.
646  """
647 
648  all_params = ['body', 'username', 'password', 'cluster_id'] # noqa: E501
649  all_params.append('async_req')
650  all_params.append('_return_http_data_only')
651  all_params.append('_preload_content')
652  all_params.append('_request_timeout')
653 
654  params = locals()
655  for key, val in six.iteritems(params['kwargs']):
656  if key not in all_params:
657  raise TypeError(
658  "Got an unexpected keyword argument '%s'"
659  " to method cf_manager_rest_api_reduce_cluster" % key
660  )
661  params[key] = val
662  del params['kwargs']
663  # verify the required parameter 'body' is set
664  if ('body' not in params or
665  params['body'] is None):
666  raise ValueError("Missing the required parameter `body` when calling `cf_manager_rest_api_reduce_cluster`") # noqa: E501
667  # verify the required parameter 'username' is set
668  if ('username' not in params or
669  params['username'] is None):
670  raise ValueError("Missing the required parameter `username` when calling `cf_manager_rest_api_reduce_cluster`") # noqa: E501
671  # verify the required parameter 'password' is set
672  if ('password' not in params or
673  params['password'] is None):
674  raise ValueError("Missing the required parameter `password` when calling `cf_manager_rest_api_reduce_cluster`") # noqa: E501
675  # verify the required parameter 'cluster_id' is set
676  if ('cluster_id' not in params or
677  params['cluster_id'] is None):
678  raise ValueError("Missing the required parameter `cluster_id` when calling `cf_manager_rest_api_reduce_cluster`") # noqa: E501
679 
680  collection_formats = {}
681 
682  path_params = {}
683  if 'cluster_id' in params:
684  path_params['cluster_id'] = params['cluster_id'] # noqa: E501
685 
686  query_params = []
687  if 'username' in params:
688  query_params.append(('username', params['username'])) # noqa: E501
689  if 'password' in params:
690  query_params.append(('password', params['password'])) # noqa: E501
691 
692  header_params = {}
693 
694  form_params = []
695  local_var_files = {}
696 
697  body_params = None
698  if 'body' in params:
699  body_params = params['body']
700  # HTTP header `Accept`
701  header_params['Accept'] = self.api_clientapi_client.select_header_accept(
702  ['application/json']) # noqa: E501
703 
704  # HTTP header `Content-Type`
705  header_params['Content-Type'] = self.api_clientapi_client.select_header_content_type( # noqa: E501
706  ['application/json']) # noqa: E501
707 
708  # Authentication setting
709  auth_settings = [] # noqa: E501
710 
711  return self.api_clientapi_client.call_api(
712  '/clusters/{cluster_id}/reduce', 'PUT',
713  path_params,
714  query_params,
715  header_params,
716  body=body_params,
717  post_params=form_params,
718  files=local_var_files,
719  response_type='Cluster', # noqa: E501
720  auth_settings=auth_settings,
721  async_req=params.get('async_req'),
722  _return_http_data_only=params.get('_return_http_data_only'),
723  _preload_content=params.get('_preload_content', True),
724  _request_timeout=params.get('_request_timeout'),
725  collection_formats=collection_formats)
726 
727  def cf_manager_rest_api_restart_cluster(self, username, password, cluster_id, **kwargs): # noqa: E501
728  """Restart all application on FPGAs in this cluster # noqa: E501
729 
730  This method makes a synchronous HTTP request by default. To make an
731  asynchronous HTTP request, please pass async_req=True
732  >>> thread = api.cf_manager_rest_api_restart_cluster(username, password, cluster_id, async_req=True)
733  >>> result = thread.get()
734 
735  :param async_req bool
736  :param str username: OpenStack username (required)
737  :param str password: OpenStack password (required)
738  :param int cluster_id: ID of a cluster (required)
739  :return: None
740  If the method is called asynchronously,
741  returns the request thread.
742  """
743  kwargs['_return_http_data_only'] = True
744  if kwargs.get('async_req'):
745  return self.cf_manager_rest_api_restart_cluster_with_http_infocf_manager_rest_api_restart_cluster_with_http_info(username, password, cluster_id, **kwargs) # noqa: E501
746  else:
747  (data) = self.cf_manager_rest_api_restart_cluster_with_http_infocf_manager_rest_api_restart_cluster_with_http_info(username, password, cluster_id, **kwargs) # noqa: E501
748  return data
749 
750  def cf_manager_rest_api_restart_cluster_with_http_info(self, username, password, cluster_id, **kwargs): # noqa: E501
751  """Restart all application on FPGAs in this cluster # noqa: E501
752 
753  This method makes a synchronous HTTP request by default. To make an
754  asynchronous HTTP request, please pass async_req=True
755  >>> thread = api.cf_manager_rest_api_restart_cluster_with_http_info(username, password, cluster_id, async_req=True)
756  >>> result = thread.get()
757 
758  :param async_req bool
759  :param str username: OpenStack username (required)
760  :param str password: OpenStack password (required)
761  :param int cluster_id: ID of a cluster (required)
762  :return: None
763  If the method is called asynchronously,
764  returns the request thread.
765  """
766 
767  all_params = ['username', 'password', 'cluster_id'] # noqa: E501
768  all_params.append('async_req')
769  all_params.append('_return_http_data_only')
770  all_params.append('_preload_content')
771  all_params.append('_request_timeout')
772 
773  params = locals()
774  for key, val in six.iteritems(params['kwargs']):
775  if key not in all_params:
776  raise TypeError(
777  "Got an unexpected keyword argument '%s'"
778  " to method cf_manager_rest_api_restart_cluster" % key
779  )
780  params[key] = val
781  del params['kwargs']
782  # verify the required parameter 'username' is set
783  if ('username' not in params or
784  params['username'] is None):
785  raise ValueError("Missing the required parameter `username` when calling `cf_manager_rest_api_restart_cluster`") # noqa: E501
786  # verify the required parameter 'password' is set
787  if ('password' not in params or
788  params['password'] is None):
789  raise ValueError("Missing the required parameter `password` when calling `cf_manager_rest_api_restart_cluster`") # noqa: E501
790  # verify the required parameter 'cluster_id' is set
791  if ('cluster_id' not in params or
792  params['cluster_id'] is None):
793  raise ValueError("Missing the required parameter `cluster_id` when calling `cf_manager_rest_api_restart_cluster`") # noqa: E501
794 
795  collection_formats = {}
796 
797  path_params = {}
798  if 'cluster_id' in params:
799  path_params['cluster_id'] = params['cluster_id'] # noqa: E501
800 
801  query_params = []
802  if 'username' in params:
803  query_params.append(('username', params['username'])) # noqa: E501
804  if 'password' in params:
805  query_params.append(('password', params['password'])) # noqa: E501
806 
807  header_params = {}
808 
809  form_params = []
810  local_var_files = {}
811 
812  body_params = None
813  # Authentication setting
814  auth_settings = [] # noqa: E501
815 
816  return self.api_clientapi_client.call_api(
817  '/clusters/{cluster_id}/restart', 'PATCH',
818  path_params,
819  query_params,
820  header_params,
821  body=body_params,
822  post_params=form_params,
823  files=local_var_files,
824  response_type=None, # noqa: E501
825  auth_settings=auth_settings,
826  async_req=params.get('async_req'),
827  _return_http_data_only=params.get('_return_http_data_only'),
828  _preload_content=params.get('_preload_content', True),
829  _request_timeout=params.get('_request_timeout'),
830  collection_formats=collection_formats)
831 
832  def cf_manager_rest_api_update_node_of_cluster(self, image_id, username, password, cluster_id, node_id, **kwargs): # noqa: E501
833  """Reconfigure one FPGA node of an existing cluster # noqa: E501
834 
835  This method re-configures the given FPGA node in the given cluster. All settings remain the same and the runtime information of the cluster will be written to the updated instance again. The Roles of the other FPGA nodes are **not** reset during this method. If errors occur during this method, the other nodes of the cluster will be unaffected. **If this call fails with `507`** and the FPGA worked without any problems before, then the submitted image probably doesn't work (i.e. `507` doesn't imply a failure of the FPGA board). # noqa: E501
836  This method makes a synchronous HTTP request by default. To make an
837  asynchronous HTTP request, please pass async_req=True
838  >>> thread = api.cf_manager_rest_api_update_node_of_cluster(image_id, username, password, cluster_id, node_id, async_req=True)
839  >>> result = thread.get()
840 
841  :param async_req bool
842  :param str image_id: (required)
843  :param str username: OpenStack username (required)
844  :param str password: OpenStack password (required)
845  :param int cluster_id: ID of a cluster (required)
846  :param int node_id: ID of a node within a cluster (required)
847  :param int dont_verify_memory: If 1, don't verify the DDR4 memory during setup
848  :return: Cluster
849  If the method is called asynchronously,
850  returns the request thread.
851  """
852  kwargs['_return_http_data_only'] = True
853  if kwargs.get('async_req'):
854  return self.cf_manager_rest_api_update_node_of_cluster_with_http_infocf_manager_rest_api_update_node_of_cluster_with_http_info(image_id, username, password, cluster_id, node_id, **kwargs) # noqa: E501
855  else:
856  (data) = self.cf_manager_rest_api_update_node_of_cluster_with_http_infocf_manager_rest_api_update_node_of_cluster_with_http_info(image_id, username, password, cluster_id, node_id, **kwargs) # noqa: E501
857  return data
858 
859  def cf_manager_rest_api_update_node_of_cluster_with_http_info(self, image_id, username, password, cluster_id, node_id, **kwargs): # noqa: E501
860  """Reconfigure one FPGA node of an existing cluster # noqa: E501
861 
862  This method re-configures the given FPGA node in the given cluster. All settings remain the same and the runtime information of the cluster will be written to the updated instance again. The Roles of the other FPGA nodes are **not** reset during this method. If errors occur during this method, the other nodes of the cluster will be unaffected. **If this call fails with `507`** and the FPGA worked without any problems before, then the submitted image probably doesn't work (i.e. `507` doesn't imply a failure of the FPGA board). # noqa: E501
863  This method makes a synchronous HTTP request by default. To make an
864  asynchronous HTTP request, please pass async_req=True
865  >>> thread = api.cf_manager_rest_api_update_node_of_cluster_with_http_info(image_id, username, password, cluster_id, node_id, async_req=True)
866  >>> result = thread.get()
867 
868  :param async_req bool
869  :param str image_id: (required)
870  :param str username: OpenStack username (required)
871  :param str password: OpenStack password (required)
872  :param int cluster_id: ID of a cluster (required)
873  :param int node_id: ID of a node within a cluster (required)
874  :param int dont_verify_memory: If 1, don't verify the DDR4 memory during setup
875  :return: Cluster
876  If the method is called asynchronously,
877  returns the request thread.
878  """
879 
880  all_params = ['image_id', 'username', 'password', 'cluster_id', 'node_id', 'dont_verify_memory'] # noqa: E501
881  all_params.append('async_req')
882  all_params.append('_return_http_data_only')
883  all_params.append('_preload_content')
884  all_params.append('_request_timeout')
885 
886  params = locals()
887  for key, val in six.iteritems(params['kwargs']):
888  if key not in all_params:
889  raise TypeError(
890  "Got an unexpected keyword argument '%s'"
891  " to method cf_manager_rest_api_update_node_of_cluster" % key
892  )
893  params[key] = val
894  del params['kwargs']
895  # verify the required parameter 'image_id' is set
896  if ('image_id' not in params or
897  params['image_id'] is None):
898  raise ValueError("Missing the required parameter `image_id` when calling `cf_manager_rest_api_update_node_of_cluster`") # noqa: E501
899  # verify the required parameter 'username' is set
900  if ('username' not in params or
901  params['username'] is None):
902  raise ValueError("Missing the required parameter `username` when calling `cf_manager_rest_api_update_node_of_cluster`") # noqa: E501
903  # verify the required parameter 'password' is set
904  if ('password' not in params or
905  params['password'] is None):
906  raise ValueError("Missing the required parameter `password` when calling `cf_manager_rest_api_update_node_of_cluster`") # noqa: E501
907  # verify the required parameter 'cluster_id' is set
908  if ('cluster_id' not in params or
909  params['cluster_id'] is None):
910  raise ValueError("Missing the required parameter `cluster_id` when calling `cf_manager_rest_api_update_node_of_cluster`") # noqa: E501
911  # verify the required parameter 'node_id' is set
912  if ('node_id' not in params or
913  params['node_id'] is None):
914  raise ValueError("Missing the required parameter `node_id` when calling `cf_manager_rest_api_update_node_of_cluster`") # noqa: E501
915 
916  collection_formats = {}
917 
918  path_params = {}
919  if 'cluster_id' in params:
920  path_params['cluster_id'] = params['cluster_id'] # noqa: E501
921  if 'node_id' in params:
922  path_params['node_id'] = params['node_id'] # noqa: E501
923 
924  query_params = []
925  if 'username' in params:
926  query_params.append(('username', params['username'])) # noqa: E501
927  if 'password' in params:
928  query_params.append(('password', params['password'])) # noqa: E501
929  if 'dont_verify_memory' in params:
930  query_params.append(('dont_verify_memory', params['dont_verify_memory'])) # noqa: E501
931 
932  header_params = {}
933 
934  form_params = []
935  local_var_files = {}
936  if 'image_id' in params:
937  form_params.append(('image_id', params['image_id'])) # noqa: E501
938 
939  body_params = None
940  # HTTP header `Accept`
941  header_params['Accept'] = self.api_clientapi_client.select_header_accept(
942  ['application/json']) # noqa: E501
943 
944  # HTTP header `Content-Type`
945  header_params['Content-Type'] = self.api_clientapi_client.select_header_content_type( # noqa: E501
946  ['multipart/form-data']) # noqa: E501
947 
948  # Authentication setting
949  auth_settings = [] # noqa: E501
950 
951  return self.api_clientapi_client.call_api(
952  '/clusters/{cluster_id}/{node_id}', 'PUT',
953  path_params,
954  query_params,
955  header_params,
956  body=body_params,
957  post_params=form_params,
958  files=local_var_files,
959  response_type='Cluster', # noqa: E501
960  auth_settings=auth_settings,
961  async_req=params.get('async_req'),
962  _return_http_data_only=params.get('_return_http_data_only'),
963  _preload_content=params.get('_preload_content', True),
964  _request_timeout=params.get('_request_timeout'),
965  collection_formats=collection_formats)
def cf_manager_rest_api_post_clusters(self, body, username, password, **kwargs)
def cf_manager_rest_api_post_clusters_with_http_info(self, body, username, password, **kwargs)
def cf_manager_rest_api_get_cluster_single_with_http_info(self, username, password, cluster_id, **kwargs)
def cf_manager_rest_api_get_cluster_single(self, username, password, cluster_id, **kwargs)
def cf_manager_rest_api_extend_cluster(self, body, username, password, cluster_id, **kwargs)
def cf_manager_rest_api_delete_cluster_with_http_info(self, username, password, cluster_id, **kwargs)
Definition: clusters_api.py:58
def cf_manager_rest_api_reduce_cluster(self, body, username, password, cluster_id, **kwargs)
def cf_manager_rest_api_reduce_cluster_with_http_info(self, body, username, password, cluster_id, **kwargs)
def cf_manager_rest_api_update_node_of_cluster_with_http_info(self, image_id, username, password, cluster_id, node_id, **kwargs)
def cf_manager_rest_api_restart_cluster_with_http_info(self, username, password, cluster_id, **kwargs)
def cf_manager_rest_api_restart_cluster(self, username, password, cluster_id, **kwargs)
def cf_manager_rest_api_delete_cluster(self, username, password, cluster_id, **kwargs)
Definition: clusters_api.py:35
def cf_manager_rest_api_extend_cluster_with_http_info(self, body, username, password, cluster_id, **kwargs)
def cf_manager_rest_api_get_clusters(self, username, password, **kwargs)
def cf_manager_rest_api_update_node_of_cluster(self, image_id, username, password, cluster_id, node_id, **kwargs)
def cf_manager_rest_api_get_clusters_with_http_info(self, username, password, **kwargs)