We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1608c9f commit f856db3Copy full SHA for f856db3
SoftLayer/CLI/hardware/toggle_ipmi.py
@@ -0,0 +1,23 @@
1
+"""Toggle the IPMI interface on and off."""
2
+# :license: MIT, see LICENSE for more details.
3
+
4
+import click
5
6
+import SoftLayer
7
+from SoftLayer.CLI import environment
8
+from SoftLayer.CLI import helpers
9
10
11
+@click.command()
12
+@click.argument('identifier')
13
+@click.option('--enabled',
14
+ type=click.BOOL,
15
+ help="Whether to enable or disable the interface.")
16
+@environment.pass_env
17
+def cli(env, identifier, enabled):
18
+ """Toggle the IPMI interface on and off"""
19
20
+ mgr = SoftLayer.HardwareManager(env.client)
21
+ hw_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'hardware')
22
+ result = env.client['Hardware_Server'].toggleManagementInterface(enabled, id=hw_id)
23
+ env.fout(result)
0 commit comments