Skip to content

Commit

Permalink
Merge pull request #248 from dhapati2/release/433a
Browse files Browse the repository at this point in the history
release/433a Schema Refresh 433a
  • Loading branch information
t-raghu committed Apr 18, 2024
2 parents 5531255 + f1eb969 commit e715ad3
Show file tree
Hide file tree
Showing 40 changed files with 487 additions and 62 deletions.
10 changes: 7 additions & 3 deletions tests/common/test_ucstoxml.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import unittest

import ucsmsdk.ucsxmlcodec as xc

import xml.etree.ElementTree as ET

class TestUCStoXML(unittest.TestCase):
def test_001_mo_to_xml(self):
Expand All @@ -27,7 +27,9 @@ def test_001_mo_to_xml(self):

elem = mo.to_xml()
xml_str = xc.to_xml_str(elem)
self.assertEqual(xml_str, expected)
expected_xml_str = xc.to_xml_str(ET.fromstring(expected))
self.assertEqual(xml_str, expected_xml_str)


def test_001_mo_heirarchy_to_xml(self):
# first form the object from xml
Expand Down Expand Up @@ -67,4 +69,6 @@ def test_001_mo_heirarchy_to_xml(self):

expected = b'<memoryUnitEnvStatsHist1 childAction="deleteNonPresent" id="1" mostRecent="no" rn="1" suspect="no" temperature="28.000000" temperatureAvg="25.599997" temperatureMax="28.000000" temperatureMin="24.000000" thresholded="" timeCollected="2015-09-07T09:43:53.262" dn="sys/chassis-1/blade-2/board/memarray-1/mem-9/dimm-env-stats/1"><memoryUnitEnvStatsHist2 rn="1" dn="sys/chassis-1/blade-2/board/memarray-1/mem-9/dimm-env-stats/1/1" childAction="deleteNonPresent" id="1" mostRecent="no" suspect="no" temperature="28.000000" temperatureAvg="25.599997" temperatureMax="28.000000" temperatureMin="24.000000" thresholded="" timeCollected="2015-09-07T09:43:53.262" /></memoryUnitEnvStatsHist1>'
obj = response.out_configs.child[0].child[0].child[0]
self.assertEqual(xc.to_xml_str(obj.to_xml()), expected)
expected_xml_str = xc.to_xml_str(ET.fromstring(expected))
self.assertEqual(xc.to_xml_str(obj.to_xml()), expected_xml_str)

5 changes: 3 additions & 2 deletions tests/common/test_unknown_props.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import ucsmsdk.ucsxmlcodec as xc
from ucsmsdk.ucscoremeta import WriteXmlOption

import xml.etree.ElementTree as ET

class TestUnknownProps(unittest.TestCase):
def test_001_knownmo_unknownprop(self):
Expand All @@ -32,7 +32,8 @@ def test_001_knownmo_unknownprop(self):
xml_element = obj.to_xml()
expected = b'<lsServer name="ra11" agentPolicyName="" type="instance" usrLbl="b" unknownProps="known" dn="ls-ra11" />'
result_str = xc.to_xml_str(xml_element)
self.assertEqual(result_str, expected)
expected_xml_str = xc.to_xml_str(ET.fromstring(expected))
self.assertEqual(result_str, expected_xml_str)

