rsd-lib/rsd_lib/resources/v2_1/common/rack_location.py
Lin Yang c53072527b Move common fields to common directory
Change-Id: I3139d562caf82327af71d9dca8af76cdf1c543b4
2019-03-22 11:23:10 -07:00

38 lines
1.3 KiB
Python

# Copyright 2018 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
from rsd_lib import utils as rsd_lib_utils
class RackLocationField(base.CompositeField):
rack_units = base.Field("RackUnits")
"""Indicates the rack unit type"""
xlocation = base.Field("XLocation", adapter=rsd_lib_utils.num_or_none)
"""The horizontal location within uLocation, from left to right
(1.. MAXIMUM) 0 indicate not available
"""
ulocation = base.Field("ULocation", adapter=rsd_lib_utils.num_or_none)
"""The index of the top-most U of the component, from top to bottom
(1.. MAXIMUM) 0 indicate not available
"""
uheight = base.Field("UHeight", adapter=rsd_lib_utils.num_or_none)
"""The height of managed zone, e.g. 8 for 8U, 16 for 16U"""