
Added to get OEM JobType to determine if rebooting is done by iDRAC for OEM RAID jobs. Depends-On: https://review.opendev.org/c/openstack/sushy/+/800267 Change-Id: I1c83d59f1c99f0b70fbf4f5a5d71698b76d8e975
74 lines
2.2 KiB
Python
74 lines
2.2 KiB
Python
# Copyright (c) 2021 Dell Inc. or its subsidiaries.
|
|
#
|
|
# 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.
|
|
|
|
import logging
|
|
|
|
from sushy.resources import base
|
|
from sushy.resources.oem import base as oem_base
|
|
|
|
from sushy_oem_idrac.resources.taskservice import mappings as ts_maps
|
|
|
|
LOG = logging.getLogger(__name__)
|
|
|
|
|
|
class DellTaskExtension(oem_base.OEMResourceBase):
|
|
"""Dell OEM extension for DellJob type"""
|
|
identity = base.Field('Id', required=True)
|
|
|
|
name = base.Field('Name', required=True)
|
|
|
|
description = base.Field('Description')
|
|
|
|
completion_time = base.Field('CompletionTime')
|
|
"""Job completion time"""
|
|
|
|
end_time = base.Field('EndTime')
|
|
"""End time of job
|
|
|
|
Timestamp until when the service will wait for a job to complete.
|
|
If a job does not complete within this time, it is killed and marked
|
|
as failed. TIME_NA is a default value and implies EndTime is not
|
|
applicable.
|
|
"""
|
|
|
|
job_state = base.MappedField('JobState', ts_maps.JOB_STATE_VALUE_MAP)
|
|
"""Job state"""
|
|
|
|
job_type = base.MappedField('JobType', ts_maps.JOB_TYPE_VALUE_MAP)
|
|
"""Job type"""
|
|
|
|
message = base.Field('Message')
|
|
"""The status message for job"""
|
|
|
|
message_args = base.Field('MessageArgs')
|
|
"""Array of message arguments for message field"""
|
|
|
|
message_id = base.Field('MessageId')
|
|
"""Message id for job"""
|
|
|
|
percent_complete = base.Field('PercentComplete', adapter=int)
|
|
"""The percentage completion of job"""
|
|
|
|
start_time = base.Field('StartTime')
|
|
"""Scheduled start time of job
|
|
|
|
String that will contain a timestamp in Edm.DateTime format.
|
|
TIME_NOW is a default value and implies apply pending configuration
|
|
now.
|
|
"""
|
|
|
|
|
|
def get_extension(*args, **kwargs):
|
|
return DellTaskExtension
|