1
# Licensed under the Apache License, Version 2.0 (the "License"); you may
2
# not use this file except in compliance with the License. You may obtain
3
# a copy of the License at
5
# http://www.apache.org/licenses/LICENSE-2.0
7
# Unless required by applicable law or agreed to in writing, software
8
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10
# License for the specific language governing permissions and limitations
17
from seamicroclient import base
20
class System(base.Resource):
23
def switchover(self, mxcard=None, **kwargs):
24
return self.manager.switchover(self, mxcard, **kwargs)
26
def writemem(self, **kwargs):
27
return self.manager.writemem(self, **kwargs)
30
class SystemManager(base.ManagerWithFind):
31
resource_class = System
33
def list(self, filters=None):
35
Get a list of system properties.
37
:rtype: list of :class:`System`
39
return self._list("/chassis/systems", filters=filters)
41
def switchover(self, system, mxcard=None, **kwargs):
43
Switchover system to different mxcard
45
url = "/chassis/system/switchover"
47
if mxcard is not None:
48
body = {'newActive': mxcard}
49
return self.api.client.put(url, body=body)
51
def writemem(self, system, **kwargs):
53
Write current system config to flash memory
54
This will persist even after reboot of chassis
56
url = "/chassis/system/writeMem"
57
return self.api.client.put(url, body={})
59
def reload(self, system, **kwargs):
61
Reload the chassis and start the boot image
63
url = "/chassis/system/reload"
64
return self.api.client.put(url, body={})