version.py 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #
  2. # Copyright 2021 The FATE Authors. All Rights Reserved.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. #
  16. from flow_sdk.client.api.base import BaseFlowAPI
  17. class Version(BaseFlowAPI):
  18. def api(self):
  19. return self._post(url='version/get').get('data', {}).get('API')
  20. def fate(self):
  21. return self._post(url='version/get', json={'module': 'FATE'}).get('data', {}).get('FATE')
  22. def fate_flow(self):
  23. return self._post(url='version/get', json={'module': 'FATEFlow'}).get('data', {}).get('FATEFlow')
  24. def fate_board(self):
  25. return self._post(url='version/get', json={'module': 'FATEBoard'}).get('data', {}).get('FATEBoard')
  26. def centos(self):
  27. return self._post(url='version/get', json={'module': 'CENTOS'}).get('data', {}).get('CENTOS')
  28. def ubuntu(self):
  29. return self._post(url='version/get', json={'module': 'UBUNTU'}).get('data', {}).get('UBUNTU')
  30. def python(self):
  31. return self._post(url='version/get', json={'module': 'PYTHON'}).get('data', {}).get('PYTHON')
  32. def jdk(self):
  33. return self._post(url='version/get', json={'module': 'JDK'}).get('data', {}).get('JDK')
  34. def maven(self):
  35. return self._post(url='version/get', json={'module': 'MAVEN'}).get('data', {}).get('MAVEN')
  36. def eggroll(self):
  37. return self._post(url='version/get', json={'module': 'EGGROLL'}).get('data', {}).get('EGGROLL')
  38. def spark(self):
  39. return self._post(url='version/get', json={'module': 'SPARK'}).get('data', {}).get('SPARK')