def test_002_knownmo_unknownprop(self):
xml_str = '''
Expand Down
14 changes: 8 additions & 6 deletions tests/generic_mo/test_ucsgmo.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# limitations under the License.

import unittest
import xml.etree.ElementTree as ET

import ucsmsdk.ucsxmlcodec as xc
import ucsmsdk.ucsmo as ucsmo
Expand All @@ -38,8 +39,8 @@ def test_002_create_gmo_using_param_dict(self):
xml_str = xc.to_xml_str(elem)

expected = b'<testLsA a="1" b="2" c="3" rn="" dn=""><testLsB a="1" b="2" c="3" rn="" dn="" /></testLsA>'

self.assertEqual(xml_str, expected)
expected_xml_str = xc.to_xml_str(ET.fromstring(expected))
self.assertEqual(xml_str, expected_xml_str)

def test_003_create_gmo_using_param_dict(self):
args = {"a": 1, "b": 2, "c":3, "rn": "parent"}
Expand All @@ -50,8 +51,8 @@ def test_003_create_gmo_using_param_dict(self):
xml_str = xc.to_xml_str(elem)

expected = b'<testLsA a="1" b="2" c="3" rn="parent" dn="org-root/parent"><testLsB rn="child" dn="org-root/parent/child" /></testLsA>'

self.assertEqual(xml_str, expected)
expected_xml_str = xc.to_xml_str(ET.fromstring(expected))
self.assertEqual(xml_str, expected_xml_str)

def test_004_create_gmo_using_parent_mo(self):
args = {"a": 1, "b": 2, "c":3, "rn": "parent"}
Expand All @@ -61,8 +62,9 @@ def test_004_create_gmo_using_parent_mo(self):
xml_str = xc.to_xml_str(elem)

expected = b'<testLsA a="1" b="2" c="3" rn="parent" dn="org-root/parent"><testLsB rn="child" dn="org-root/parent/child" /></testLsA>'

self.assertEqual(xml_str, expected)
expected_xml_str = xc.to_xml_str(ET.fromstring(expected))
self.assertEqual(xml_str, expected_xml_str)


def test_005_create_gmo_from_xml(self):
xml_str = '''
Expand Down
12 changes: 10 additions & 2 deletions ucsmsdk/mometa/aaa/AaaModLR.py

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions ucsmsdk/mometa/aaa/AaaSessionLR.py

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion ucsmsdk/mometa/change/ChangeChangedObjectRef.py

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions ucsmsdk/mometa/compute/ComputeMbTempStats.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@


