Artem Panchenko | 0594cd7 | 2017-06-12 13:25:26 +0300 | [diff] [blame] | 1 | # Copyright 2017 Mirantis, Inc. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 4 | # not use this file except in compliance with the License. You may obtain |
| 5 | # a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | # License for the specific language governing permissions and limitations |
| 13 | |
| 14 | |
| 15 | from tcp_tests.managers.k8s.base import K8sBaseResource |
| 16 | from tcp_tests.managers.k8s.base import K8sBaseManager |
| 17 | |
| 18 | |
| 19 | class K8sComponentStatus(K8sBaseResource): |
Vladimir Jigulin | 4ad52a8 | 2018-08-12 05:51:30 +0400 | [diff] [blame] | 20 | resource_type = 'componentstatus' |
Artem Panchenko | 0594cd7 | 2017-06-12 13:25:26 +0300 | [diff] [blame] | 21 | |
Vladimir Jigulin | 4ad52a8 | 2018-08-12 05:51:30 +0400 | [diff] [blame] | 22 | def _read(self, **kwargs): |
| 23 | return self._manager.api.read_component_status(self.name, **kwargs) |
Artem Panchenko | 0594cd7 | 2017-06-12 13:25:26 +0300 | [diff] [blame] | 24 | |
| 25 | |
| 26 | class K8sComponentStatusManager(K8sBaseManager): |
Artem Panchenko | 0594cd7 | 2017-06-12 13:25:26 +0300 | [diff] [blame] | 27 | resource_class = K8sComponentStatus |
| 28 | |
Vladimir Jigulin | 4ad52a8 | 2018-08-12 05:51:30 +0400 | [diff] [blame] | 29 | @property |
| 30 | def api(self): |
| 31 | return self._cluster.api_core |
Artem Panchenko | 0594cd7 | 2017-06-12 13:25:26 +0300 | [diff] [blame] | 32 | |
Vladimir Jigulin | 4ad52a8 | 2018-08-12 05:51:30 +0400 | [diff] [blame] | 33 | def _list(self, namespace, **kwargs): |
| 34 | return self.api.list_component_status(**kwargs) |
| 35 | |
| 36 | def _list_all(self, **kwargs): |
| 37 | return self._list(None, **kwargs) |