Move StatusField to common file
Change-Id: Id1a012eb89f000e6077f0b444d47f7af0414e364
This commit is contained in:
parent
83462694b5
commit
7c872a9979
29
rsd_lib/common.py
Normal file
29
rsd_lib/common.py
Normal file
@ -0,0 +1,29 @@
|
||||
# Copyright 2019 Intel, Inc.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# 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.
|
||||
|
||||
from sushy.resources import base
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
"""This Field describes the status of a resource and its children."""
|
||||
|
||||
health = base.Field('Health')
|
||||
"""Represents health of resource w/o considering its dependent resources"""
|
||||
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
"""Represents health state of resource and its dependent resources"""
|
||||
|
||||
state = base.Field('State')
|
||||
"""Indicates the known state of the resource, such as if it is enabled."""
|
@ -16,6 +16,7 @@
|
||||
from sushy.resources import base
|
||||
from sushy import utils
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib.resources.v2_1.chassis import log_services
|
||||
from rsd_lib.resources.v2_1.chassis import power
|
||||
from rsd_lib.resources.v2_1.chassis import power_zone
|
||||
@ -24,12 +25,6 @@ from rsd_lib.resources.v2_1.chassis import thermal_zone
|
||||
from rsd_lib import utils as rsd_lib_utils
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
health = base.Field('Health')
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
|
||||
|
||||
class LinksField(base.CompositeField):
|
||||
contains = base.Field('Contains', adapter=utils.get_members_identities)
|
||||
"""Any other chassis that this chassis has in it"""
|
||||
@ -143,7 +138,7 @@ class Chassis(base.ResourceBase):
|
||||
sku = base.Field('SKU')
|
||||
"""The chassis stock-keeping unit"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The chassis status"""
|
||||
|
||||
chassis_type = base.Field('ChassisType')
|
||||
|
@ -13,16 +13,12 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from rsd_lib.resources.v2_1.chassis import log_entry
|
||||
from rsd_lib import utils as rsd_lib_utils
|
||||
from sushy.resources import base
|
||||
from sushy import utils
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
health = base.Field('Health')
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib.resources.v2_1.chassis import log_entry
|
||||
from rsd_lib import utils as rsd_lib_utils
|
||||
|
||||
|
||||
class LogService(base.ResourceBase):
|
||||
@ -35,7 +31,7 @@ class LogService(base.ResourceBase):
|
||||
name = base.Field('Name')
|
||||
"""The log service name"""
|
||||
|
||||
status = StatusField("Status")
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The log service status"""
|
||||
|
||||
service_enabled = base.Field("ServiceEnabled", adapter=bool)
|
||||
|
@ -16,15 +16,10 @@
|
||||
from sushy.resources import base
|
||||
from sushy import utils
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib import utils as rsd_lib_utils
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
health = base.Field('Health')
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
|
||||
|
||||
class PowerMetricsField(base.CompositeField):
|
||||
interval_in_min = base.Field(
|
||||
'IntervalInMin', adapter=rsd_lib_utils.num_or_none)
|
||||
@ -106,7 +101,7 @@ class PowerControlField(base.ListField):
|
||||
chassis resources
|
||||
"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The Power Control status"""
|
||||
|
||||
power_metrics = PowerMetricsField('PowerMetrics')
|
||||
@ -127,7 +122,7 @@ class VoltageField(base.ListField):
|
||||
member_id = base.Field('MemberId')
|
||||
"""The Voltage sensor member identity"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The Voltage sensor status"""
|
||||
|
||||
sensor_number = base.Field(
|
||||
@ -258,7 +253,7 @@ class PowerSuppliesField(base.ListField):
|
||||
member_id = base.Field('MemberId')
|
||||
"""The Power Supply member identity"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The Power Supply status"""
|
||||
|
||||
power_supply_type = base.Field('PowerSupplyType')
|
||||
@ -346,7 +341,7 @@ class RedundancyField(base.ListField):
|
||||
member_id = base.Field('MemberId')
|
||||
"""The Redundant device identity"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The Redundant device status"""
|
||||
|
||||
mode = base.Field('Mode')
|
||||
|
@ -15,15 +15,10 @@
|
||||
|
||||
from sushy.resources import base
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib import utils as rsd_lib_utils
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
health = base.Field('Health')
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
|
||||
|
||||
class RackLocationField(base.CompositeField):
|
||||
rack_units = base.Field('RackUnits')
|
||||
"""Indicates the rack unit type"""
|
||||
@ -69,7 +64,7 @@ class PowerSuppliesField(base.ListField):
|
||||
part_number = base.Field('PartNumber')
|
||||
"""The part number for this Power Supply"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The Power supply status"""
|
||||
|
||||
rack_location = RackLocationField('RackLocation')
|
||||
@ -86,7 +81,7 @@ class PowerZone(base.ResourceBase):
|
||||
description = base.Field('Description')
|
||||
"""The PowerZone description"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The PowerZone status"""
|
||||
|
||||
rack_location = RackLocationField('RackLocation')
|
||||
|
@ -16,15 +16,10 @@
|
||||
from sushy.resources import base
|
||||
from sushy import utils
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib import utils as rsd_lib_utils
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
health = base.Field('Health')
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
|
||||
|
||||
class TemperaturesField(base.ListField):
|
||||
name = base.Field('Name')
|
||||
"""The temperature sensor name"""
|
||||
@ -32,7 +27,7 @@ class TemperaturesField(base.ListField):
|
||||
member_id = base.Field('MemberId')
|
||||
"""The temperature sensor member identity"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The temperature sensor status"""
|
||||
|
||||
sensor_number = base.Field(
|
||||
@ -129,7 +124,7 @@ class FansField(base.ListField):
|
||||
member_id = base.Field('MemberId')
|
||||
"""The fan sensor member identity"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The fan sensor status"""
|
||||
|
||||
sensor_number = base.Field(
|
||||
@ -227,7 +222,7 @@ class RedundancyField(base.ListField):
|
||||
member_id = base.Field('MemberId')
|
||||
"""The Redundant device identity"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The Redundant device status"""
|
||||
|
||||
mode = base.Field('Mode')
|
||||
|
@ -15,15 +15,10 @@
|
||||
|
||||
from sushy.resources import base
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib import utils as rsd_lib_utils
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
health = base.Field('Health')
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
|
||||
|
||||
class RackLocationField(base.CompositeField):
|
||||
rack_units = base.Field('RackUnits')
|
||||
"""Indicates the rack unit type"""
|
||||
@ -49,7 +44,7 @@ class FansField(base.ListField):
|
||||
reading_rpm = base.Field('ReadingRPM', adapter=rsd_lib_utils.num_or_none)
|
||||
"""Fan RPM reading"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The Fan status"""
|
||||
|
||||
rack_location = RackLocationField('RackLocation')
|
||||
@ -76,7 +71,7 @@ class TemperaturesField(base.ListField):
|
||||
"PowerSupplyBay" - Within a power supply bay
|
||||
"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The temperature sensors status"""
|
||||
|
||||
|
||||
@ -90,7 +85,7 @@ class ThermalZone(base.ResourceBase):
|
||||
description = base.Field('Description')
|
||||
"""The ThermalZone description"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The ThermalZone status"""
|
||||
|
||||
rack_location = RackLocationField('RackLocation')
|
||||
|
@ -18,6 +18,7 @@ import logging
|
||||
from sushy.resources import base
|
||||
from sushy import utils
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib.resources.v2_1.ethernet_switch import acl
|
||||
from rsd_lib.resources.v2_1.ethernet_switch import port
|
||||
from rsd_lib import utils as rsd_lib_utils
|
||||
@ -25,12 +26,6 @@ from rsd_lib import utils as rsd_lib_utils
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
|
||||
health = base.Field('Health')
|
||||
|
||||
|
||||
class LinksField(base.CompositeField):
|
||||
chassis = base.Field('Chassis', default=(),
|
||||
adapter=rsd_lib_utils.get_resource_identity)
|
||||
@ -81,7 +76,7 @@ class EthernetSwitch(base.ResourceBase):
|
||||
max_acl_number = base.Field('MaxACLNumber')
|
||||
"""The ethernet switch max acl number"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The ethernet switch status"""
|
||||
|
||||
links = LinksField('Links')
|
||||
|
@ -18,6 +18,7 @@ import logging
|
||||
from sushy.resources import base
|
||||
from sushy import utils
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib.resources.v2_1.ethernet_switch import static_mac
|
||||
from rsd_lib.resources.v2_1.ethernet_switch import vlan
|
||||
from rsd_lib import utils as rsd_lib_utils
|
||||
@ -25,17 +26,6 @@ from rsd_lib import utils as rsd_lib_utils
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
"""The port state"""
|
||||
|
||||
health = base.Field('Health')
|
||||
"""The port health"""
|
||||
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
"""The port health rollup"""
|
||||
|
||||
|
||||
class NeighborInfoField(base.CompositeField):
|
||||
switch_id = base.Field('SwitchId')
|
||||
port_id = base.Field('PortId')
|
||||
@ -96,7 +86,7 @@ class Port(base.ResourceBase):
|
||||
port_id = base.Field('PortId')
|
||||
"""The port id"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The port status"""
|
||||
|
||||
link_type = base.Field('LinkType')
|
||||
|
@ -16,21 +16,11 @@
|
||||
from sushy.resources import base
|
||||
from sushy import utils
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib.resources.v2_1.event_service import event_subscription
|
||||
from rsd_lib import utils as rsd_lib_utils
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field("State")
|
||||
"""The state of Status"""
|
||||
|
||||
health = base.Field("Health")
|
||||
"""The Status health"""
|
||||
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
"""The Status health_rollup field"""
|
||||
|
||||
|
||||
class EventService(base.ResourceBase):
|
||||
identity = base.Field("Id", required=True)
|
||||
"""The event service identity"""
|
||||
@ -41,7 +31,7 @@ class EventService(base.ResourceBase):
|
||||
description = base.Field("Description")
|
||||
"""The description of event service"""
|
||||
|
||||
status = StatusField("Status")
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The event service status"""
|
||||
|
||||
service_enabled = base.Field("ServiceEnabled", adapter=bool)
|
||||
|
@ -17,6 +17,7 @@ import logging
|
||||
|
||||
from sushy.resources import base
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib import utils
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
@ -40,12 +41,6 @@ class ConnectedEntitiesField(base.ListField):
|
||||
identifiers = IdentifiersField('Identifiers')
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
health = base.Field('Health')
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
|
||||
|
||||
class Endpoint(base.ResourceBase):
|
||||
|
||||
connected_entities = ConnectedEntitiesField('ConnectedEntities')
|
||||
@ -72,7 +67,7 @@ class Endpoint(base.ResourceBase):
|
||||
redundancy = base.Field('Redundancy')
|
||||
"""The endpoint redundancy"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The endpoint status"""
|
||||
|
||||
def __init__(self, connector, identity, redfish_version=None):
|
||||
|
@ -18,6 +18,7 @@ import logging
|
||||
from sushy.resources import base
|
||||
from sushy import utils
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib.resources.v2_1.fabric import endpoint
|
||||
from rsd_lib.resources.v2_1.fabric import switch
|
||||
from rsd_lib.resources.v2_1.fabric import zone
|
||||
@ -25,11 +26,6 @@ from rsd_lib.resources.v2_1.fabric import zone
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
health = base.Field('Health')
|
||||
|
||||
|
||||
class Fabric(base.ResourceBase):
|
||||
|
||||
description = base.Field('Description')
|
||||
@ -47,7 +43,7 @@ class Fabric(base.ResourceBase):
|
||||
name = base.Field('Name')
|
||||
"""The fabric name"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
|
||||
def __init__(self, connector, identity, redfish_version=None):
|
||||
"""A class representing a Fabric
|
||||
|
@ -20,17 +20,11 @@ from sushy.resources import base
|
||||
from sushy.resources import common
|
||||
from sushy import utils
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field("State")
|
||||
"""The status state"""
|
||||
|
||||
health = base.Field("Health")
|
||||
"""The status health"""
|
||||
|
||||
|
||||
class ActionsField(base.CompositeField):
|
||||
reset = common.ResetActionField("#Port.Reset")
|
||||
"""The action port reset"""
|
||||
@ -65,7 +59,7 @@ class Port(base.ResourceBase):
|
||||
description = base.Field("Description")
|
||||
"""The port description"""
|
||||
|
||||
status = StatusField("Status")
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The port status"""
|
||||
|
||||
port_id = base.Field("PortId")
|
||||
|
@ -20,18 +20,13 @@ from sushy.resources import base
|
||||
from sushy.resources import common
|
||||
from sushy import utils
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib.resources.v2_1.fabric import port
|
||||
from rsd_lib import utils as rsd_lib_utils
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
health = base.Field('Health')
|
||||
health_rollup = base.Field('HealthRollUp')
|
||||
|
||||
|
||||
class LinksField(base.CompositeField):
|
||||
chassis = base.Field("Chassis", adapter=utils.get_members_identities)
|
||||
|
||||
@ -54,7 +49,7 @@ class Switch(base.ResourceBase):
|
||||
switch_type = base.Field('SwitchType')
|
||||
"""The switch type"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The switch status"""
|
||||
|
||||
manufacturer = base.Field('Manufacturer')
|
||||
|
@ -18,6 +18,7 @@ import logging
|
||||
from sushy.resources import base
|
||||
from sushy import utils
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib.resources.v2_1.fabric import endpoint
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
@ -28,11 +29,6 @@ class ZoneLinksField(base.CompositeField):
|
||||
adapter=utils.get_members_identities)
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
health = base.Field('Health')
|
||||
|
||||
|
||||
class Zone(base.ResourceBase):
|
||||
|
||||
description = base.Field('Description')
|
||||
@ -47,7 +43,7 @@ class Zone(base.ResourceBase):
|
||||
links = ZoneLinksField('Links')
|
||||
"""The zone links"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The zone status"""
|
||||
|
||||
def __init__(self, connector, identity, redfish_version=None):
|
||||
|
@ -16,17 +16,12 @@
|
||||
from sushy.resources import base
|
||||
from sushy import utils
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib.resources.v2_1.manager import network_protocol
|
||||
from rsd_lib.resources.v2_1.system import ethernet_interface
|
||||
from rsd_lib import utils as rsd_lib_utils
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
health = base.Field('Health')
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
|
||||
|
||||
class GraphicalConsoleField(base.CompositeField):
|
||||
service_enabled = base.Field('ServiceEnabled')
|
||||
max_concurrent_sessions = base.Field('MaxConcurrentSessions',
|
||||
@ -83,7 +78,7 @@ class Manager(base.ResourceBase):
|
||||
model = base.Field('Model')
|
||||
"""The manager model"""
|
||||
|
||||
status = StatusField("Status")
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The manager status"""
|
||||
|
||||
graphical_console = GraphicalConsoleField('GraphicalConsole')
|
||||
|
@ -13,14 +13,10 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from rsd_lib import utils as rsd_lib_utils
|
||||
from sushy.resources import base
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
health = base.Field('Health')
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib import utils as rsd_lib_utils
|
||||
|
||||
|
||||
class ProtocolField(base.CompositeField):
|
||||
@ -56,7 +52,7 @@ class NetworkProtocol(base.ResourceBase):
|
||||
description = base.Field('Description')
|
||||
"""The NetworkProtocol description"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The NetworkProtocol Status"""
|
||||
|
||||
hostname = base.Field('HostName')
|
||||
|
@ -22,6 +22,7 @@ from sushy.resources import common
|
||||
from sushy.resources.system import system
|
||||
from sushy import utils
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib.resources.v2_1.node import constants as node_cons
|
||||
from rsd_lib.resources.v2_1.node import mappings as node_maps
|
||||
from rsd_lib.resources.v2_1.node import schemas as node_schemas
|
||||
@ -66,12 +67,6 @@ class NodeCollectionActionsField(base.CompositeField):
|
||||
compose = ComposeNodeActionField('#ComposedNodeCollection.Allocate')
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
health = base.Field('Health')
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
|
||||
|
||||
class BootField(base.CompositeField):
|
||||
allowed_values = base.Field(
|
||||
'BootSourceOverrideTarget@Redfish.AllowableValues')
|
||||
@ -87,7 +82,7 @@ class BootField(base.CompositeField):
|
||||
|
||||
|
||||
class MemorySummaryField(base.CompositeField):
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The memory status"""
|
||||
|
||||
size_gib = base.Field('TotalSystemMemoryGiB',
|
||||
@ -100,7 +95,7 @@ class MemorySummaryField(base.CompositeField):
|
||||
|
||||
|
||||
class ProcessorSummaryField(base.CompositeField):
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The processor status"""
|
||||
|
||||
count = base.Field('Count', adapter=rsd_lib_utils.num_or_none)
|
||||
@ -158,7 +153,7 @@ class Node(base.ResourceBase):
|
||||
node_maps.NODE_POWER_STATE_MAP)
|
||||
"""The node power state"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The node status"""
|
||||
|
||||
uuid = base.Field('UUID')
|
||||
|
@ -17,15 +17,11 @@ import logging
|
||||
|
||||
from sushy.resources import base
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
health = base.Field('Health')
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
|
||||
|
||||
class LogicalDrive(base.ResourceBase):
|
||||
|
||||
identity = base.Field('Id', required=True)
|
||||
@ -52,7 +48,7 @@ class LogicalDrive(base.ResourceBase):
|
||||
snapshot = base.Field('Snapshot')
|
||||
"""Type of drive replication. Yes - copy on write, No - disc clone"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The logical drive status"""
|
||||
|
||||
def __init__(self, connector, identity, redfish_version=None):
|
||||
|
@ -17,15 +17,11 @@ import logging
|
||||
|
||||
from sushy.resources import base
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
health = base.Field('Health')
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
|
||||
|
||||
class PhysicalDrive(base.ResourceBase):
|
||||
|
||||
identity = base.Field('Id', required=True)
|
||||
@ -52,7 +48,7 @@ class PhysicalDrive(base.ResourceBase):
|
||||
serial_number = base.Field('SerialNumber')
|
||||
"""The serial number for the physical drive"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The physical drive status"""
|
||||
|
||||
def __init__(self, connector, identity, redfish_version=None):
|
||||
|
@ -17,6 +17,8 @@ import logging
|
||||
|
||||
from sushy.resources import base
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@ -43,12 +45,6 @@ class InitiatorsField(base.ListField):
|
||||
iscsi = ISCSIInitiatorField('iSCSI')
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
health = base.Field('Health')
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
|
||||
|
||||
class RemoteTarget(base.ResourceBase):
|
||||
|
||||
identity = base.Field('Id', required=True)
|
||||
@ -61,7 +57,7 @@ class RemoteTarget(base.ResourceBase):
|
||||
|
||||
initiators = InitiatorsField('Initiator')
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The remote target status"""
|
||||
|
||||
def __init__(self, connector, identity, redfish_version=None):
|
||||
|
@ -18,6 +18,7 @@ import logging
|
||||
from sushy.resources import base
|
||||
from sushy import utils
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib.resources.v2_1.storage_service import logical_drive
|
||||
from rsd_lib.resources.v2_1.storage_service import physical_drive
|
||||
from rsd_lib.resources.v2_1.storage_service import remote_target
|
||||
@ -25,12 +26,6 @@ from rsd_lib.resources.v2_1.storage_service import remote_target
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
health = base.Field('Health')
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
|
||||
|
||||
class StorageService(base.ResourceBase):
|
||||
|
||||
description = base.Field('Description')
|
||||
@ -42,7 +37,7 @@ class StorageService(base.ResourceBase):
|
||||
name = base.Field('Name')
|
||||
"""The storage service name"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The storage service status"""
|
||||
|
||||
def __init__(self, connector, identity, redfish_version=None):
|
||||
|
@ -16,16 +16,11 @@
|
||||
from sushy.resources import base
|
||||
from sushy import utils
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib.resources.v2_1.ethernet_switch import vlan
|
||||
from rsd_lib import utils as rsd_lib_utils
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
health = base.Field('Health')
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
|
||||
|
||||
class IPv4AddressesField(base.ListField):
|
||||
address = base.Field("Address")
|
||||
"""The IPv4Addresses address"""
|
||||
@ -108,7 +103,7 @@ class EthernetInterface(base.ResourceBase):
|
||||
description = base.Field('Description')
|
||||
"""The EthernetInterface description"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The EthernetInterface Status"""
|
||||
|
||||
interface_enabled = base.Field("InterfaceEnabled", adapter=bool)
|
||||
|
@ -15,6 +15,7 @@
|
||||
|
||||
from sushy.resources import base
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib import utils as rsd_lib_utils
|
||||
|
||||
|
||||
@ -25,12 +26,6 @@ class MemoryLocationField(base.CompositeField):
|
||||
slot = base.Field('Slot', required=int)
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
health = base.Field('Health')
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
|
||||
|
||||
class Memory(base.ResourceBase):
|
||||
|
||||
name = base.Field('Name')
|
||||
@ -109,7 +104,7 @@ class Memory(base.ResourceBase):
|
||||
memory_location = MemoryLocationField('MemoryLocation')
|
||||
"""The location information of this memory"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The memory status"""
|
||||
|
||||
def __init__(self, connector, identity, redfish_version=None):
|
||||
|
@ -15,6 +15,7 @@
|
||||
|
||||
from sushy.resources import base
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib import utils as rsd_lib_utils
|
||||
|
||||
|
||||
@ -167,12 +168,6 @@ class iSCSIBootField(base.CompositeField):
|
||||
"""
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
health = base.Field('Health')
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
|
||||
|
||||
class NetworkDeviceFunction(base.ResourceBase):
|
||||
|
||||
name = base.Field('Name')
|
||||
@ -197,7 +192,7 @@ class NetworkDeviceFunction(base.ResourceBase):
|
||||
configuration values for this network device function
|
||||
"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The NetworkDeviceFunction status"""
|
||||
|
||||
links = base.Field('Links')
|
||||
|
@ -16,15 +16,10 @@
|
||||
from sushy.resources import base
|
||||
from sushy import utils
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib.resources.v2_1.system import network_device_function
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
health = base.Field('Health')
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
|
||||
|
||||
class NetworkInterface(base.ResourceBase):
|
||||
|
||||
name = base.Field('Name')
|
||||
@ -36,7 +31,7 @@ class NetworkInterface(base.ResourceBase):
|
||||
description = base.Field('Description')
|
||||
"""The description of NetworkDeviceFunction"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The NetworkDeviceFunction status"""
|
||||
|
||||
links = base.Field('Links')
|
||||
|
@ -16,11 +16,7 @@
|
||||
from sushy.resources import base
|
||||
from sushy import utils
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
health = base.Field('Health')
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
|
||||
|
||||
class LinksField(base.CompositeField):
|
||||
@ -70,7 +66,7 @@ class PCIeDevice(base.ResourceBase):
|
||||
firmware_version = base.Field('FirmwareVersion')
|
||||
"""The version of firmware for this PCIe device"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The PCIe device status"""
|
||||
|
||||
links = LinksField('Links')
|
||||
|
@ -16,15 +16,10 @@
|
||||
from sushy.resources import base
|
||||
from sushy import utils
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib import utils as rsd_lib_utils
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
health = base.Field('Health')
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
|
||||
|
||||
class LinksField(base.CompositeField):
|
||||
ethernet_interfaces = base.Field(
|
||||
'EthernetInterfaces', adapter=utils.get_members_identities)
|
||||
@ -90,7 +85,7 @@ class PCIeFunction(base.ResourceBase):
|
||||
subsystem_vendor_id = base.Field('SubsystemVendorId')
|
||||
"""The Subsystem Vendor ID of this PCIe function"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The PCIe function status"""
|
||||
|
||||
links = LinksField('Links')
|
||||
|
@ -15,24 +15,10 @@
|
||||
|
||||
from sushy.resources import base
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib import utils as rsd_lib_utils
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
"""This Field describes the status of a resource and its children.
|
||||
|
||||
This field shall contain any state or health properties of a resource.
|
||||
"""
|
||||
health = base.Field('Health')
|
||||
"""Represents health of resource w/o considering its dependent resources"""
|
||||
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
"""Represents health state of resource and its dependent resources"""
|
||||
|
||||
state = base.Field('State')
|
||||
"""Indicates the known state of the resource, such as if it is enabled."""
|
||||
|
||||
|
||||
class ProcessorIdField(base.CompositeField):
|
||||
|
||||
effective_family = base.Field('EffectiveFamily')
|
||||
@ -107,7 +93,7 @@ class Processor(base.ResourceBase):
|
||||
processor_id = ProcessorIdField('ProcessorId')
|
||||
"""The processor id"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The processor status"""
|
||||
|
||||
total_cores = base.Field(
|
||||
|
@ -16,15 +16,10 @@
|
||||
from sushy.resources import base
|
||||
from sushy import utils
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib import utils as rsd_lib_utils
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
health = base.Field('Health')
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
|
||||
|
||||
class IdentifiersField(base.ListField):
|
||||
durable_name = base.Field('DurableName')
|
||||
durable_name_format = base.Field('DurableNameFormat')
|
||||
@ -32,7 +27,7 @@ class IdentifiersField(base.ListField):
|
||||
|
||||
class StorageControllersField(base.ListField):
|
||||
member_id = base.Field('MemberId')
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
manufacturer = base.Field('Manufacturer')
|
||||
model = base.Field('Model')
|
||||
sku = base.Field('SKU')
|
||||
@ -59,7 +54,7 @@ class StorageSubsystem(base.ResourceBase):
|
||||
description = base.Field('Description')
|
||||
"""The storage subsystem description"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The storage subsystem status"""
|
||||
|
||||
storage_controllers = StorageControllersField('StorageControllers')
|
||||
|
@ -13,17 +13,11 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from rsd_lib.resources.v2_1.task import task
|
||||
from sushy.resources import base
|
||||
from sushy import utils
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field("State")
|
||||
"""The status state"""
|
||||
|
||||
health = base.Field("Health")
|
||||
"""The status health"""
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib.resources.v2_1.task import task
|
||||
|
||||
|
||||
class TaskService(base.ResourceBase):
|
||||
@ -44,7 +38,7 @@ class TaskService(base.ResourceBase):
|
||||
"LifeCycleEventOnTaskStateChange", adapter=bool)
|
||||
"""Whether the task service cycle event on task state change"""
|
||||
|
||||
status = StatusField("Status")
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The task service status"""
|
||||
|
||||
service_enabled = base.Field("ServiceEnabled", adapter=bool)
|
||||
|
@ -13,22 +13,16 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from sushy.resources import base
|
||||
from sushy.resources.system import processor
|
||||
from sushy import utils
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib.resources.v2_2.system import processor_metrics
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
health = base.Field('Health')
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
|
||||
|
||||
class Processor(processor.Processor):
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The processor status"""
|
||||
|
||||
def _get_metrics_path(self):
|
||||
|
@ -15,6 +15,7 @@
|
||||
|
||||
from sushy.resources import base
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib import utils as rsd_lib_utils
|
||||
|
||||
|
||||
@ -65,14 +66,6 @@ class TriggerConditionField(base.CompositeField):
|
||||
"""A Trigger condition based on NumericTriggerConditions"""
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field("State")
|
||||
"""The status state"""
|
||||
|
||||
health = base.Field("Health")
|
||||
"""The status health"""
|
||||
|
||||
|
||||
class Metric(base.ResourceBase):
|
||||
identity = base.Field("Id")
|
||||
"""The metric identity"""
|
||||
@ -105,7 +98,7 @@ class Metric(base.ResourceBase):
|
||||
MetricDefinition and as constrained by the MetricScope property.
|
||||
"""
|
||||
|
||||
status = StatusField("Status")
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The report definition status"""
|
||||
|
||||
def __init__(self, connector, identity, redfish_version=None):
|
||||
|
@ -20,6 +20,7 @@ from sushy import exceptions
|
||||
from sushy.resources import base
|
||||
from sushy import utils
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib.resources.v2_2.telemetry import metric
|
||||
from rsd_lib.resources.v2_2.telemetry import metric_report
|
||||
from rsd_lib.resources.v2_2.telemetry import metric_report_definition_schemas
|
||||
@ -44,17 +45,6 @@ class WildcardsField(base.ListField):
|
||||
"""
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field("State")
|
||||
"""The status state"""
|
||||
|
||||
health = base.Field("Health")
|
||||
"""The status health"""
|
||||
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
"""The status health_rollup"""
|
||||
|
||||
|
||||
class MetricReportDefinition(base.ResourceBase):
|
||||
identity = base.Field("Id")
|
||||
"""The metric report definition identity"""
|
||||
@ -101,7 +91,7 @@ class MetricReportDefinition(base.ResourceBase):
|
||||
strings, which are to appliced to the MetricProperties array property
|
||||
"""
|
||||
|
||||
status = StatusField("Status")
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The report definition status"""
|
||||
|
||||
metric_properties = base.Field("MetricProperties")
|
||||
|
@ -16,6 +16,7 @@
|
||||
from sushy.resources import base
|
||||
from sushy import utils
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib.resources.v2_2.telemetry import metric_definition
|
||||
from rsd_lib.resources.v2_2.telemetry import metric_report
|
||||
from rsd_lib.resources.v2_2.telemetry import metric_report_definition
|
||||
@ -23,12 +24,6 @@ from rsd_lib.resources.v2_2.telemetry import trigger
|
||||
from rsd_lib import utils as rsd_lib_utils
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
health = base.Field('Health')
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
|
||||
|
||||
class Telemetry(base.ResourceBase):
|
||||
|
||||
max_reports = base.Field('MaxReports', adapter=rsd_lib_utils.num_or_none)
|
||||
@ -46,7 +41,7 @@ class Telemetry(base.ResourceBase):
|
||||
collection duration
|
||||
"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The telemetry service status"""
|
||||
|
||||
def _get_metric_definitions_path(self):
|
||||
|
@ -18,6 +18,7 @@ import logging
|
||||
|
||||
from sushy.resources import base
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib.resources.v2_2.telemetry import trigger_schemas
|
||||
from rsd_lib import utils as rsd_lib_utils
|
||||
|
||||
@ -73,12 +74,6 @@ class WildcardsField(base.ListField):
|
||||
"""
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
health = base.Field('Health')
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
|
||||
|
||||
class Trigger(base.ResourceBase):
|
||||
identity = base.Field("Id")
|
||||
"""The trigger identity"""
|
||||
@ -104,7 +99,7 @@ class Trigger(base.ResourceBase):
|
||||
discrete_triggers = DiscreteTriggersField("DiscreteTriggers")
|
||||
"""List of discrete triggers"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The trigger status"""
|
||||
|
||||
wildcards = WildcardsField("Wildcards")
|
||||
|
@ -13,22 +13,11 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from rsd_lib.resources.v2_2.update_service import action_info
|
||||
from rsd_lib import utils as rsd_lib_utils
|
||||
from sushy.resources import base
|
||||
from sushy import utils
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field("State")
|
||||
"""The status state"""
|
||||
|
||||
health = base.Field("Health", adapter=rsd_lib_utils.num_or_none)
|
||||
"""The status health"""
|
||||
|
||||
health_rollup = base.Field("HealthRollup",
|
||||
adapter=rsd_lib_utils.num_or_none)
|
||||
"""The status health rollup"""
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib.resources.v2_2.update_service import action_info
|
||||
|
||||
|
||||
class SimpleUpdateField(base.CompositeField):
|
||||
@ -51,7 +40,7 @@ class UpdateService(base.ResourceBase):
|
||||
name = base.Field("Name")
|
||||
"""The update service name"""
|
||||
|
||||
status = StatusField("Status")
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The update service name"""
|
||||
|
||||
service_enabled = base.Field("ServiceEnabled", adapter=bool)
|
||||
|
@ -19,6 +19,7 @@ import logging
|
||||
from sushy.resources import base
|
||||
from sushy import utils
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib.resources.v2_3.fabric import endpoint_schemas
|
||||
from rsd_lib import utils as rsd_lib_utils
|
||||
|
||||
@ -38,12 +39,6 @@ class ConnectedEntitiesField(base.ListField):
|
||||
adapter=rsd_lib_utils.get_resource_identity)
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
health = base.Field('Health')
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
|
||||
|
||||
class LinksField(base.CompositeField):
|
||||
ports = base.Field('Ports', adapter=utils.get_members_identities)
|
||||
endpoints = base.Field('Endpoints', adapter=utils.get_members_identities)
|
||||
@ -89,7 +84,7 @@ class Endpoint(base.ResourceBase):
|
||||
name = base.Field('Name')
|
||||
"""The endpoint name"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The endpoint status"""
|
||||
|
||||
links = LinksField('Links')
|
||||
|
@ -18,18 +18,13 @@ import logging
|
||||
from sushy.resources import base
|
||||
from sushy import utils
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib.resources.v2_3.fabric import endpoint
|
||||
from rsd_lib.resources.v2_3.fabric import zone
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
health = base.Field('Health')
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
|
||||
|
||||
class Fabric(base.ResourceBase):
|
||||
|
||||
description = base.Field('Description')
|
||||
@ -47,7 +42,7 @@ class Fabric(base.ResourceBase):
|
||||
name = base.Field('Name')
|
||||
"""The fabric name"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
|
||||
def __init__(self, connector, identity, redfish_version=None):
|
||||
"""A class representing a Fabric
|
||||
|
@ -16,6 +16,7 @@
|
||||
from sushy.resources import base
|
||||
from sushy import utils
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib.resources.v2_3.storage_service import drive_metrics
|
||||
from rsd_lib import utils as rsd_lib_utils
|
||||
|
||||
@ -54,12 +55,6 @@ class LocationField(base.ListField):
|
||||
info_format = base.Field('InfoFormat')
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
health = base.Field('Health')
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
|
||||
|
||||
class Drive(base.ResourceBase):
|
||||
|
||||
identity = base.Field('Id', required=True)
|
||||
@ -111,7 +106,7 @@ class Drive(base.ResourceBase):
|
||||
location = LocationField('Location')
|
||||
"""The location of this drive"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The drive status"""
|
||||
|
||||
oem = OemField('Oem')
|
||||
|
@ -18,6 +18,7 @@ import logging
|
||||
from sushy.resources import base
|
||||
from sushy import utils
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib.resources.v2_3.storage_service import volume
|
||||
from rsd_lib import utils as rsd_lib_utils
|
||||
|
||||
@ -25,12 +26,6 @@ from rsd_lib import utils as rsd_lib_utils
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
health = base.Field('Health')
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
|
||||
|
||||
class CapacityField(base.CompositeField):
|
||||
allocated_bytes = base.Field(['Data', 'AllocatedBytes'],
|
||||
adapter=rsd_lib_utils.num_or_none)
|
||||
@ -64,7 +59,7 @@ class StoragePool(base.ResourceBase):
|
||||
name = base.Field('Name')
|
||||
"""The storage pool name string"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The storage pool status"""
|
||||
|
||||
capacity = CapacityField('Capacity')
|
||||
|
@ -18,6 +18,7 @@ import logging
|
||||
from sushy.resources import base
|
||||
from sushy import utils
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib.resources.v2_3.fabric import endpoint
|
||||
from rsd_lib.resources.v2_3.storage_service import drive
|
||||
from rsd_lib.resources.v2_3.storage_service import storage_pool
|
||||
@ -26,12 +27,6 @@ from rsd_lib.resources.v2_3.storage_service import volume
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
health = base.Field('Health')
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
|
||||
|
||||
class StorageService(base.ResourceBase):
|
||||
|
||||
description = base.Field('Description')
|
||||
@ -43,7 +38,7 @@ class StorageService(base.ResourceBase):
|
||||
name = base.Field('Name')
|
||||
"""The storage service name"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The storage service status"""
|
||||
|
||||
def __init__(self, connector, identity, redfish_version=None):
|
||||
|
@ -20,6 +20,7 @@ from sushy import exceptions
|
||||
from sushy.resources import base
|
||||
from sushy import utils
|
||||
|
||||
from rsd_lib import common as rsd_lib_common
|
||||
from rsd_lib.resources.v2_3.storage_service import volume_metrics
|
||||
from rsd_lib.resources.v2_3.storage_service import volume_schemas
|
||||
from rsd_lib import utils as rsd_lib_utils
|
||||
@ -27,12 +28,6 @@ from rsd_lib import utils as rsd_lib_utils
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class StatusField(base.CompositeField):
|
||||
state = base.Field('State')
|
||||
health = base.Field('Health')
|
||||
health_rollup = base.Field('HealthRollup')
|
||||
|
||||
|
||||
class CapacitySourcesField(base.ListField):
|
||||
providing_pools = base.Field('ProvidingPools',
|
||||
adapter=utils.get_members_identities)
|
||||
@ -112,7 +107,7 @@ class Volume(base.ResourceBase):
|
||||
replica_infos = ReplicaInfosField('ReplicaInfos')
|
||||
"""These replica related info of this volume"""
|
||||
|
||||
status = StatusField('Status')
|
||||
status = rsd_lib_common.StatusField('Status')
|
||||
"""The volume status"""
|
||||
|
||||
bootable = base.Field(['Oem', 'Intel_RackScale', 'Bootable'], adapter=bool)
|
||||
|
@ -9,7 +9,7 @@
|
||||
"Status": {
|
||||
"State": "Enabled",
|
||||
"Health": "OK",
|
||||
"HealthRollUp": "OK"
|
||||
"HealthRollup": "OK"
|
||||
},
|
||||
"Manufacturer": "Manufacturer Name",
|
||||
"Model": "Model Name",
|
||||
|
Loading…
x
Reference in New Issue
Block a user