class ComputeMbTempStatsConsts:
FM_TEMP_SEN_FRONT_R_NOT_APPLICABLE = "not-applicable"
FM_TEMP_SEN_FRONT_RAVG_NOT_APPLICABLE = "not-applicable"
FM_TEMP_SEN_FRONT_RMAX_NOT_APPLICABLE = "not-applicable"
FM_TEMP_SEN_FRONT_RMIN_NOT_APPLICABLE = "not-applicable"
FM_TEMP_SEN_IO_NOT_APPLICABLE = "not-applicable"
FM_TEMP_SEN_IO_AVG_NOT_APPLICABLE = "not-applicable"
FM_TEMP_SEN_IO_MAX_NOT_APPLICABLE = "not-applicable"
Expand Down Expand Up @@ -39,6 +43,10 @@ class ComputeMbTempStats(ManagedObject):
prop_meta = {
"child_action": MoPropertyMeta("child_action", "childAction", "string", VersionMeta.Version111j, MoPropertyMeta.INTERNAL, None, None, None, r"""((deleteAll|ignore|deleteNonPresent),){0,2}(deleteAll|ignore|deleteNonPresent){0,1}""", [], []),
"dn": MoPropertyMeta("dn", "dn", "string", VersionMeta.Version111j, MoPropertyMeta.READ_ONLY, 0x2, 0, 256, None, [], []),
"fm_temp_sen_front_r": MoPropertyMeta("fm_temp_sen_front_r", "fmTempSenFrontR", "string", VersionMeta.Version433a, MoPropertyMeta.READ_ONLY, None, None, None, r"""^([\-]?)([123]?[1234]?)([0-9]{0,36})(([.])([0-9]{1,10}))?$""", ["not-applicable"], ["0-4294967295"]),
"fm_temp_sen_front_r_avg": MoPropertyMeta("fm_temp_sen_front_r_avg", "fmTempSenFrontRAvg", "string", VersionMeta.Version433a, MoPropertyMeta.READ_ONLY, None, None, None, r"""^([\-]?)([123]?[1234]?)([0-9]{0,36})(([.])([0-9]{1,10}))?$""", ["not-applicable"], ["0-4294967295"]),
"fm_temp_sen_front_r_max": MoPropertyMeta("fm_temp_sen_front_r_max", "fmTempSenFrontRMax", "string", VersionMeta.Version433a, MoPropertyMeta.READ_ONLY, None, None, None, r"""^([\-]?)([123]?[1234]?)([0-9]{0,36})(([.])([0-9]{1,10}))?$""", ["not-applicable"], ["0-4294967295"]),
"fm_temp_sen_front_r_min": MoPropertyMeta("fm_temp_sen_front_r_min", "fmTempSenFrontRMin", "string", VersionMeta.Version433a, MoPropertyMeta.READ_ONLY, None, None, None, r"""^([\-]?)([123]?[1234]?)([0-9]{0,36})(([.])([0-9]{1,10}))?$""", ["not-applicable"], ["0-4294967295"]),
"fm_temp_sen_io": MoPropertyMeta("fm_temp_sen_io", "fmTempSenIo", "string", VersionMeta.Version111j, MoPropertyMeta.READ_ONLY, None, None, None, r"""^([\-]?)([123]?[1234]?)([0-9]{0,36})(([.])([0-9]{1,10}))?$""", ["not-applicable"], ["0-4294967295"]),
"fm_temp_sen_io_avg": MoPropertyMeta("fm_temp_sen_io_avg", "fmTempSenIoAvg", "string", VersionMeta.Version111j, MoPropertyMeta.READ_ONLY, None, None, None, r"""^([\-]?)([123]?[1234]?)([0-9]{0,36})(([.])([0-9]{1,10}))?$""", ["not-applicable"], ["0-4294967295"]),
"fm_temp_sen_io_max": MoPropertyMeta("fm_temp_sen_io_max", "fmTempSenIoMax", "string", VersionMeta.Version111j, MoPropertyMeta.READ_ONLY, None, None, None, r"""^([\-]?)([123]?[1234]?)([0-9]{0,36})(([.])([0-9]{1,10}))?$""", ["not-applicable"], ["0-4294967295"]),
Expand Down Expand Up @@ -68,6 +76,10 @@ class ComputeMbTempStats(ManagedObject):
prop_map = {
"childAction": "child_action",
"dn": "dn",
"fmTempSenFrontR": "fm_temp_sen_front_r",
"fmTempSenFrontRAvg": "fm_temp_sen_front_r_avg",
"fmTempSenFrontRMax": "fm_temp_sen_front_r_max",
"fmTempSenFrontRMin": "fm_temp_sen_front_r_min",
"fmTempSenIo": "fm_temp_sen_io",
"fmTempSenIoAvg": "fm_temp_sen_io_avg",
"fmTempSenIoMax": "fm_temp_sen_io_max",
Expand Down Expand Up @@ -97,6 +109,10 @@ class ComputeMbTempStats(ManagedObject):
def __init__(self, parent_mo_or_dn, **kwargs):
self._dirty_mask = 0
self.child_action = None
self.fm_temp_sen_front_r = None
self.fm_temp_sen_front_r_avg = None
self.fm_temp_sen_front_r_max = None
self.fm_temp_sen_front_r_min = None
self.fm_temp_sen_io = None
self.fm_temp_sen_io_avg = None
self.fm_temp_sen_io_max = None
Expand Down
16 changes: 16 additions & 0 deletions ucsmsdk/mometa/compute/ComputeMbTempStatsHist.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@


class ComputeMbTempStatsHistConsts:
FM_TEMP_SEN_FRONT_R_NOT_APPLICABLE = "not-applicable"
FM_TEMP_SEN_FRONT_RAVG_NOT_APPLICABLE = "not-applicable"
FM_TEMP_SEN_FRONT_RMAX_NOT_APPLICABLE = "not-applicable"
FM_TEMP_SEN_FRONT_RMIN_NOT_APPLICABLE = "not-applicable"
FM_TEMP_SEN_IO_NOT_APPLICABLE = "not-applicable"
FM_TEMP_SEN_IO_AVG_NOT_APPLICABLE = "not-applicable"
FM_TEMP_SEN_IO_MAX_NOT_APPLICABLE = "not-applicable"
Expand Down Expand Up @@ -43,6 +47,10 @@ class ComputeMbTempStatsHist(ManagedObject):
prop_meta = {
"child_action": MoPropertyMeta("child_action", "childAction", "string", VersionMeta.Version111j, MoPropertyMeta.INTERNAL, None, None, None, r"""((deleteAll|ignore|deleteNonPresent),){0,2}(deleteAll|ignore|deleteNonPresent){0,1}""", [], []),
"dn": MoPropertyMeta("dn", "dn", "string", VersionMeta.Version111j, MoPropertyMeta.READ_ONLY, 0x2, 0, 256, None, [], []),
"fm_temp_sen_front_r": MoPropertyMeta("fm_temp_sen_front_r", "fmTempSenFrontR", "string", VersionMeta.Version433a, MoPropertyMeta.READ_ONLY, None, None, None, r"""^([\-]?)([123]?[1234]?)([0-9]{0,36})(([.])([0-9]{1,10}))?$""", ["not-applicable"], ["0-4294967295"]),
"fm_temp_sen_front_r_avg": MoPropertyMeta("fm_temp_sen_front_r_avg", "fmTempSenFrontRAvg", "string", VersionMeta.Version433a, MoPropertyMeta.READ_ONLY, None, None, None, r"""^([\-]?)([123]?[1234]?)([0-9]{0,36})(([.])([0-9]{1,10}))?$""", ["not-applicable"], ["0-4294967295"]),
"fm_temp_sen_front_r_max": MoPropertyMeta("fm_temp_sen_front_r_max", "fmTempSenFrontRMax", "string", VersionMeta.Version433a, MoPropertyMeta.READ_ONLY, None, None, None, r"""^([\-]?)([123]?[1234]?)([0-9]{0,36})(([.])([0-9]{1,10}))?$""", ["not-applicable"], ["0-4294967295"]),
"fm_temp_sen_front_r_min": MoPropertyMeta("fm_temp_sen_front_r_min", "fmTempSenFrontRMin", "string", VersionMeta.Version433a, MoPropertyMeta.READ_ONLY, None, None, None, r"""^([\-]?)([123]?[1234]?)([0-9]{0,36})(([.])([0-9]{1,10}))?$""", ["not-applicable"], ["0-4294967295"]),
"fm_temp_sen_io": MoPropertyMeta("fm_temp_sen_io", "fmTempSenIo", "string", VersionMeta.Version111j, MoPropertyMeta.READ_ONLY, None, None, None, r"""^([\-]?)([123]?[1234]?)([0-9]{0,36})(([.])([0-9]{1,10}))?$""", ["not-applicable"], ["0-4294967295"]),
"fm_temp_sen_io_avg": MoPropertyMeta("fm_temp_sen_io_avg", "fmTempSenIoAvg", "string", VersionMeta.Version111j, MoPropertyMeta.READ_ONLY, None, None, None, r"""^([\-]?)([123]?[1234]?)([0-9]{0,36})(([.])([0-9]{1,10}))?$""", ["not-applicable"], ["0-4294967295"]),
"fm_temp_sen_io_max": MoPropertyMeta("fm_temp_sen_io_max", "fmTempSenIoMax", "string", VersionMeta.Version111j, MoPropertyMeta.READ_ONLY, None, None, None, r"""^([\-]?)([123]?[1234]?)([0-9]{0,36})(([.])([0-9]{1,10}))?$""", ["not-applicable"], ["0-4294967295"]),
Expand Down Expand Up @@ -72,6 +80,10 @@ class ComputeMbTempStatsHist(ManagedObject):
prop_map = {
"childAction": "child_action",
"dn": "dn",
"fmTempSenFrontR": "fm_temp_sen_front_r",
"fmTempSenFrontRAvg": "fm_temp_sen_front_r_avg",
"fmTempSenFrontRMax": "fm_temp_sen_front_r_max",
"fmTempSenFrontRMin": "fm_temp_sen_front_r_min",
"fmTempSenIo": "fm_temp_sen_io",
"fmTempSenIoAvg": "fm_temp_sen_io_avg",
"fmTempSenIoMax": "fm_temp_sen_io_max",
Expand Down Expand Up @@ -102,6 +114,10 @@ def __init__(self, parent_mo_or_dn, id, **kwargs):
self._dirty_mask = 0
self.id = id
self.child_action = None
self.fm_temp_sen_front_r = None
self.fm_temp_sen_front_r_avg = None
self.fm_temp_sen_front_r_max = None
self.fm_temp_sen_front_r_min = None
self.fm_temp_sen_io = None
self.fm_temp_sen_io_avg = None
self.fm_temp_sen_io_max = None
Expand Down
Loading

0 comments on commit e715ad3

Please sign in to comment.