File: constants.py

package info (click to toggle)
python-sushy 5.7.1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 3,036 kB
  • sloc: python: 16,382; makefile: 24; sh: 2
file content (188 lines) | stat: -rw-r--r-- 5,544 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

# Values comes from the Redfish System json-schema 1.0.0:
# http://redfish.dmtf.org/schemas/v1/Manager.v1_0_0.json#/definitions/Manager  # noqa

import enum

from sushy.resources import constants as res_cons

# Manager Reset action constants

RESET_MANAGER_GRACEFUL_RESTART = res_cons.ResetType.GRACEFUL_RESTART
"""Perform a graceful shutdown followed by a restart of the system"""

RESET_MANAGER_FORCE_RESTART = res_cons.ResetType.FORCE_RESTART
"""Perform an immediate (non-graceful) shutdown, followed by a restart"""


class ManagerType(enum.Enum):
    """Manager Type constants"""

    MANAGEMENT_CONTROLLER = 'ManagementController'
    """A controller that primarily monitors or manages the operation of a
    device or system."""

    ENCLOSURE_MANAGER = 'EnclosureManager'
    """A controller that provides management functions for a chassis or
    group of devices or systems."""

    BMC = 'BMC'
    """A controller that provides management functions for a single computer
    system."""

    RACK_MANAGER = 'RackManager'
    """A controller that provides management functions for a whole or part
    of a rack."""

    AUXILIARY_CONTROLLER = 'AuxiliaryController'
    """A controller that provides management functions for a particular
    subsystem or group of devices."""

    SERVICE = 'Service'
    """A software-based service that provides management functions."""


# Backward compatibility
MANAGER_TYPE_MANAGEMENT_CONTROLLER = ManagerType.MANAGEMENT_CONTROLLER
MANAGER_TYPE_ENCLOSURE_MANAGER = ManagerType.ENCLOSURE_MANAGER
MANAGER_TYPE_BMC = ManagerType.BMC
MANAGER_TYPE_RACK_MANAGER = ManagerType.RACK_MANAGER
MANAGER_TYPE_AUXILIARY_CONTROLLER = ManagerType.AUXILIARY_CONTROLLER


class GraphicalConnectType(enum.Enum):
    """Graphical Console constants"""

    KVMIP = 'KVMIP'
    """The controller supports a graphical console connection through a KVM-
    IP (redirection of Keyboard, Video, Mouse over IP) protocol."""

    OEM = 'Oem'
    """The controller supports a graphical console connection through an
    OEM-specific protocol."""


# Backward compatibility
GRAPHICAL_CONSOLE_KVMIP = GraphicalConnectType.KVMIP
GRAPHICAL_CONSOLE_OEM = GraphicalConnectType.OEM


class SerialConnectType(enum.Enum):
    """Serial Console constants"""

    SSH = 'SSH'
    """The controller supports a serial console connection through the SSH
    protocol."""

    TELNET = 'Telnet'
    """The controller supports a serial console connection through the
    Telnet protocol."""

    IPMI = 'IPMI'
    """The controller supports a serial console connection through the IPMI
    Serial Over LAN (SOL) protocol."""

    OEM = 'Oem'
    """The controller supports a serial console connection through an OEM-
    specific protocol."""


# Backward compatibility
SERIAL_CONSOLE_SSH = SerialConnectType.SSH
SERIAL_CONSOLE_TELNET = SerialConnectType.TELNET
SERIAL_CONSOLE_IPMI = SerialConnectType.IPMI
SERIAL_CONSOLE_OEM = SerialConnectType.OEM


class CommandConnectType(enum.Enum):
    """Command Shell constants"""

    SSH = 'SSH'
    """The controller supports a command shell connection through the SSH
    protocol."""

    TELNET = 'Telnet'
    """The controller supports a command shell connection through the Telnet
    protocol."""

    IPMI = 'IPMI'
    """The controller supports a command shell connection through the IPMI
    Serial Over LAN (SOL) protocol."""

    OEM = 'Oem'
    """The controller supports a command shell connection through an OEM-
    specific protocol."""


# Backward compatibility
COMMAND_SHELL_SSH = CommandConnectType.SSH
COMMAND_SHELL_TELNET = CommandConnectType.TELNET
COMMAND_SHELL_IPMI = CommandConnectType.IPMI
COMMAND_SHELL_OEM = CommandConnectType.OEM


class VirtualMediaType(enum.Enum):
    """Supported Virtual Media Type constants"""

    CD = 'CD'
    """A CD-ROM format (ISO) image."""

    FLOPPY = 'Floppy'
    """A floppy disk image."""

    USB_STICK = 'USBStick'
    """An emulation of a USB storage device."""

    DVD = 'DVD'
    """A DVD-ROM format image."""


# Backward compatibility
VIRTUAL_MEDIA_CD = VirtualMediaType.CD
VIRTUAL_MEDIA_DVD = VirtualMediaType.DVD
VIRTUAL_MEDIA_FLOPPY = VirtualMediaType.FLOPPY
VIRTUAL_MEDIA_USBSTICK = VirtualMediaType.USB_STICK


class ConnectedVia(enum.Enum):
    """Connected Via constants"""

    NOT_CONNECTED = 'NotConnected'
    """No current connection."""

    URI = 'URI'
    """Connected to a URI location."""

    APPLET = 'Applet'
    """Connected to a client application."""

    OEM = 'Oem'
    """Connected through an OEM-defined method."""


# Backward compatibility
CONNECTED_VIA_NOT_CONNECTED = ConnectedVia.NOT_CONNECTED
CONNECTED_VIA_URI = ConnectedVia.URI
CONNECTED_VIA_APPLET = ConnectedVia.APPLET
CONNECTED_VIA_OEM = ConnectedVia.OEM


class TransferMethod(enum.Enum):
    """Transfer methods"""

    STREAM = 'Stream'
    """Stream image file data from the source URI."""

    UPLOAD = 'Upload'
    """Upload the entire image file from the source URI to the service."""