redfish-python-sdk 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- redfish_python_sdk-1.0.0.dist-info/METADATA +164 -0
- redfish_python_sdk-1.0.0.dist-info/RECORD +56 -0
- redfish_python_sdk-1.0.0.dist-info/WHEEL +5 -0
- redfish_python_sdk-1.0.0.dist-info/licenses/LICENSE +29 -0
- redfish_python_sdk-1.0.0.dist-info/top_level.txt +1 -0
- redfish_sdk/__init__.py +63 -0
- redfish_sdk/client.py +1894 -0
- redfish_sdk/exceptions.py +56 -0
- redfish_sdk/http_client.py +452 -0
- redfish_sdk/managers/__init__.py +21 -0
- redfish_sdk/managers/_log_helpers.py +144 -0
- redfish_sdk/managers/account.py +96 -0
- redfish_sdk/managers/chassis.py +327 -0
- redfish_sdk/managers/event.py +264 -0
- redfish_sdk/managers/managers.py +120 -0
- redfish_sdk/managers/registries.py +48 -0
- redfish_sdk/managers/session.py +130 -0
- redfish_sdk/managers/systems.py +630 -0
- redfish_sdk/managers/task.py +89 -0
- redfish_sdk/managers/update.py +99 -0
- redfish_sdk/managers/update_strategies/__init__.py +51 -0
- redfish_sdk/managers/update_strategies/base.py +101 -0
- redfish_sdk/managers/update_strategies/h3c.py +140 -0
- redfish_sdk/managers/update_strategies/inspur.py +89 -0
- redfish_sdk/managers/update_strategies/lenovo.py +59 -0
- redfish_sdk/managers/update_strategies/nettrix.py +56 -0
- redfish_sdk/managers/update_strategies/registry.py +72 -0
- redfish_sdk/managers/update_strategies/vendor_detect.py +111 -0
- redfish_sdk/managers/update_strategies/xfusion.py +60 -0
- redfish_sdk/managers/update_strategies/zte.py +68 -0
- redfish_sdk/models/__init__.py +55 -0
- redfish_sdk/models/account.py +60 -0
- redfish_sdk/models/chassis.py +86 -0
- redfish_sdk/models/check.py +231 -0
- redfish_sdk/models/common.py +102 -0
- redfish_sdk/models/drive.py +53 -0
- redfish_sdk/models/event.py +64 -0
- redfish_sdk/models/fru.py +59 -0
- redfish_sdk/models/gpu.py +33 -0
- redfish_sdk/models/logs.py +56 -0
- redfish_sdk/models/managers.py +153 -0
- redfish_sdk/models/memory.py +50 -0
- redfish_sdk/models/network_adapter.py +76 -0
- redfish_sdk/models/oem.py +173 -0
- redfish_sdk/models/pcie_device.py +89 -0
- redfish_sdk/models/power.py +92 -0
- redfish_sdk/models/processor.py +50 -0
- redfish_sdk/models/registry.py +34 -0
- redfish_sdk/models/resource_key.py +70 -0
- redfish_sdk/models/root.py +50 -0
- redfish_sdk/models/session.py +42 -0
- redfish_sdk/models/storage.py +77 -0
- redfish_sdk/models/systems.py +194 -0
- redfish_sdk/models/task.py +54 -0
- redfish_sdk/models/thermal.py +111 -0
- redfish_sdk/models/update.py +55 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Processor (CPU) component models.
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from typing import Any, Optional
|
|
8
|
+
|
|
9
|
+
from pydantic import BaseModel, ConfigDict
|
|
10
|
+
|
|
11
|
+
from .check import Field
|
|
12
|
+
from .common import Entity, Link, Status
|
|
13
|
+
from .oem import Oem
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class ProcessorId(BaseModel):
|
|
17
|
+
"""CPU identification fields."""
|
|
18
|
+
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
19
|
+
|
|
20
|
+
effective_family: Optional[str] = Field(None, alias="EffectiveFamily")
|
|
21
|
+
effective_model: Optional[str] = Field(None, alias="EffectiveModel")
|
|
22
|
+
identification_registers: Optional[str] = Field(None, alias="IdentificationRegisters")
|
|
23
|
+
microcode_info: Optional[str] = Field(None, alias="MicrocodeInfo")
|
|
24
|
+
step: Optional[str] = Field(None, alias="Step")
|
|
25
|
+
vendor_id: Optional[str] = Field(None, alias="VendorId")
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class Processor(Entity):
|
|
29
|
+
"""
|
|
30
|
+
Represents a CPU/processor resource.
|
|
31
|
+
Endpoint: /redfish/v1/Systems/{systemId}/Processors/{processorId}
|
|
32
|
+
|
|
33
|
+
"""
|
|
34
|
+
instruction_set: Optional[str] = Field(None, alias="InstructionSet")
|
|
35
|
+
manufacturer: Optional[str] = Field(None, alias="Manufacturer", validate="required,type=str")
|
|
36
|
+
max_speed_mhz: Optional[int] = Field(None, alias="MaxSpeedMHz", validate="type=int,gt=0")
|
|
37
|
+
model: Optional[str] = Field(None, alias="Model", validate="required,type=str")
|
|
38
|
+
operating_speed_mhz: Optional[int] = Field(None, alias="OperatingSpeedMHz")
|
|
39
|
+
processor_architecture: Optional[str] = Field(None, alias="ProcessorArchitecture")
|
|
40
|
+
processor_id: Optional[ProcessorId] = Field(None, alias="ProcessorId")
|
|
41
|
+
processor_type: Optional[str] = Field(None, alias="ProcessorType", validate="type=str")
|
|
42
|
+
socket: Optional[Any] = Field(None, alias="Socket")
|
|
43
|
+
total_cores: Optional[int] = Field(None, alias="TotalCores", validate="required,type=int,gt=0")
|
|
44
|
+
total_threads: Optional[int] = Field(None, alias="TotalThreads", validate="required,type=int,gt=0,gte_field=total_cores")
|
|
45
|
+
max_tdp_watts: Optional[int] = Field(None, alias="MaxTDPWatts")
|
|
46
|
+
tdp_watts: Optional[int] = Field(None, alias="TDPWatts")
|
|
47
|
+
serial_number: Optional[str] = Field(None, alias="SerialNumber")
|
|
48
|
+
status: Optional[Status] = Field(None, alias="Status", validate="status")
|
|
49
|
+
oem: Optional[Oem] = Field(None, alias="Oem")
|
|
50
|
+
environment_metrics: Optional[Link] = Field(None, alias="EnvironmentMetrics")
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Registry models.
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from typing import List, Optional
|
|
8
|
+
|
|
9
|
+
from pydantic import Field
|
|
10
|
+
|
|
11
|
+
from .common import Entity
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class Registry(Entity):
|
|
15
|
+
"""
|
|
16
|
+
Represents a Redfish message registry.
|
|
17
|
+
Endpoint: /redfish/v1/Registries/{registryId}
|
|
18
|
+
|
|
19
|
+
Message registries contain descriptions of all possible messages the BMC may generate.
|
|
20
|
+
"""
|
|
21
|
+
languages: Optional[List[str]] = Field(None, alias="Languages")
|
|
22
|
+
location: Optional[List[RegistryLocation]] = Field(None, alias="Location")
|
|
23
|
+
owning_entity: Optional[str] = Field(None, alias="OwningEntity")
|
|
24
|
+
registry_prefix: Optional[str] = Field(None, alias="RegistryPrefix")
|
|
25
|
+
registry_version: Optional[str] = Field(None, alias="RegistryVersion")
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class RegistryLocation(Entity):
|
|
29
|
+
"""Location info for a registry file."""
|
|
30
|
+
archive_file: Optional[str] = Field(None, alias="ArchiveFile")
|
|
31
|
+
archive_uri: Optional[str] = Field(None, alias="ArchiveUri")
|
|
32
|
+
language: Optional[str] = Field(None, alias="Language")
|
|
33
|
+
publication_uri: Optional[str] = Field(None, alias="PublicationUri")
|
|
34
|
+
uri: Optional[str] = Field(None, alias="Uri")
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Redfish resource key enumeration.
|
|
3
|
+
|
|
4
|
+
Defines all known Redfish resource names as enum members,
|
|
5
|
+
enabling IDE auto-completion and preventing typo errors.
|
|
6
|
+
"""
|
|
7
|
+
from enum import Enum
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class RedfishResource(str, Enum):
|
|
11
|
+
"""
|
|
12
|
+
Redfish 资源标识枚举。
|
|
13
|
+
|
|
14
|
+
值(value)对应 Redfish JSON 中的字段名(即 @odata.id 的 key)。
|
|
15
|
+
按所属层级分组。
|
|
16
|
+
|
|
17
|
+
Usage::
|
|
18
|
+
|
|
19
|
+
from redfish_sdk import RedfishClient, RedfishResource
|
|
20
|
+
|
|
21
|
+
client = RedfishClient(host="10.0.0.1", username="admin", password="pwd")
|
|
22
|
+
processors_url = client.get_odata_id(RedfishResource.PROCESSORS)
|
|
23
|
+
# → "/redfish/v1/Systems/1/Processors"
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
# ── RootService 层 (/redfish/v1/) ──
|
|
27
|
+
SYSTEMS = "Systems"
|
|
28
|
+
CHASSIS = "Chassis"
|
|
29
|
+
MANAGERS = "Managers"
|
|
30
|
+
ACCOUNT_SERVICE = "AccountService"
|
|
31
|
+
SESSION_SERVICE = "SessionService"
|
|
32
|
+
EVENT_SERVICE = "EventService"
|
|
33
|
+
UPDATE_SERVICE = "UpdateService"
|
|
34
|
+
TASK_SERVICE = "TaskService"
|
|
35
|
+
CERTIFICATE_SERVICE = "CertificateService"
|
|
36
|
+
REGISTRIES = "Registries"
|
|
37
|
+
JSON_SCHEMAS = "JsonSchemas"
|
|
38
|
+
KEY_SERVICE = "KeyService"
|
|
39
|
+
COMPONENT_INTEGRITY = "ComponentIntegrity"
|
|
40
|
+
|
|
41
|
+
# ── System 层 (/redfish/v1/Systems/{id}) ──
|
|
42
|
+
PROCESSORS = "Processors"
|
|
43
|
+
MEMORY = "Memory"
|
|
44
|
+
STORAGE = "Storage"
|
|
45
|
+
BIOS = "Bios"
|
|
46
|
+
ETHERNET_INTERFACES = "EthernetInterfaces"
|
|
47
|
+
GRAPHICS_CONTROLLERS = "GraphicsControllers"
|
|
48
|
+
LOG_SERVICES = "LogServices"
|
|
49
|
+
NETWORK_INTERFACES = "NetworkInterfaces"
|
|
50
|
+
SECURE_BOOT = "SecureBoot"
|
|
51
|
+
SIMPLE_STORAGE = "SimpleStorage"
|
|
52
|
+
USB_CONTROLLERS = "USBControllers"
|
|
53
|
+
VIRTUAL_MEDIA = "VirtualMedia"
|
|
54
|
+
CERTIFICATES = "Certificates"
|
|
55
|
+
BOOT_OPTIONS = "BootOptions"
|
|
56
|
+
|
|
57
|
+
# ── Chassis 层 (/redfish/v1/Chassis/{id}) ──
|
|
58
|
+
THERMAL = "Thermal"
|
|
59
|
+
POWER = "Power"
|
|
60
|
+
DRIVES = "Drives"
|
|
61
|
+
NETWORK_ADAPTERS = "NetworkAdapters"
|
|
62
|
+
PCIE_DEVICES = "PCIeDevices"
|
|
63
|
+
SENSORS = "Sensors"
|
|
64
|
+
|
|
65
|
+
# ── Manager 层 (/redfish/v1/Managers/{id}) ──
|
|
66
|
+
NETWORK_PROTOCOL = "NetworkProtocol"
|
|
67
|
+
HOST_INTERFACES = "HostInterfaces"
|
|
68
|
+
SERIAL_INTERFACES = "SerialInterfaces"
|
|
69
|
+
DEDICATED_NETWORK_PORTS = "DedicatedNetworkPorts"
|
|
70
|
+
SECURITY_POLICY = "SecurityPolicy"
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Root service model.
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from typing import Optional
|
|
8
|
+
|
|
9
|
+
from pydantic import Field
|
|
10
|
+
|
|
11
|
+
from .common import Entity, Link
|
|
12
|
+
from .oem import Oem
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class RootService(Entity):
|
|
16
|
+
"""
|
|
17
|
+
The root Redfish service endpoint (/redfish/v1/).
|
|
18
|
+
Acts as the entry point and service index — contains links to all top-level resources.
|
|
19
|
+
|
|
20
|
+
"""
|
|
21
|
+
redfish_version: Optional[str] = Field(None, alias="RedfishVersion")
|
|
22
|
+
vendor: Optional[str] = Field(None, alias="Vendor")
|
|
23
|
+
product: Optional[str] = Field(None, alias="Product")
|
|
24
|
+
uuid: Optional[str] = Field(None, alias="UUID")
|
|
25
|
+
|
|
26
|
+
# Top-level resource links
|
|
27
|
+
account_service: Optional[Link] = Field(None, alias="AccountService")
|
|
28
|
+
task_service: Optional[Link] = Field(None, alias="TaskService")
|
|
29
|
+
certificate_service: Optional[Link] = Field(None, alias="CertificateService")
|
|
30
|
+
chassis: Optional[Link] = Field(None, alias="Chassis")
|
|
31
|
+
component_integrity: Optional[Link] = Field(None, alias="ComponentIntegrity")
|
|
32
|
+
event_service: Optional[Link] = Field(None, alias="EventService")
|
|
33
|
+
session_service: Optional[Link] = Field(None, alias="SessionService")
|
|
34
|
+
tasks: Optional[Link] = Field(None, alias="Tasks")
|
|
35
|
+
systems: Optional[Link] = Field(None, alias="Systems")
|
|
36
|
+
update_service: Optional[Link] = Field(None, alias="UpdateService")
|
|
37
|
+
key_service: Optional[Link] = Field(None, alias="KeyService")
|
|
38
|
+
managers: Optional[Link] = Field(None, alias="Managers")
|
|
39
|
+
registries: Optional[Link] = Field(None, alias="Registries")
|
|
40
|
+
json_schemas: Optional[Link] = Field(None, alias="JsonSchemas")
|
|
41
|
+
|
|
42
|
+
# Links section (contains Sessions link)
|
|
43
|
+
links: Optional[RootLinks] = Field(None, alias="Links")
|
|
44
|
+
|
|
45
|
+
oem: Optional[Oem] = Field(None, alias="Oem")
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class RootLinks(Entity):
|
|
49
|
+
"""Links section within RootService, contains the Sessions direct link."""
|
|
50
|
+
sessions: Optional[Link] = Field(None, alias="Sessions")
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Session service models.
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from typing import Optional
|
|
8
|
+
|
|
9
|
+
from pydantic import Field
|
|
10
|
+
|
|
11
|
+
from .common import Entity, Link, Status
|
|
12
|
+
from .oem import Oem
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class SessionService(Entity):
|
|
16
|
+
"""
|
|
17
|
+
The Session service manages client sessions.
|
|
18
|
+
Endpoint: /redfish/v1/SessionService
|
|
19
|
+
"""
|
|
20
|
+
sessions: Optional[Link] = Field(None, alias="Sessions")
|
|
21
|
+
service_enabled: Optional[bool] = Field(None, alias="ServiceEnabled")
|
|
22
|
+
session_timeout: Optional[int] = Field(None, alias="SessionTimeout")
|
|
23
|
+
status: Optional[Status] = Field(None, alias="Status")
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class Session(Entity):
|
|
27
|
+
"""
|
|
28
|
+
Represents a single active session between a client and the Redfish service.
|
|
29
|
+
Endpoint: /redfish/v1/SessionService/Sessions/{sessionId}
|
|
30
|
+
|
|
31
|
+
After creation, the response contains the X-Auth-Token in the response header
|
|
32
|
+
(not in the JSON body). The SDK automatically extracts and stores this token.
|
|
33
|
+
|
|
34
|
+
"""
|
|
35
|
+
oem_session_type: Optional[str] = Field(None, alias="OemSessionType")
|
|
36
|
+
password: Optional[str] = Field(None, alias="Password")
|
|
37
|
+
session_type: Optional[str] = Field(None, alias="SessionType")
|
|
38
|
+
user_name: Optional[str] = Field(None, alias="UserName")
|
|
39
|
+
oem: Optional[Oem] = Field(None, alias="Oem")
|
|
40
|
+
|
|
41
|
+
# Populated by the SDK after session creation (from X-Auth-Token response header)
|
|
42
|
+
x_auth_token: Optional[str] = Field(None, exclude=True)
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Storage component models.
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from typing import List, Optional
|
|
8
|
+
|
|
9
|
+
from pydantic import BaseModel, ConfigDict
|
|
10
|
+
|
|
11
|
+
from .check import Field
|
|
12
|
+
from .common import Entity, Link, Status
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class CacheSummary(BaseModel):
|
|
16
|
+
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
17
|
+
|
|
18
|
+
persistent_cache_size_mib: Optional[int] = Field(None, alias="PersistentCacheSizeMiB")
|
|
19
|
+
total_cache_size_mib: Optional[int] = Field(None, alias="TotalCacheSizeMiB")
|
|
20
|
+
status: Optional[Status] = Field(None, alias="Status")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class Identifier(BaseModel):
|
|
24
|
+
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
25
|
+
|
|
26
|
+
durable_name: Optional[str] = Field(None, alias="DurableName")
|
|
27
|
+
durable_name_format: Optional[str] = Field(None, alias="DurableNameFormat")
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class StorageController(BaseModel):
|
|
31
|
+
"""Embedded storage controller info within a Storage resource."""
|
|
32
|
+
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
33
|
+
|
|
34
|
+
odata_id: Optional[str] = Field(None, alias="@odata.id")
|
|
35
|
+
cache_summary: Optional[CacheSummary] = Field(None, alias="CacheSummary")
|
|
36
|
+
firmware_version: Optional[str] = Field(None, alias="FirmwareVersion")
|
|
37
|
+
identifiers: Optional[List[Identifier]] = Field(None, alias="Identifiers")
|
|
38
|
+
manufacturer: Optional[str] = Field(None, alias="Manufacturer")
|
|
39
|
+
member_id: Optional[str] = Field(None, alias="MemberId")
|
|
40
|
+
model: Optional[str] = Field(None, alias="Model")
|
|
41
|
+
name: Optional[str] = Field(None, alias="Name")
|
|
42
|
+
part_number: Optional[str] = Field(None, alias="PartNumber")
|
|
43
|
+
serial_number: Optional[str] = Field(None, alias="SerialNumber")
|
|
44
|
+
speed_gbps: Optional[int] = Field(None, alias="SpeedGbps")
|
|
45
|
+
status: Optional[Status] = Field(None, alias="Status")
|
|
46
|
+
supported_controller_protocols: Optional[List[str]] = Field(
|
|
47
|
+
None, alias="SupportedControllerProtocols"
|
|
48
|
+
)
|
|
49
|
+
supported_device_protocols: Optional[List[str]] = Field(
|
|
50
|
+
None, alias="SupportedDeviceProtocols"
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class Storage(Entity):
|
|
55
|
+
"""
|
|
56
|
+
Represents a storage controller.
|
|
57
|
+
Endpoint: /redfish/v1/Systems/{systemId}/Storage/{storageId}
|
|
58
|
+
|
|
59
|
+
"""
|
|
60
|
+
drives: Optional[List[Link]] = Field(None, alias="Drives", validate="list")
|
|
61
|
+
storage_controllers: Optional[List[StorageController]] = Field(
|
|
62
|
+
None, alias="StorageControllers", validate="list"
|
|
63
|
+
)
|
|
64
|
+
volumes: Optional[Link] = Field(None, alias="Volumes")
|
|
65
|
+
status: Optional[Status] = Field(None, alias="Status", validate="status")
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class Volume(Entity):
|
|
69
|
+
"""
|
|
70
|
+
Represents a storage volume.
|
|
71
|
+
Endpoint: /redfish/v1/Systems/{systemId}/Storage/{storageId}/Volumes/{volumeId}
|
|
72
|
+
"""
|
|
73
|
+
volume_type: Optional[str] = Field(None, alias="VolumeType")
|
|
74
|
+
capacity_bytes: Optional[int] = Field(None, alias="CapacityBytes")
|
|
75
|
+
status: Optional[Status] = Field(None, alias="Status")
|
|
76
|
+
raid_type: Optional[str] = Field(None, alias="RAIDType")
|
|
77
|
+
optimum_io_size_bytes: Optional[int] = Field(None, alias="OptimumIOSizeBytes")
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Systems resource models.
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from typing import Any, List, Optional
|
|
8
|
+
|
|
9
|
+
from pydantic import BaseModel, ConfigDict
|
|
10
|
+
|
|
11
|
+
from .check import Field
|
|
12
|
+
from .common import Entity, Link, Status
|
|
13
|
+
from .gpu import Gpu, GpuOEM # noqa: F401
|
|
14
|
+
from .memory import Memory, MemoryLocation # noqa: F401
|
|
15
|
+
from .oem import Oem
|
|
16
|
+
|
|
17
|
+
# ---------------------------------------------------------------------------
|
|
18
|
+
# Re-export component models for backward compatibility
|
|
19
|
+
# ---------------------------------------------------------------------------
|
|
20
|
+
from .processor import Processor, ProcessorId # noqa: F401
|
|
21
|
+
from .storage import ( # noqa: F401
|
|
22
|
+
CacheSummary,
|
|
23
|
+
Identifier,
|
|
24
|
+
Storage,
|
|
25
|
+
StorageController,
|
|
26
|
+
Volume,
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
# ---------------------------------------------------------------------------
|
|
30
|
+
# Boot
|
|
31
|
+
# ---------------------------------------------------------------------------
|
|
32
|
+
|
|
33
|
+
class Boot(BaseModel):
|
|
34
|
+
"""
|
|
35
|
+
Boot configuration for a system.
|
|
36
|
+
Controls boot source override (e.g., PXE, HDD, CD-ROM).
|
|
37
|
+
"""
|
|
38
|
+
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
39
|
+
|
|
40
|
+
boot_options: Optional[Link] = Field(None, alias="BootOptions")
|
|
41
|
+
boot_source_override_enabled: Optional[str] = Field(None, alias="BootSourceOverrideEnabled")
|
|
42
|
+
boot_source_override_mode: Optional[str] = Field(None, alias="BootSourceOverrideMode")
|
|
43
|
+
boot_source_override_target: Optional[str] = Field(None, alias="BootSourceOverrideTarget")
|
|
44
|
+
uefi_target_boot_source_override: Optional[str] = Field(None, alias="UefiTargetBootSourceOverride")
|
|
45
|
+
allowable_values: Optional[List[str]] = Field(
|
|
46
|
+
None, alias="BootSourceOverrideTarget@Redfish.AllowableValues"
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
class BootSetting(BaseModel):
|
|
51
|
+
"""Request body for changing boot source via PATCH /redfish/v1/Systems/{id}."""
|
|
52
|
+
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
53
|
+
|
|
54
|
+
boot_source_override_enabled: Optional[str] = Field(None, alias="BootSourceOverrideEnabled")
|
|
55
|
+
boot_source_override_mode: Optional[str] = Field(None, alias="BootSourceOverrideMode")
|
|
56
|
+
boot_source_override_target: Optional[str] = Field(None, alias="BootSourceOverrideTarget")
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class SystemPatchSetting(BaseModel):
|
|
60
|
+
"""PATCH request body for system-level settings (e.g., boot source)."""
|
|
61
|
+
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
62
|
+
|
|
63
|
+
boot: Optional[BootSetting] = Field(None, alias="Boot")
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
# ---------------------------------------------------------------------------
|
|
67
|
+
# BootOption
|
|
68
|
+
# ---------------------------------------------------------------------------
|
|
69
|
+
|
|
70
|
+
class BootOption(Entity):
|
|
71
|
+
"""
|
|
72
|
+
A single boot option entry in the BootOptions collection.
|
|
73
|
+
Endpoint: /redfish/v1/Systems/{id}/BootOptions/{optionId}
|
|
74
|
+
|
|
75
|
+
Distinct from the legacy Boot/BootSourceOverrideTarget model: modern BMCs
|
|
76
|
+
expose a per-option resource that can be enabled/disabled individually.
|
|
77
|
+
"""
|
|
78
|
+
boot_option_reference: Optional[str] = Field(None, alias="BootOptionReference")
|
|
79
|
+
boot_option_enabled: Optional[bool] = Field(None, alias="BootOptionEnabled")
|
|
80
|
+
uefi_device_path: Optional[str] = Field(None, alias="UefiDevicePath")
|
|
81
|
+
display_name: Optional[str] = Field(None, alias="DisplayName")
|
|
82
|
+
alias: Optional[str] = Field(None, alias="Alias")
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
class BootOptionPatchSetting(BaseModel):
|
|
86
|
+
"""PATCH request body for toggling a single BootOption.BootOptionEnabled."""
|
|
87
|
+
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
88
|
+
|
|
89
|
+
boot_option_enabled: Optional[bool] = Field(None, alias="BootOptionEnabled")
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
# ---------------------------------------------------------------------------
|
|
93
|
+
# Actions
|
|
94
|
+
# ---------------------------------------------------------------------------
|
|
95
|
+
|
|
96
|
+
class ResetAction(BaseModel):
|
|
97
|
+
"""Describes the Reset action target and allowable values."""
|
|
98
|
+
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
99
|
+
|
|
100
|
+
target: Optional[str] = Field(None, alias="target")
|
|
101
|
+
reset_type_allowable_values: Optional[List[str]] = Field(
|
|
102
|
+
None, alias="ResetType@Redfish.AllowableValues"
|
|
103
|
+
)
|
|
104
|
+
action_info: Optional[str] = Field(None, alias="@Redfish.ActionInfo")
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
class SystemActions(BaseModel):
|
|
108
|
+
"""Actions available on a system resource (e.g., Reset)."""
|
|
109
|
+
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
110
|
+
|
|
111
|
+
computer_system_reset: Optional[ResetAction] = Field(
|
|
112
|
+
None, alias="#ComputerSystem.Reset"
|
|
113
|
+
)
|
|
114
|
+
reset_type_allowable_values: Optional[List[str]] = Field(
|
|
115
|
+
None, alias="ResetType@Redfish.AllowableValues"
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
# ---------------------------------------------------------------------------
|
|
120
|
+
# System Links
|
|
121
|
+
# ---------------------------------------------------------------------------
|
|
122
|
+
|
|
123
|
+
class SystemLinks(BaseModel):
|
|
124
|
+
"""Links section within a System resource."""
|
|
125
|
+
model_config = ConfigDict(populate_by_name=True, extra="allow")
|
|
126
|
+
|
|
127
|
+
chassis: Optional[List[Link]] = Field(None, alias="Chassis")
|
|
128
|
+
pcie_devices: Optional[List[Link]] = Field(None, alias="PCIeDevices")
|
|
129
|
+
managed_by: Optional[List[Link]] = Field(None, alias="ManagedBy")
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
# ---------------------------------------------------------------------------
|
|
133
|
+
# System
|
|
134
|
+
# ---------------------------------------------------------------------------
|
|
135
|
+
|
|
136
|
+
class System(Entity):
|
|
137
|
+
"""
|
|
138
|
+
Represents a single computer system (physical server).
|
|
139
|
+
Endpoint: /redfish/v1/Systems/{systemId}
|
|
140
|
+
|
|
141
|
+
"""
|
|
142
|
+
actions: Optional[SystemActions] = Field(None, alias="Actions")
|
|
143
|
+
asset_tag: Optional[str] = Field(None, alias="AssetTag")
|
|
144
|
+
bios_version: Optional[str] = Field(None, alias="BiosVersion", validate="type=str")
|
|
145
|
+
bios: Optional[Link] = Field(None, alias="Bios")
|
|
146
|
+
host_name: Optional[str] = Field(None, alias="HostName")
|
|
147
|
+
indicator_led: Optional[str] = Field(None, alias="IndicatorLED")
|
|
148
|
+
last_reset_time: Optional[str] = Field(None, alias="LastResetTime")
|
|
149
|
+
part_number: Optional[str] = Field(None, alias="PartNumber")
|
|
150
|
+
power_state: Optional[str] = Field(None, alias="PowerState", validate="required,oneof=On Off PoweringOn PoweringOff")
|
|
151
|
+
sub_model: Optional[str] = Field(None, alias="SubModel")
|
|
152
|
+
system_type: Optional[str] = Field(None, alias="SystemType", validate="type=str")
|
|
153
|
+
manufacturer: Optional[str] = Field(None, alias="Manufacturer", validate="required,type=str")
|
|
154
|
+
model: Optional[str] = Field(None, alias="Model", validate="required,type=str")
|
|
155
|
+
serial_number: Optional[str] = Field(None, alias="SerialNumber", validate="required,type=str")
|
|
156
|
+
sku: Optional[str] = Field(None, alias="SKU")
|
|
157
|
+
uuid: Optional[str] = Field(None, alias="UUID", validate="type=str")
|
|
158
|
+
power_restore_policy: Optional[str] = Field(None, alias="PowerRestorePolicy")
|
|
159
|
+
|
|
160
|
+
# Sub-resource links
|
|
161
|
+
certificates: Optional[Link] = Field(None, alias="Certificates")
|
|
162
|
+
ethernet_interfaces: Optional[Link] = Field(None, alias="EthernetInterfaces")
|
|
163
|
+
graphics_controllers: Optional[Link] = Field(None, alias="GraphicsControllers")
|
|
164
|
+
log_services: Optional[Link] = Field(None, alias="LogServices")
|
|
165
|
+
memory: Optional[Link] = Field(None, alias="Memory")
|
|
166
|
+
storage: Optional[Link] = Field(None, alias="Storage")
|
|
167
|
+
processors: Optional[Link] = Field(None, alias="Processors")
|
|
168
|
+
secure_boot: Optional[Link] = Field(None, alias="SecureBoot")
|
|
169
|
+
simple_storage: Optional[Link] = Field(None, alias="SimpleStorage")
|
|
170
|
+
usb_controllers: Optional[Link] = Field(None, alias="USBControllers")
|
|
171
|
+
virtual_media: Optional[Link] = Field(None, alias="VirtualMedia")
|
|
172
|
+
network_interfaces: Optional[Link] = Field(None, alias="NetworkInterfaces")
|
|
173
|
+
|
|
174
|
+
# PCIe devices (array of links)
|
|
175
|
+
pcie_devices: Optional[List[Link]] = Field(None, alias="PCIeDevices")
|
|
176
|
+
pcie_devices_count: Optional[int] = Field(None, alias="PCIeDevices@odata.count")
|
|
177
|
+
|
|
178
|
+
boot: Optional[Boot] = Field(None, alias="Boot")
|
|
179
|
+
links: Optional[SystemLinks] = Field(None, alias="Links")
|
|
180
|
+
status: Optional[Status] = Field(None, alias="Status", validate="status")
|
|
181
|
+
oem: Optional[Oem] = Field(None, alias="Oem")
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
# ---------------------------------------------------------------------------
|
|
185
|
+
# BIOS
|
|
186
|
+
# ---------------------------------------------------------------------------
|
|
187
|
+
|
|
188
|
+
class Bios(Entity):
|
|
189
|
+
"""
|
|
190
|
+
BIOS settings resource.
|
|
191
|
+
Endpoint: /redfish/v1/Systems/{systemId}/Bios
|
|
192
|
+
"""
|
|
193
|
+
bios_version: Optional[str] = Field(None, alias="BiosVersion")
|
|
194
|
+
attributes: Optional[Any] = Field(None, alias="Attributes")
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Task service models.
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from typing import List, Optional
|
|
8
|
+
|
|
9
|
+
from pydantic import Field
|
|
10
|
+
|
|
11
|
+
from .common import Entity, Link, Status
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class TaskService(Entity):
|
|
15
|
+
"""
|
|
16
|
+
The Task service manages asynchronous tasks.
|
|
17
|
+
Endpoint: /redfish/v1/TaskService
|
|
18
|
+
"""
|
|
19
|
+
tasks: Optional[Link] = Field(None, alias="Tasks")
|
|
20
|
+
completion_task_over_write_policy: Optional[str] = Field(
|
|
21
|
+
None, alias="CompletionTaskOverWritePolicy"
|
|
22
|
+
)
|
|
23
|
+
date_time: Optional[str] = Field(None, alias="DateTime")
|
|
24
|
+
life_cycle_event_on_task_state_change: Optional[bool] = Field(
|
|
25
|
+
None, alias="LifeCycleEventOnTaskStateChange"
|
|
26
|
+
)
|
|
27
|
+
service_enabled: Optional[bool] = Field(None, alias="ServiceEnabled")
|
|
28
|
+
status: Optional[Status] = Field(None, alias="Status")
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class Message(Entity):
|
|
32
|
+
"""A message associated with a task."""
|
|
33
|
+
message: Optional[str] = Field(None, alias="Message")
|
|
34
|
+
message_args: Optional[List[str]] = Field(None, alias="MessageArgs")
|
|
35
|
+
message_id: Optional[str] = Field(None, alias="MessageId")
|
|
36
|
+
resolution: Optional[str] = Field(None, alias="Resolution")
|
|
37
|
+
severity: Optional[str] = Field(None, alias="Severity")
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class Task(Entity):
|
|
41
|
+
"""
|
|
42
|
+
Represents an asynchronous task.
|
|
43
|
+
Endpoint: /redfish/v1/TaskService/Tasks/{taskId}
|
|
44
|
+
|
|
45
|
+
Long-running operations (e.g., firmware update) return a Task resource.
|
|
46
|
+
"""
|
|
47
|
+
end_time: Optional[str] = Field(None, alias="EndTime")
|
|
48
|
+
messages: Optional[List[Message]] = Field(None, alias="Messages")
|
|
49
|
+
percent_complete: Optional[int] = Field(None, alias="PercentComplete")
|
|
50
|
+
start_time: Optional[str] = Field(None, alias="StartTime")
|
|
51
|
+
task_monitor: Optional[str] = Field(None, alias="TaskMonitor")
|
|
52
|
+
task_state: Optional[str] = Field(None, alias="TaskState")
|
|
53
|
+
task_status: Optional[str] = Field(None, alias="TaskStatus")
|
|
54
|
+
status: Optional[Status] = Field(None, alias="Status")
|