From nobody Sun May 5 11:18:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+78063+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78063+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1626937414; cv=none; d=zohomail.com; s=zohoarc; b=RGyi0jSHmSGHEVni9LZWkr9ORzXg4b01W2S9fHrvT2MRew6jXuVzJr5WVMq3Md2ijeZVL55aj7mJszARvKRvu/ROvGoU+AQOg4BecX2wFWdqsaNcA36DJfbGT64+Yi7sigiFpzh0eGBENd9xP0D95ICgihr5Rb80KNfFWjeDS7Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626937414; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=9jqGRGEBl3J+kFyydggbByYKXUv8aGr+wvwJ2Xcp3cs=; b=e/eeKrX0rhTWEpy6beWQ0uAleoOK2/gsKH2Gf6YiLY20FC9Z9d/x9ZVIR5CyMUrFAEewNwzeVGuB4gCXoAIitHQhUrES/RfMWcwFSBwuRuVJALL7CSrvrBoR3EVkLoW9CRwss3KK+5JTxe9BNLmcUhRncRAWXesTmfDrQ4nhAmo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78063+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1626937414873628.4406208725546; Thu, 22 Jul 2021 00:03:34 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id FeHzYY1788612xutfWY03Hmr; Thu, 22 Jul 2021 00:03:34 -0700 X-Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web11.4663.1626937413204406798 for ; Thu, 22 Jul 2021 00:03:33 -0700 X-Received: from pps.filterd (m0134421.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16M6wFBE032097; Thu, 22 Jul 2021 07:03:26 GMT X-Received: from g4t3427.houston.hpe.com (g4t3427.houston.hpe.com [15.241.140.73]) by mx0b-002e3701.pphosted.com with ESMTP id 39xtrykf8x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Jul 2021 07:03:24 +0000 X-Received: from g9t2301.houston.hpecorp.net (g9t2301.houston.hpecorp.net [16.220.97.129]) by g4t3427.houston.hpe.com (Postfix) with ESMTP id 4356957; Thu, 22 Jul 2021 07:03:24 +0000 (UTC) X-Received: from abner-virtual-machine.asiapacific.hpqcorp.net (abner-virtual-machine.asiapacific.hpqcorp.net [15.119.210.153]) by g9t2301.houston.hpecorp.net (Postfix) with ESMTP id 2C77148; Thu, 22 Jul 2021 07:03:23 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: Nickle Wang , Liming Gao Subject: [edk2-devel] [staging/edk2-redfish-client Tools PATCH 1/6] RedfishClientPkg/Tools: Initial commit of Redfish Profile Simulator Date: Thu, 22 Jul 2021 14:08:12 +0800 Message-Id: <20210722060817.18564-2-abner.chang@hpe.com> In-Reply-To: <20210722060817.18564-1-abner.chang@hpe.com> References: <20210722060817.18564-1-abner.chang@hpe.com> X-Proofpoint-ORIG-GUID: SJeAIbPxfSeMGNGbDKcyDDOYs0iEsS_M X-Proofpoint-GUID: SJeAIbPxfSeMGNGbDKcyDDOYs0iEsS_M X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-HPE-SCL: -1 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0b-002e3701.pphosted.com id 16M6wFBE032097 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,abner.chang@hpe.com X-Gm-Message-State: LUTq2LXdQhTbQ0NIzVlD6VZKx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1626937414; bh=6AOCjPwpK5Julgcuk9LtYLAjW2Tp/j6AI7TWrIOskvE=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=RyHABf2yIK7mloMNF4SIaDomocmNpN22VHtpudCf3ctwIYDCporXv9g/bcoWWwu2RFK 9zStyyXoWpY/KZP1weJxsNV69Otim4QJg16dLQ458GDboH1kcA4p33962T30PGmez4800 b6/JQsk0zKx6qexIFnPHTwYn3LDxdSEdoSE= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1626937416273100002 Content-Type: text/plain; charset="utf-8" This is an open source project on DMTF GitHub. (https://github.com/DMTF/Redfish-Profile-Simulator) This tool simulates the HTTP request methods (POST, PATCH, PUT, GET) on Redfish resource maintained by Redfish Profile Simulator. EDK2 open source uses this simulator for the use case when Redfish service has not been set up on the platform, or for the quick Redfish firmware feature development. We clone this project under RedfishClientPkg and maintain it by edk2 because this project has currently been using and updating rarely. That is easier for edk2 to add features to the simulator or modify the simulator to align with edk2 requirement on Redfish service. The license of this tool is on the term of BSD 3-Clause License. Refer to LICENSE.md. Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Liming Gao Reviewed-by: Nickle Wang --- .../Redfish-Profile-Simulator/AUTHORS.md | 2 + .../Redfish-Profile-Simulator/CHANGELOG.md | 15 + .../Redfish-Profile-Simulator/LICENSE.md | 57 ++++ .../Tools/Redfish-Profile-Simulator/README.md | 96 ++++++ .../SimpleOcpServerV1/redfish/index.json | 3 + .../redfish/v1/$metadata/index.xml | 147 +++++++++ .../v1/AccountService/Accounts/index.json | 19 ++ .../AccountService/Accounts/jane/index.json | 19 ++ .../AccountService/Accounts/john/index.json | 19 ++ .../AccountService/Accounts/root/index.json | 19 ++ .../v1/AccountService/Roles/Admin/index.json | 17 + .../AccountService/Roles/Operator/index.json | 15 + .../Roles/ReadOnlyUser/index.json | 13 + .../v1/AccountService/Roles/index.json | 19 ++ .../redfish/v1/AccountService/index.json | 25 ++ .../redfish/v1/Chassis/A33/Power/index.json | 28 ++ .../redfish/v1/Chassis/A33/Thermal/index.json | 150 +++++++++ .../redfish/v1/Chassis/A33/index.json | 46 +++ .../redfish/v1/Chassis/index.json | 13 + .../bmc/EthernetInterfaces/eth0/index.json | 60 ++++ .../bmc/EthernetInterfaces/index.json | 15 + .../Managers/bmc/NetworkProtocol/index.json | 47 +++ .../redfish/v1/Managers/bmc/index.json | 53 +++ .../redfish/v1/Managers/index.json | 13 + .../Sessions/SESSION123456/index.json | 10 + .../v1/SessionService/Sessions/index.json | 12 + .../redfish/v1/SessionService/index.json | 17 + .../LogServices/SEL/Entries/1/index.json | 27 ++ .../LogServices/SEL/Entries/2/index.json | 27 ++ .../LogServices/SEL/Entries/index.json | 62 ++++ .../2M220100SL/LogServices/SEL/index.json | 27 ++ .../Systems/2M220100SL/LogServices/index.json | 15 + .../redfish/v1/Systems/2M220100SL/index.json | 70 ++++ .../redfish/v1/Systems/index.json | 13 + .../SimpleOcpServerV1/redfish/v1/index.json | 31 ++ .../redfish/v1/odata/index.json | 56 ++++ .../redfishProfileSimulator.py | 125 +++++++ .../v1sim/__init__.py | 4 + .../v1sim/accountService.py | 76 +++++ .../v1sim/chassis.py | 115 +++++++ .../v1sim/common_services.py | 28 ++ .../v1sim/flask_redfish_auth.py | 278 ++++++++++++++++ .../v1sim/managers.py | 211 ++++++++++++ .../v1sim/network.py | 48 +++ .../v1sim/redfishURIs.py | 309 ++++++++++++++++++ .../v1sim/resource.py | 100 ++++++ .../v1sim/security.py | 35 ++ .../v1sim/serviceRoot.py | 87 +++++ .../v1sim/serviceVersions.py | 9 + .../v1sim/sessionService.py | 41 +++ .../v1sim/storage.py | 116 +++++++ .../v1sim/systems.py | 198 +++++++++++ .../v1sim/updateService.py | 84 +++++ 53 files changed, 3141 insertions(+) create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/AUTHOR= S.md create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/CHANGE= LOG.md create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/LICENS= E.md create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/README= .md create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/$metadata/index.xml create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/AccountService/Accounts/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/AccountService/Accounts/jane/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/AccountService/Accounts/john/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/AccountService/Accounts/root/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/AccountService/Roles/Admin/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/AccountService/Roles/Operator/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/AccountService/Roles/ReadOnlyUser/index.j= son create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/AccountService/Roles/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/AccountService/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Chassis/A33/Power/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Chassis/A33/Thermal/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Chassis/A33/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Chassis/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Managers/bmc/EthernetInterfaces/eth0/inde= x.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Managers/bmc/EthernetInterfaces/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Managers/bmc/NetworkProtocol/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Managers/bmc/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Managers/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/SessionService/Sessions/SESSION123456/ind= ex.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/SessionService/Sessions/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/SessionService/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220100SL/LogServices/SEL/Entrie= s/1/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220100SL/LogServices/SEL/Entrie= s/2/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220100SL/LogServices/SEL/Entrie= s/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220100SL/LogServices/SEL/index.= json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220100SL/LogServices/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220100SL/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/odata/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/redfis= hProfileSimulator.py create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/= __init__.py create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/= accountService.py create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/= chassis.py create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/= common_services.py create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/= flask_redfish_auth.py create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/= managers.py create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/= network.py create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/= redfishURIs.py create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/= resource.py create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/= security.py create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/= serviceRoot.py create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/= serviceVersions.py create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/= sessionService.py create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/= storage.py create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/= systems.py create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/= updateService.py diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/AUTHORS.md b/= RedfishClientPkg/Tools/Redfish-Profile-Simulator/AUTHORS.md new file mode 100644 index 0000000000..536f67e918 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/AUTHORS.md @@ -0,0 +1,2 @@ +# Original Contribution: +* Paul Vancil - Dell Inc. -- Dell Extreme Scale Infrastructure (ESI) Archi= tecture Team diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/CHANGELOG.md = b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/CHANGELOG.md new file mode 100644 index 0000000000..38bb8685d1 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/CHANGELOG.md @@ -0,0 +1,15 @@ +# Change Log + +## [0.9.6] - 2018-05-25 +- Fixed setuptools config to install all necessary Python modules +- Enabled OpenBMC Static OBmcMonolythicPower8 +- Made simulator more generic to support other mockups +- Fixed several properties in the Computer System resource +- Fixed Content-Type header when returning XML + +## [0.9.2] - 2016-12-08 +- Fixex code to work with late change in mockup data. It was failing to l= oad +- Fixed incomplete code in systems.py modeling logs + +## [0.9.1] - 2016-09-06 +- Initial Public Release diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/LICENSE.md b/= RedfishClientPkg/Tools/Redfish-Profile-Simulator/LICENSE.md new file mode 100644 index 0000000000..18e3361b0d --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/LICENSE.md @@ -0,0 +1,57 @@ +The Distributed Management Task Force (DMTF) grants rights under copyright= in +this software on the terms of the BSD 3-Clause License as set forth below;= no +other rights are granted by DMTF. This software might be subject to other = rights +(such as patent rights) of other parties. + + +### Copyrights. + +Copyright (c) 2016, Contributing Member(s) of Distributed Management Task = Force, +Inc.. All rights reserved. + +Redistribution and use in source and binary forms, with or without modific= ation, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, t= his +list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice= , this +list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. +* Neither the name of the Distributed Management Task Force (DMTF) nor the= names +of its contributors may be used to endorse or promote products derived fro= m this +software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS= " AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPL= IED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIAB= LE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAM= AGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICE= S; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AN= D ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF T= HIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +### Patents. + +This software may be subject to third party patent rights, including provi= sional +patent rights ("patent rights"). DMTF makes no representations to users of= the +standard as to the existence of such rights, and is not responsible to +recognize, disclose, or identify any or all such third party patent right, +owners or claimants, nor for any incomplete or inaccurate identification or +disclosure of such rights, owners or claimants. DMTF shall have no liabili= ty to +any party, in any manner or circumstance, under any legal theory whatsoeve= r, for +failure to recognize, disclose, or identify any such third party patent ri= ghts, +or for such party's reliance on the software or incorporation thereof in i= ts +product, protocols or testing procedures. DMTF shall have no liability to = any +party using such software, whether such use is foreseeable or not, nor to = any +patent owner or claimant, and shall have no liability or responsibility for +costs or losses incurred if software is withdrawn or modified after public= ation, +and shall be indemnified and held harmless by any party using the software= from +any and all claims of infringement by a patent owner for such use. + +DMTF Members that contributed to this software source code might have made +patent licensing commitments in connection with their participation in the= DMTF. +For details, see http://dmtf.org/sites/default/files/patent-10-18-01.pdf a= nd +http://www.dmtf.org/about/policies/disclosures. diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/README.md b/R= edfishClientPkg/Tools/Redfish-Profile-Simulator/README.md new file mode 100644 index 0000000000..660938f880 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/README.md @@ -0,0 +1,96 @@ +Copyright 2016-2018 Distributed Management Task Force, Inc. All rights res= erved. + +# Redfish Profile Simulator + +## About + +***Redfish Profile Simulator*** is a Python34 real simulator of the "simpl= e monolithic server" feature profile. + +* A simple, minimal Redfish Service +* For a monolithic Server +* Aligned with: OCP Remote Machine Management Spec feature set + +### Description + +* Based on flask +* Initial resources are loaded from a catfish mockup into python dictionar= y structures + * After that, data is read/patched... to the dictionaries +* Supports BasicAuth, as well as Redfish Session Auth (for one session, o= ne user) +* Uses: + * easy to add new URIs for testing a client + * easy to tweak behavior or add bad responses to test a client + * allows testing of authentication -- which current mockup servers don= t do + * easy to insert print statements in service to see if data coming acr= oss good..etc + +### Current Limitation: + +* supports a single user/passwd and token +* the user/passwd is: root/password123456 +* The authToken for Session Auth is: 123456SESSIONauthcode +* Supports only HTTP (not HTTPS) +* with redfishtool, use options: redfishtool.py -r127.0.0.1:5000 -u root -= p password123456 -S Never + +## Usage + +* ` python redfishProfileSimulatorMain.py [options]` +* `[Options]`: + + -V, --Version,--- the program version + -h, --help, --- help + -H, --Host=3D --- host IP address. dflt=3D127.0= .0.1 + -P,--Port=3D --- the port to use. dflt=3D5000 + -p, --profile=3D --- the path to the= Redfish profile to use. dflt=3D"SimpleOcpServerV1" + +## Implementation + +* The simulation includes an http server, RestEngine, and dynamic Redfish = datamodel. +* You can GET, PATCH,... to the service just like a real Redfish service. +* Both Basic and Redfish Session/Token authentication are supported + * for a single user/passwd and token + * the user/passwd is: root/password123456 + * The authToken for Session Auth is: 123456SESSIONauthcode + * these can be changed by editing the redfishURSs.py file---will make = dynamic later. +* The http service and Rest engine is built on Flask, and all code is Pyth= on 3.4+ +* The data model resources are "initialized" from the SPMF "SimpleOcpServe= rV1" Mockup. + * and stored as python dictionaries + * then the dictionaries are updated with patches, posts, deletes. +* The program can be extended to support other mockup \"profiles\". +* By default, the simulation runs on localhost (127.0.0.1), on port 5000. + * These can be changed with CLI options: -P -H | --por= t=3D --host=3D + +## Simple OCP Server V1 Mockup Description + +* A Monolithic server: + * One ComputerSystem + * One Chassis + * One Manager + +* Provides basic management features aligned with OCP Remote Machine Manag= ement Spec 1.01: + * Power-on/off/reset + * Boot to PXE, HDD, BIOS setup (boot override) + * 4 temp sensors per DCMI (CPU1, CPU2, Board, Inlet) + * Simple Power Reading, and DCMI Power Limiting + * Fan Monitoring w/ redundancy + * Set asset tag and Indicator LED + * Basic inventory (serial#, model, SKU, Vendor, BIOS ver=E2=80=A6) + * User Management + * BMC management: get/set IP, version, enable/disable protocol + +* What it does NOT have -- that the Redfish 1.0 model supports + * No PSUs in model (RMM spec did not include PSUs) + * No ProcessorInfo, MemoryInfo, StorageInfo, System-EthernetInterfaceI= nfo + * No Tasks + * JsonSchema and Registries collections left out (since that is option= al) + * No EventService--Remote Machine Management spec used basic PET alerts + * Uses only the pre-defined privileges and roles + +## TO DO + +Some limitations to be extended in current implementation + +* Auth supports a single hard-coded username, password, and AuthToken, alt= hough the protocol is 100% compliant with respect to testing clients trying= to authenticate + * ex with basic auth, you have to use the hard coded user/password + * ex with Session Auth, you just use the hard coded AuthToken +* adding and deleting users not implemented--has 3 or 4 users predefined +* accountService properties can be written, but failed logins, lockouts, e= tc is not implemented +* system log not implemented yet diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/index.json b/RedfishClientPkg/Tools/Redfish-Profile= -Simulator/MockupData/SimpleOcpServerV1/redfish/index.json new file mode 100644 index 0000000000..759e3e6fdb --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/index.json @@ -0,0 +1,3 @@ +{ + "v1": "/redfish/v1/" +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/$metadata/index.xml b/RedfishClientPkg/Tools/Red= fish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/$metadata/in= dex.xml new file mode 100644 index 0000000000..37d9529b10 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/$metadata/index.xml @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/AccountService/Accounts/index.json b/RedfishClie= ntPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/= v1/AccountService/Accounts/index.json new file mode 100644 index 0000000000..80f0cf34e6 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/AccountService/Accounts/index.json @@ -0,0 +1,19 @@ +{ + "@odata.type": "#ManagerAccountCollection.ManagerAccountCollection", + "Name": "Accounts Collection", + "Members@odata.count": 3, + "Members": [ + { + "@odata.id": "/redfish/v1/AccountService/Accounts/root" + }, + { + "@odata.id": "/redfish/v1/AccountService/Accounts/jane" + }, + { + "@odata.id": "/redfish/v1/AccountService/Accounts/john" + } + ], + "@odata.context": "/redfish/v1/$metadata#ManagerAccountCollection.Mana= gerAccountCollection", + "@odata.id": "/redfish/v1/AccountService/Accounts", + "@Redfish.Copyright": "Copyright 2014-2016 Distributed Management Task= Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmt= f.org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/AccountService/Accounts/jane/index.json b/Redfis= hClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/red= fish/v1/AccountService/Accounts/jane/index.json new file mode 100644 index 0000000000..51e2ce59a9 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/AccountService/Accounts/jane/index.json @@ -0,0 +1,19 @@ +{ + "@odata.type": "#ManagerAccount.v1_0_2.ManagerAccount", + "Id": "jane", + "Name": "UserAccount", + "Description": "User Account", + "Enabled": true, + "Password": null, + "UserName": "jane", + "RoleId": "Operator", + "Locked": false, + "Links": { + "Role": { + "@odata.id": "/redfish/v1/AccountService/Roles/Operator" + } + }, + "@odata.context": "/redfish/v1/$metadata#ManagerAccount.ManagerAccount= ", + "@odata.id": "/redfish/v1/AccountService/Accounts/jane", + "@Redfish.Copyright":"Copyright 2014-2016 Distributed Management Task = Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmtf= .org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/AccountService/Accounts/john/index.json b/Redfis= hClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/red= fish/v1/AccountService/Accounts/john/index.json new file mode 100644 index 0000000000..a8106d6e88 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/AccountService/Accounts/john/index.json @@ -0,0 +1,19 @@ +{ + "@odata.type": "#ManagerAccount.v1_0_2.ManagerAccount", + "Id": "john", + "Name": "UserAccount", + "Description": "User Account", + "Enabled": true, + "Password": null, + "UserName": "john", + "RoleId": "ReadOnlyUser", + "Locked": false, + "Links": { + "Role": { + "@odata.id": "/redfish/v1/AccountService/Roles/ReadOnlyUser" + } + }, + "@odata.context": "/redfish/v1/$metadata#ManagerAccount.ManagerAccount= ", + "@odata.id": "/redfish/v1/AccountService/Accounts/john", + "@Redfish.Copyright":"Copyright 2014-2016 Distributed Management Task = Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmtf= .org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/AccountService/Accounts/root/index.json b/Redfis= hClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/red= fish/v1/AccountService/Accounts/root/index.json new file mode 100644 index 0000000000..c966e7c771 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/AccountService/Accounts/root/index.json @@ -0,0 +1,19 @@ +{ + "@odata.type": "#ManagerAccount.v1_0_2.ManagerAccount", + "Id": "root", + "Name": "UserAccount", + "Description": "User Account", + "Enabled": true, + "Password": null, + "UserName": "root", + "RoleId": "Admin", + "Locked": false, + "Links": { + "Role": { + "@odata.id": "/redfish/v1/AccountService/Roles/Admin" + } + }, + "@odata.context": "/redfish/v1/$metadata#ManagerAccount.ManagerAccount= ", + "@odata.id": "/redfish/v1/AccountService/Accounts/root", + "@Redfish.Copyright":"Copyright 2014-2016 Distributed Management Task = Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmtf= .org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/AccountService/Roles/Admin/index.json b/RedfishC= lientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfi= sh/v1/AccountService/Roles/Admin/index.json new file mode 100644 index 0000000000..4debc374de --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/AccountService/Roles/Admin/index.json @@ -0,0 +1,17 @@ +{ + "@odata.type": "#Role.v1_0_2.Role", + "Id": "Admin", + "Name": "User Role", + "Description": "Admin User Role", + "IsPredefined": true, + "AssignedPrivileges": [ + "Login", + "ConfigureManager", + "ConfigureUsers", + "ConfigureSelf", + "ConfigureComponents" + ], + "@odata.context": "/redfish/v1/$metadata#Role.Role", + "@odata.id": "/redfish/v1/AccountService/Roles/Admin", + "@Redfish.Copyright":"Copyright 2014-2016 Distributed Management Task = Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmtf= .org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/AccountService/Roles/Operator/index.json b/Redfi= shClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/re= dfish/v1/AccountService/Roles/Operator/index.json new file mode 100644 index 0000000000..f30e747c16 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/AccountService/Roles/Operator/index.json @@ -0,0 +1,15 @@ +{ + "@odata.type": "#Role.v1_0_2.Role", + "Id": "Operator", + "Name": "User Role", + "Description": "Operator User Role", + "IsPredefined": true, + "AssignedPrivileges": [ + "Login", + "ConfigureSelf", + "ConfigureComponents" + ], + "@odata.context": "/redfish/v1/$metadata#Role.Role", + "@odata.id": "/redfish/v1/AccountService/Roles/Operator", + "@Redfish.Copyright":"Copyright 2014-2016 Distributed Management Task = Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmtf= .org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/AccountService/Roles/ReadOnlyUser/index.json b/R= edfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV= 1/redfish/v1/AccountService/Roles/ReadOnlyUser/index.json new file mode 100644 index 0000000000..09a8cc3961 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/AccountService/Roles/ReadOnlyUser/index.json @@ -0,0 +1,13 @@ +{ + "@odata.type": "#Role.v1_0_2.Role", + "Id": "ReadOnlyUser", + "Name": "User Role", + "Description": "ReadOnlyUser User Role", + "IsPredefined": true, + "AssignedPrivileges": [ + "Login" + ], + "@odata.context": "/redfish/v1/$metadata#Role.Role", + "@odata.id": "/redfish/v1/AccountService/Roles/ReadOnlyUser", + "@Redfish.Copyright":"Copyright 2014-2016 Distributed Management Task = Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmtf= .org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/AccountService/Roles/index.json b/RedfishClientP= kg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/= AccountService/Roles/index.json new file mode 100644 index 0000000000..f295d07d1f --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/AccountService/Roles/index.json @@ -0,0 +1,19 @@ +{ + "@odata.type": "#RoleCollection.RoleCollection", + "Name": "Roles Collection", + "Members@odata.count": 3, + "Members": [ + { + "@odata.id": "/redfish/v1/AccountService/Roles/Admin" + }, + { + "@odata.id": "/redfish/v1/AccountService/Roles/Operator" + }, + { + "@odata.id": "/redfish/v1/AccountService/Roles/ReadOnlyUser" + } + ], + "@odata.context": "/redfish/v1/$metadata#RoleCollection.RoleCollection= ", + "@odata.id": "/redfish/v1/AccountService/Roles", + "@Redfish.Copyright": "Copyright 2014-2016 Distributed Management Task= Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmt= f.org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/AccountService/index.json b/RedfishClientPkg/Too= ls/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/Accoun= tService/index.json new file mode 100644 index 0000000000..f0e3659588 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/AccountService/index.json @@ -0,0 +1,25 @@ +{ + "@odata.type": "#AccountService.v1_0_2.AccountService", + "Id": "AccountService", + "Name": "Account Service", + "Description": "Account Service", + "Status": { + "State": "Enabled", + "Health": "OK" + }, + "ServiceEnabled": true, + "AuthFailureLoggingThreshold": 3, + "MinPasswordLength": 8, + "AccountLockoutThreshold": 5, + "AccountLockoutDuration": 30, + "AccountLockoutCounterResetAfter": 30, + "Accounts": { + "@odata.id": "/redfish/v1/AccountService/Accounts" + }, + "Roles": { + "@odata.id": "/redfish/v1/AccountService/Roles" + }, + "@odata.context": "/redfish/v1/$metadata#AccountService.AccountService= ", + "@odata.id": "/redfish/v1/AccountService", + "@Redfish.Copyright": "Copyright 2014-2016 Distributed Management Task= Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmt= f.org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Chassis/A33/Power/index.json b/RedfishClientPkg/= Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/Cha= ssis/A33/Power/index.json new file mode 100644 index 0000000000..04094bf678 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Chassis/A33/Power/index.json @@ -0,0 +1,28 @@ +{ + "@odata.type": "#Power.v1_1_0.Power", + "Id": "Power", + "Name": "Power", + "PowerControl": [ + { + "@odata.id": "/redfish/v1/Chassis/A33/Power#/PowerControl/0", + "MemberId": "0", + "Name": "System Power Control", + "PowerConsumedWatts": 224, + "PowerCapacityWatts": 600, + "PowerLimit": { + "LimitInWatts": 450, + "LimitException": "LogEventOnly", + "CorrectionInMs": 1000 + }, + "Status": { + "State": "Enabled", + "Health": "OK" + }, + "Oem": {} + } + ], + "Oem": {}, + "@odata.context": "/redfish/v1/$metadata#Power.Power", + "@odata.id": "/redfish/v1/Chassis/A33/Power", + "@Redfish.Copyright": "Copyright 2014-2016 Distributed Management Task= Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmt= f.org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Chassis/A33/Thermal/index.json b/RedfishClientPk= g/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/C= hassis/A33/Thermal/index.json new file mode 100644 index 0000000000..e7b92a34e1 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Chassis/A33/Thermal/index.json @@ -0,0 +1,150 @@ +{ + "@odata.type": "#Thermal.v1_1_0.Thermal", + "Id": "Thermal", + "Name": "Thermal", + "Temperatures": [ + { + "@odata.id": "/redfish/v1/Chassis/A33/Thermal#/Temperatures/0", + "MemberId": "0", + "Name": "Inlet Temp", + "SensorNumber": 42, + "Status": { + "State": "Enabled", + "Health": "OK" + }, + "ReadingCelsius": 25, + "UpperThresholdNonCritical": 35, + "UpperThresholdCritical": 40, + "UpperThresholdFatal": 50, + "MinReadingRangeTemp": 0, + "MaxReadingRangeTemp": 200, + "PhysicalContext": "Intake" + }, + { + "@odata.id": "/redfish/v1/Chassis/A33/Thermal#/Temperatures/1", + "MemberId": "1", + "Name": "Board Temp", + "SensorNumber": 43, + "Status": { + "State": "Enabled", + "Health": "OK" + }, + "ReadingCelsius": 35, + "UpperThresholdNonCritical": 30, + "UpperThresholdCritical": 40, + "UpperThresholdFatal": 50, + "MinReadingRangeTemp": 0, + "MaxReadingRangeTemp": 200, + "PhysicalContext": "SystemBoard" + }, + { + "@odata.id": "/redfish/v1/Chassis/A33/Thermal#/Temperatures/2", + "MemberId": "2", + "Name": "CPU1 Temp", + "SensorNumber": 44, + "Status": { + "State": "Enabled", + "Health": "OK" + }, + "ReadingCelsius": 45, + "UpperThresholdNonCritical": 60, + "UpperThresholdCritical": 82, + "MinReadingRangeTemp": 0, + "MaxReadingRangeTemp": 200, + "PhysicalContext": "CPU" + }, + { + "@odata.id": "/redfish/v1/Chassis/A33/Thermal#/Temperatures/3", + "MemberId": "3", + "Name": "CPU2 Temp", + "SensorNumber": 45, + "Status": { + "State": "Enabled", + "Health": "OK" + }, + "ReadingCelsius": 46, + "UpperThresholdNonCritical": 60, + "UpperThresholdCritical": 82, + "MinReadingRangeTemp": 0, + "MaxReadingRangeTemp": 200, + "PhysicalContext": "CPU" + } + ], + "Fans": [ + { + "@odata.id": "/redfish/v1/Chassis/A33/Thermal#/Fans/0", + "MemberId": "0", + "Name": "BaseBoard System Fan 1", + "PhysicalContext": "Backplane", + "Status": { + "State": "Enabled", + "Health": "OK" + }, + "Reading": 2100, + "ReadingUnits": "RPM", + "UpperThresholdNonCritical": 42, + "UpperThresholdCritical": 4200, + "UpperThresholdFatal": 42, + "LowerThresholdNonCritical": 42, + "LowerThresholdCritical": 5, + "LowerThresholdFatal": 42, + "MinReadingRange": 0, + "MaxReadingRange": 5000, + "Redundancy": [ + { + "@odata.id": "/redfish/v1/Chassis/A33/Thermal#/Redunda= ncy/0" + } + ] + }, + { + "@odata.id": "/redfish/v1/Chassis/A33/Thermal#/Fans/1", + "MemberId": "1", + "Name": "BaseBoard System Fan 2", + "PhysicalContext": "Backplane", + "Status": { + "State": "Enabled", + "Health": "OK" + }, + "Reading": 2100, + "ReadingUnits": "RPM", + "UpperThresholdNonCritical": 42, + "UpperThresholdCritical": 4200, + "UpperThresholdFatal": 42, + "LowerThresholdNonCritical": 42, + "LowerThresholdCritical": 5, + "LowerThresholdFatal": 42, + "MinReadingRange": 0, + "MaxReadingRange": 5000, + "Redundancy": [ + { + "@odata.id": "/redfish/v1/Chassis/A33/Thermal#/Redunda= ncy/0" + } + ] + } + ], + "Redundancy": [ + { + "@odata.id": "/redfish/v1/Chassis/A33/Thermal#/Redundancy/0", + "MemberId": "0", + "Name": "BaseBoard System Fans", + "RedundancySet": [ + { + "@odata.id": "/redfish/v1/Chassis/A33/Thermal#/Fans/0" + }, + { + "@odata.id": "/redfish/v1/Chassis/A33/Thermal#/Fans/1" + } + ], + "Mode": "N+m", + "Status": { + "State": "Enabled", + "Health": "OK" + }, + "MinNumNeeded": 1, + "MaxNumSupported": 2 + } + ], + "@odata.context": "/redfish/v1/$metadata#Thermal.Thermal", + "@odata.id": "/redfish/v1/Chassis/A33/Thermal", + "@Redfish.Copyright": "Copyright 2014-2016 Distributed Management Task= Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmt= f.org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Chassis/A33/index.json b/RedfishClientPkg/Tools/= Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/Chassis/A= 33/index.json new file mode 100644 index 0000000000..74e2de8d7a --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Chassis/A33/index.json @@ -0,0 +1,46 @@ +{ + "@odata.type": "#Chassis.v1_2_0.Chassis", + "Id": "A33", + "Name": "Catfish System Chassis", + "ChassisType": "RackMount", + "Manufacturer": "CatfishManufacturer", + "Model": "YellowCat1000", + "SerialNumber": "2M220100SL", + "SKU": "8675309", + "PartNumber": "224071-J23", + "AssetTag": "CATFISHASSETTAG", + "IndicatorLED": "Lit", + "PowerState": "On", + "Status": { + "State": "Enabled", + "Health": "OK" + }, + "Thermal": { + "@odata.id": "/redfish/v1/Chassis/A33/Thermal" + }, + "Power": { + "@odata.id": "/redfish/v1/Chassis/A33/Power" + }, + "Links": { + "ComputerSystems": [ + { + "@odata.id": "/redfish/v1/Systems/2M220100SL" + } + ], + "ManagedBy": [ + { + "@odata.id": "/redfish/v1/Managers/bmc" + } + ], + "ManagersInChassis": [ + { + "@odata.id": "/redfish/v1/Managers/bmc" + } + ], + "Oem": {} + }, + "Oem": {}, + "@odata.context": "/redfish/v1/$metadata#Chassis.Chassis", + "@odata.id": "/redfish/v1/Chassis/A33", + "@Redfish.Copyright": "Copyright 2014-2016 Distributed Management Task= Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmt= f.org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Chassis/index.json b/RedfishClientPkg/Tools/Redf= ish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/Chassis/index= .json new file mode 100644 index 0000000000..fb90ededfd --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Chassis/index.json @@ -0,0 +1,13 @@ +{ + "@odata.type": "#ChassisCollection.ChassisCollection", + "Name": "Chassis Collection", + "Members@odata.count": 1, + "Members": [ + { + "@odata.id": "/redfish/v1/Chassis/A33" + } + ], + "@odata.context": "/redfish/v1/$metadata#ChassisCollection.ChassisColl= ection", + "@odata.id": "/redfish/v1/Chassis", + "@Redfish.Copyright": "Copyright 2014-2016 Distributed Management Task= Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmt= f.org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Managers/bmc/EthernetInterfaces/eth0/index.json = b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServ= erV1/redfish/v1/Managers/bmc/EthernetInterfaces/eth0/index.json new file mode 100644 index 0000000000..f3e8528dc4 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Managers/bmc/EthernetInterfaces/eth0/index.json @@ -0,0 +1,60 @@ +{ + "@odata.type": "#EthernetInterface.v1_0_2.EthernetInterface", + "Id": "eth0", + "Name": "Manager Ethernet Interface", + "Description": "Management Network Interface", + "Status": { + "State": "Enabled", + "Health": "OK" + }, + "InterfaceEnabled": true, + "PermanentMACAddress": "AA:BB:CC:DD:EE:FF", + "MACAddress": "AA:BB:CC:DD:EE:FF", + "SpeedMbps": 100, + "AutoNeg": true, + "FullDuplex": true, + "MTUSize": 1500, + "HostName": "MyHostName", + "FQDN": "MyHostName.MyDomainName.com", + "MaxIPv6StaticAddresses": 1, + "VLAN": { + "VLANEnable": true, + "VLANId": 101 + }, + "IPv4Addresses": [ + { + "Address": "192.168.0.10", + "SubnetMask": "255.255.252.0", + "AddressOrigin": "DHCP", + "Gateway": "192.168.0.1", + "Oem": {} + } + ], + "IPv6AddressPolicyTable": [ + { + "Prefix": "::1/128", + "Precedence": 50, + "Label": 0 + } + ], + "IPv6StaticAddresses": [ + { + "Address": "fe80::1ec1:deff:fe6f:1e24", + "PrefixLength": 16 + } + ], + "IPv6DefaultGateway": "fe80::1ec1:deff:fe6f:1e24", + "IPv6Addresses": [ + { + "Address": "fe80::1ec1:deff:fe6f:1e24", + "PrefixLength": 64, + "AddressOrigin": "SLAAC", + "AddressState": "Preferred", + "Oem": {} + } + ], + "Oem": {}, + "@odata.context": "/redfish/v1/$metadata#EthernetInterface.EthernetInt= erface", + "@odata.id": "/redfish/v1/Managers/bmc/EthernetInterfaces/eth0", + "@Redfish.Copyright":"Copyright 2014-2016 Distributed Management Task = Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmtf= .org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Managers/bmc/EthernetInterfaces/index.json b/Red= fishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/= redfish/v1/Managers/bmc/EthernetInterfaces/index.json new file mode 100644 index 0000000000..77b85973e4 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Managers/bmc/EthernetInterfaces/index.json @@ -0,0 +1,15 @@ +{ + "@odata.type": "#EthernetInterfaceCollection.EthernetInterfaceCollecti= on", + "Name": "Ethernet Network Interface Collection", + "Description": "Collection of EthernetInterfaces for this Manager", + "Members@odata.count": 1, + "Members": [ + { + "@odata.id": "/redfish/v1/Managers/bmc/EthernetInterfaces/eth0" + } + ], + "Oem": {}, + "@odata.context": "/redfish/v1/$metadata#EthernetInterfaceCollection.E= thernetInterfaceCollection", + "@odata.id": "/redfish/v1/Managers/bmc/EthernetInterfaces", + "@Redfish.Copyright": "Copyright 2014-2016 Distributed Management Task= Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmt= f.org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Managers/bmc/NetworkProtocol/index.json b/Redfis= hClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/red= fish/v1/Managers/bmc/NetworkProtocol/index.json new file mode 100644 index 0000000000..192fca543e --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Managers/bmc/NetworkProtocol/index.json @@ -0,0 +1,47 @@ +{ + "@odata.type": "#ManagerNetworkProtocol.v1_0_2.ManagerNetworkProtocol", + "Id": "NetworkProtocol", + "Name": "Manager Network Protocol", + "Description": "Manager Network Service Status", + "Status": { + "State": "Enabled", + "Health": "OK" + }, + "HostName": "myBmcHostname", + "FQDN": "mymanager.mydomain.com", + "HTTP": { + "ProtocolEnabled": true, + "Port": 80 + }, + "HTTPS": { + "ProtocolEnabled": true, + "Port": 443 + }, + "IPMI": { + "ProtocolEnabled": true, + "Port": 623 + }, + "SSH": { + "ProtocolEnabled": true, + "Port": 22 + }, + "SNMP": { + "ProtocolEnabled": true, + "Port": 161 + }, + "SSDP": { + "ProtocolEnabled": true, + "Port": 1900, + "NotifyMulticastIntervalSeconds": 600, + "NotifyTTL": 5, + "NotifyIPv6Scope": "Site" + }, + "Telnet": { + "ProtocolEnabled": true, + "Port": 23 + }, + "Oem": {}, + "@odata.context": "/redfish/v1/$metadata#ManagerNetworkProtocol.Manage= rNetworkProtocol", + "@odata.id": "/redfish/v1/Managers/bmc/NetworkProtocol", + "@Redfish.Copyright":"Copyright 2014-2016 Distributed Management Task = Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmtf= .org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Managers/bmc/index.json b/RedfishClientPkg/Tools= /Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/Managers= /bmc/index.json new file mode 100644 index 0000000000..8e270e8b02 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Managers/bmc/index.json @@ -0,0 +1,53 @@ +{ + "@odata.type": "#Manager.v1_1_0.Manager", + "Id": "bmc", + "Name": "Manager", + "ManagerType": "BMC", + "Description": "BMC", + "ServiceEntryPointUUID": "92384634-2938-2342-8820-489239905423", + "UUID": "00000000-0000-0000-0000-000000000000", + "Model": "CatfishBMC", + "DateTime": "2015-03-13T04:14:33+06:00", + "DateTimeLocalOffset": "+06:00", + "Status": { + "State": "Enabled", + "Health": "OK" + }, + "FirmwareVersion": "1.00", + "NetworkProtocol": { + "@odata.id": "/redfish/v1/Managers/bmc/NetworkProtocol" + }, + "EthernetInterfaces": { + "@odata.id": "/redfish/v1/Managers/bmc/EthernetInterfaces" + }, + "Links": { + "ManagerForServers": [ + { + "@odata.id": "/redfish/v1/Systems/2M220100SL" + } + ], + "ManagerForChassis": [ + { + "@odata.id": "/redfish/v1/Chassis/A33" + } + ], + "ManagerInChassis": { + "@odata.id": "/redfish/v1/Chassis/A33" + }, + "Oem": {} + }, + "Actions": { + "#Manager.Reset": { + "target": "/redfish/v1/Managers/bmc/Actions/Manager.Reset", + "ResetType@Redfish.AllowableValues": [ + "ForceRestart", + "GracefulRestart" + ] + }, + "Oem": {} + }, + "Oem": {}, + "@odata.context": "/redfish/v1/$metadata#Manager.Manager", + "@odata.id": "/redfish/v1/Managers/bmc", + "@Redfish.Copyright": "Copyright 2014-2016 Distributed Management Task= Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmt= f.org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Managers/index.json b/RedfishClientPkg/Tools/Red= fish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/Managers/ind= ex.json new file mode 100644 index 0000000000..8e5f5e0349 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Managers/index.json @@ -0,0 +1,13 @@ +{ + "@odata.type": "#ManagerCollection.ManagerCollection", + "Name": "Manager Collection", + "Members@odata.count": 1, + "Members": [ + { + "@odata.id": "/redfish/v1/Managers/bmc" + } + ], + "@odata.context": "/redfish/v1/$metadata#ManagerCollection.ManagerColl= ection", + "@odata.id": "/redfish/v1/Managers", + "@Redfish.Copyright": "Copyright 2014-2016 Distributed Management Task= Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmt= f.org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/SessionService/Sessions/SESSION123456/index.json= b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpSer= verV1/redfish/v1/SessionService/Sessions/SESSION123456/index.json new file mode 100644 index 0000000000..dce8d48925 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/SessionService/Sessions/SESSION123456/index.json @@ -0,0 +1,10 @@ +{ + "@odata.type": "#Session.v1_0_2.Session", + "Id": "SESSION123456", + "Name": "User Session", + "Description": "Manager User Session", + "UserName": "root", + "Oem": {}, + "@odata.context": "/redfish/v1/$metadata#Session.Session", + "@odata.id": "/redfish/v1/SessionService/Sessions/SESSION123456" +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/SessionService/Sessions/index.json b/RedfishClie= ntPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/= v1/SessionService/Sessions/index.json new file mode 100644 index 0000000000..d009bf9d19 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/SessionService/Sessions/index.json @@ -0,0 +1,12 @@ +{ + "@odata.type": "#SessionCollection.SessionCollection", + "Name": "Session Collection", + "Members@odata.count": 1, + "Members": [ + { + "@odata.id": "/redfish/v1/SessionService/Sessions/SESSION12345= 6" + } + ], + "@odata.context": "/redfish/v1/$metadata#SessionCollection.SessionColl= ection", + "@odata.id": "/redfish/v1/SessionService/Sessions" +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/SessionService/index.json b/RedfishClientPkg/Too= ls/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/Sessio= nService/index.json new file mode 100644 index 0000000000..ed1764ebaf --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/SessionService/index.json @@ -0,0 +1,17 @@ +{ + "@odata.type": "#SessionService.v1_0_2.SessionService", + "Id": "SessionService", + "Name": "Session Service", + "Description": "Session Service", + "Status": { + "State": "Enabled", + "Health": "OK" + }, + "ServiceEnabled": true, + "SessionTimeout": 30, + "Sessions": { + "@odata.id": "/redfish/v1/SessionService/Sessions" + }, + "@odata.context": "/redfish/v1/$metadata#SessionService.SessionService= ", + "@odata.id": "/redfish/v1/SessionService" +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220100SL/LogServices/SEL/Entries/1/ind= ex.json b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Simpl= eOcpServerV1/redfish/v1/Systems/2M220100SL/LogServices/SEL/Entries/1/index.= json new file mode 100644 index 0000000000..5156ff13d5 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220100SL/LogServices/SEL/Entries/1/index.json @@ -0,0 +1,27 @@ +{ + "@odata.type": "#LogEntry.v1_0_2.LogEntry", + "Id": "1", + "Name": "Log Entry 1", + "EntryType": "SEL", + "OemRecordFormat": "CompanyX", + "Severity": "Critical", + "Created": "2012-03-07T14:44:00Z", + "EntryCode": "Assert", + "SensorType": "Temperature", + "SensorNumber": 1, + "Message": "Message for Event, Description for SEL, OEM depends", + "MessageId": "Event.1.0.TempAssert", + "MessageArgs": [ + "ArrayOfMessageArgs" + ], + "Links": { + "OriginOfCondition": { + "@odata.id": "/redfish/v1/Chassis/1/Thermal" + }, + "Oem": {} + }, + "Oem": {}, + "@odata.context": "/redfish/v1/$metadata#LogEntry.LogEntry", + "@odata.id": "/redfish/v1/Systems/2M220100SL/LogServices/SEL/Entries/1= ", + "@Redfish.Copyright":"Copyright 2014-2016 Distributed Management Task = Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmtf= .org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220100SL/LogServices/SEL/Entries/2/ind= ex.json b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Simpl= eOcpServerV1/redfish/v1/Systems/2M220100SL/LogServices/SEL/Entries/2/index.= json new file mode 100644 index 0000000000..308d224055 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220100SL/LogServices/SEL/Entries/2/index.json @@ -0,0 +1,27 @@ +{ + "@odata.type": "#LogEntry.v1_0_2.LogEntry", + "Id": "2", + "Name": "Log Entry 2", + "EntryType": "SEL", + "OemRecordFormat": "CompanyX", + "Severity": "Critical", + "Created": "2012-03-07T14:45:00Z", + "EntryCode": "Assert", + "SensorType": "Temperature", + "SensorNumber": 2, + "Message": "Message for Event, Description for SEL, OEM depends", + "MessageId": "Event.1.0.TempAssert", + "MessageArgs": [ + "ArrayOfMessageArgs" + ], + "Links": { + "OriginOfCondition": { + "@odata.id": "/redfish/v1/Chassis/1/Thermal" + }, + "Oem": {} + }, + "Oem": {}, + "@odata.context": "/redfish/v1/$metadata#LogEntry.LogEntry", + "@odata.id": "/redfish/v1/Systems/2M220100SL/LogServices/SEL/Entries/2= ", + "@Redfish.Copyright":"Copyright 2014-2016 Distributed Management Task = Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmtf= .org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220100SL/LogServices/SEL/Entries/index= .json b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleO= cpServerV1/redfish/v1/Systems/2M220100SL/LogServices/SEL/Entries/index.json new file mode 100644 index 0000000000..2102e5da43 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220100SL/LogServices/SEL/Entries/index.json @@ -0,0 +1,62 @@ +{ + "@odata.type": "#LogEntryCollection.LogEntryCollection", + "Name": "Log Service Collection", + "Description": "Collection of Logs for this System", + "Members@odata.count": 2, + "Members": [ + { + "@odata.type": "#LogEntry.v1_0_2.LogEntry", + "Id": "1", + "Name": "Log Entry 1", + "EntryType": "SEL", + "OemRecordFormat": "CompanyX", + "Severity": "Critical", + "Created": "2012-03-07T14:44:00Z", + "EntryCode": "Assert", + "SensorType": "Temperature", + "SensorNumber": 1, + "Message": "Message for Event, Description for SEL, OEM depend= s", + "MessageId": "Event.1.0.TempAssert", + "MessageArgs": [ + "ArrayOfMessageArgs" + ], + "Links": { + "OriginOfCondition": { + "@odata.id": "/redfish/v1/Chassis/1/Thermal" + }, + "Oem": {} + }, + "Oem": {}, + "@odata.id": "/redfish/v1/Systems/2M220100SL/LogServices/SEL/E= ntries/1" + }, + { + "@odata.type": "#LogEntry.v1_0_2.LogEntry", + "Id": "2", + "Name": "Log Entry 2", + "EntryType": "SEL", + "OemRecordFormat": "CompanyX", + "Severity": "Critical", + "Created": "2012-03-07T14:45:00Z", + "EntryCode": "Assert", + "SensorType": "Temperature", + "SensorNumber": 2, + "Message": "Message for Event, Description for SEL, OEM depend= s", + "MessageId": "Event.1.0.TempAssert", + "MessageArgs": [ + "ArrayOfMessageArgs" + ], + "Links": { + "OriginOfCondition": { + "@odata.id": "/redfish/v1/Chassis/1/Thermal" + }, + "Oem": {} + }, + "Oem": {}, + "@odata.id": "/redfish/v1/Systems/2M220100SL/LogServices/SEL/E= ntries/2" + } + ], + "@odata.nextLink": "/redfish/v1/Systems/2M220100SL/LogServices/SEL/Ent= ries?$skiptoken=3D2", + "@odata.context": "/redfish/v1/$metadata#LogEntryCollection.LogEntryCo= llection", + "@odata.id": "/redfish/v1/Systems/2M220100SL/LogServices/SEL/Entries", + "@Redfish.Copyright":"Copyright 2014-2016 Distributed Management Task = Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmtf= .org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220100SL/LogServices/SEL/index.json b/= RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServer= V1/redfish/v1/Systems/2M220100SL/LogServices/SEL/index.json new file mode 100644 index 0000000000..74c748e95e --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220100SL/LogServices/SEL/index.json @@ -0,0 +1,27 @@ +{ + "@odata.type": "#LogService.v1_0_2.LogService", + "Id": "SEL", + "Name": "System Log Service", + "MaxNumberOfRecords": 1000, + "OverWritePolicy": "WrapsWhenFull", + "DateTime": "2015-03-13T04:14:33+06:00", + "DateTimeLocalOffset": "+06:00", + "ServiceEnabled": true, + "Status": { + "State": "Enabled", + "Health": "OK" + }, + "Oem": {}, + "Actions": { + "#LogService.ClearLog": { + "target": "/redfish/v1/Systems/2M220100SL/LogServices/SEL/Acti= ons/LogService.Reset" + }, + "Oem": {} + }, + "Entries": { + "@odata.id": "/redfish/v1/Systems/2M220100SL/LogServices/SEL/Entri= es" + }, + "@odata.context": "/redfish/v1/$metadata#LogService.LogService", + "@odata.id": "/redfish/v1/Systems/2M220100SL/LogServices/SEL", + "@Redfish.Copyright": "Copyright 2014-2016 Distributed Management Task= Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmt= f.org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220100SL/LogServices/index.json b/Redf= ishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/r= edfish/v1/Systems/2M220100SL/LogServices/index.json new file mode 100644 index 0000000000..2dc5bf57c4 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220100SL/LogServices/index.json @@ -0,0 +1,15 @@ +{ + "@odata.type": "#LogServiceCollection.LogServiceCollection", + "Name": "Log Service Collection", + "Description": "Collection of Logs for this System", + "Members@odata.count": 1, + "Members": [ + { + "@odata.id": "/redfish/v1/Systems/2M220100SL/LogServices/SEL" + } + ], + "Oem": {}, + "@odata.context": "/redfish/v1/$metadata#LogServiceCollection.LogServi= ceCollection", + "@odata.id": "/redfish/v1/Systems/2M220100SL/LogServices", + "@Redfish.Copyright": "Copyright 2014-2016 Distributed Management Task= Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmt= f.org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220100SL/index.json b/RedfishClientPkg= /Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/Sy= stems/2M220100SL/index.json new file mode 100644 index 0000000000..814f5f6373 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220100SL/index.json @@ -0,0 +1,70 @@ +{ + "@odata.type": "#ComputerSystem.v1_1_0.ComputerSystem", + "Id": "2M220100SL", + "Name": "Catfish System", + "SystemType": "Physical", + "AssetTag": "CATFISHASSETTAG", + "Manufacturer": "CatfishManufacturer", + "Model": "YellowCat1000", + "SerialNumber": "2M220100SL", + "SKU": "867530", + "PartNumber": "224071-J23", + "Description": "Catfish Implementation Recipe of simple scale-out mono= lithic server", + "UUID": "00000000-0000-0000-0000-000000000000", + "HostName": "catfishHostname", + "PowerState": "On", + "BiosVersion": "X00.1.2.3.4(build-23)", + "Status": { + "State": "Enabled", + "Health": "OK" + }, + "IndicatorLED": "Off", + "Boot": { + "BootSourceOverrideEnabled": "Once", + "BootSourceOverrideMode": "UEFI", + "UefiTargetBootSourceOverride": "uefiDevicePath", + "BootSourceOverrideTarget": "Pxe", + "BootSourceOverrideTarget@Redfish.AllowableValues": [ + "None", + "Pxe", + "Usb", + "Hdd", + "BiosSetup", + "UefiTarget", + "UefiHttp" + ] + }, + "LogServices": { + "@odata.id": "/redfish/v1/Systems/2M220100SL/LogServices" + }, + "Links": { + "Chassis": [ + { + "@odata.id": "/redfish/v1/Chassis/A33" + } + ], + "ManagedBy": [ + { + "@odata.id": "/redfish/v1/Managers/bmc" + } + ], + "Oem": {} + }, + "Actions": { + "#ComputerSystem.Reset": { + "target": "/redfish/v1/Systems/2M220100SL/Actions/ComputerSyst= em.Reset", + "ResetType@Redfish.AllowableValues": [ + "On", + "ForceOff", + "GracefulShutdown", + "ForceRestart", + "Nmi", + "GracefulRestart", + "ForceOn" + ] + } + }, + "@odata.context": "/redfish/v1/$metadata#ComputerSystem.ComputerSystem= ", + "@odata.id": "/redfish/v1/Systems/2M220100SL", + "@Redfish.Copyright": "Copyright 2014-2016 Distributed Management Task= Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmt= f.org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/index.json b/RedfishClientPkg/Tools/Redf= ish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/Systems/index= .json new file mode 100644 index 0000000000..091849e1a6 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/index.json @@ -0,0 +1,13 @@ +{ + "@odata.type": "#ComputerSystemCollection.ComputerSystemCollection", + "Name": "Computer System Collection", + "Members@odata.count": 1, + "Members": [ + { + "@odata.id": "/redfish/v1/Systems/2M220100SL" + } + ], + "@odata.context": "/redfish/v1/$metadata#ComputerSystemCollection.Comp= uterSystemCollection", + "@odata.id": "/redfish/v1/Systems", + "@Redfish.Copyright": "Copyright 2014-2016 Distributed Management Task= Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmt= f.org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/index.json b/RedfishClientPkg/Tools/Redfish-Prof= ile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/index.json new file mode 100644 index 0000000000..89312bcec1 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/index.json @@ -0,0 +1,31 @@ +{ + "@odata.type": "#ServiceRoot.v1_0_2.ServiceRoot", + "Id": "RootService", + "Name": "Root Service", + "RedfishVersion": "1.0.2", + "UUID": "92384634-2938-2342-8820-489239905423", + "Systems": { + "@odata.id": "/redfish/v1/Systems" + }, + "Chassis": { + "@odata.id": "/redfish/v1/Chassis" + }, + "Managers": { + "@odata.id": "/redfish/v1/Managers" + }, + "SessionService": { + "@odata.id": "/redfish/v1/SessionService" + }, + "AccountService": { + "@odata.id": "/redfish/v1/AccountService" + }, + "Links": { + "Sessions": { + "@odata.id": "/redfish/v1/SessionService/Sessions" + } + }, + "Oem": {}, + "@odata.context": "/redfish/v1/$metadata#ServiceRoot.ServiceRoot", + "@odata.id": "/redfish/v1/", + "@Redfish.Copyright": "Copyright 2014-2016 Distributed Management Task= Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmt= f.org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/odata/index.json b/RedfishClientPkg/Tools/Redfis= h-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/odata/index.json new file mode 100644 index 0000000000..ef253a35cb --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/odata/index.json @@ -0,0 +1,56 @@ +{ + "value": [ + { + "name": "Service", + "kind": "Singleton", + "url": "/redfish/v1/" + }, + { + "name": "Systems", + "kind": "Singleton", + "url": "/redfish/v1/Systems" + }, + { + "name": "Chassis", + "kind": "Singleton", + "url": "/redfish/v1/Chassis" + }, + { + "name": "Managers", + "kind": "Singleton", + "url": "/redfish/v1/Managers" + }, + { + "name": "AccountService", + "kind": "Singleton", + "url": "/redfish/v1/AccountService" + }, + { + "name": "SessionService", + "kind": "Singleton", + "url": "/redfish/v1/SessionService" + }, + { + "name": "EventService", + "kind": "Singleton", + "url": "/redfish/v1/EventService" + }, + { + "name": "JsonSchemas", + "kind": "Singleton", + "url": "/redfish/v1/JsonSchemas" + }, + { + "name": "Registries", + "kind": "Singleton", + "url": "/redfish/v1/Registries" + }, + { + "name": "Sessions", + "kind": "Singleton", + "url": "/redfish/v1/SessionService/Sessions" + } + ], + "@odata.context": "/redfish/v1/$metadata", + "@Redfish.Copyright":"Copyright 2014-2016 Distributed Management Task = Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmtf= .org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/redfishProfil= eSimulator.py b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/redfishPro= fileSimulator.py new file mode 100644 index 0000000000..24be52bafc --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/redfishProfileSimula= tor.py @@ -0,0 +1,125 @@ +# Copyright Notice: +# Copyright 2016 Distributed Management Task Force, Inc. All rights reserv= ed. +# License: BSD 3-Clause License. For full text see link: https://github.co= m/DMTF/Redfish-Profile-Simulator/blob/master/LICENSE.md + +# This program is dependent on the following Python packages that should b= e installed separately with pip: +# pip install Flask +# +# standard python packages +import sys +import getopt +import os + +rfVersion =3D "0.9.6" +rfProgram1 =3D "redfishProfileSimulator" +rfProgram2 =3D " " +rfUsage1 =3D "[-Vh] [--Version][--help]" +rfUsage2 =3D "[-H] [-P] [-p]" +rfUsage3 =3D "[--Host=3D] [--Port=3D] [--profile_path=3D]" + + +def rf_usage(): + print("Usage:") + print(" ", rfProgram1, " ", rfUsage1) + print(" ", rfProgram1, " ", rfUsage2) + print(" ", rfProgram2, " ", rfUsage3) + + +def rf_help(): + print(rfProgram1,"implements a simulation of a redfish service for= the \"Simple OCP Server V1\" Mockup.") + print(" The simulation includes an http server, RestEngine, and dy= namic Redfish datamodel.") + print(" You can GET, PATHCH,... to the service just like a real Re= dfish service.") + print(" Both Basic and Redfish Session/Token authentication is sup= ported (for a single user/passwd and token") + print(" the user/passwd is: root/password123456. The authT= oken is: 123456SESSIONauthcode") + print(" these can be changed by editing the redfishURIs.py file= . will make dynamic later.") + print(" The http service and Rest engine is built on Flask, and al= l code is Python 3.4+") + print(" The data model resources are \"initialized\" from the SPMF= \"SimpleOcpServerV1\" Mockup.") + print(" and stored as python dictionaries--then the dictionari= es are updated with patches, posts, deletes.") + print(" The program can be extended to support other mockup \"prof= iles\".") + print("") + print(" By default, the simulation runs on localhost (127.0.0.1), = on port 5000.") + print(" These can be changed with CLI options: -P -H | --port=3D --host=3D") + print("") + print("Version: ", rfVersion) + rf_usage() + print("") + print(" -V, --Version, --- th= e program version") + print(" -h, --help, --- he= lp") + print(" -H, --Host=3D --- = host IP address. dflt=3D127.0.0.1") + print(" -P, --Port=3D --- = the port to use. dflt=3D5000") + print(" -p, --profile=3D --- = the path to the Redfish profile to use. " + "dflt=3D\"./MockupData/SimpleOcpServerV1\" ") + + +def main(argv): + # set default option args + rf_profile_path =3D os.path.abspath("./MockupData/SimpleOcpServerV1") + rf_host =3D "127.0.0.1" + rf_port =3D 5000 + + try: + opts, args =3D getopt.getopt(argv[1:], "VhH:P:p:", + ["Version", "help", "Host=3D", "Port=3D= ", "profile=3D"]) + except getopt.GetoptError: + print(rfProgram1, ": Error parsing options") + rf_usage() + sys.exit(2) + for opt, arg in opts: + if opt in ("-h", "--help"): + rf_help() + sys.exit(0) + elif opt in ("-V", "--Version"): + print("Version:", rfVersion) + sys.exit(0) + elif opt in ("-p", "--profile"): + rf_profile_path =3D arg + elif opt in "--Host=3D": + rf_host =3D arg + elif opt in "--Port=3D": + rf_port=3Dint(arg) + else: + print(" ", rfProgram1, ": Error: unsupported option") + rf_usage() + sys.exit(2) + + print("{} Version: {}".format(rfProgram1,rfVersion)) + print(" Starting redfishProfileSimulator at: hostIP=3D{}, port=3D{= }".format(rf_host, rf_port)) + print(" Using Profile at {}".format(rf_profile_path)) + + if os.path.isdir(rf_profile_path): + # import the classes and code we run from main. + from v1sim.serviceVersions import RfServiceVersions + from v1sim.serviceRoot import RfServiceRoot + # rfApi_SimpleServer is a function in ./RedfishProfileSim/redfishU= RIs.py. + # It loads the flask APIs (URIs), and starts the flask service + from v1sim.redfishURIs import rfApi_SimpleServer + + # create the root service resource + root_path =3D os.path.normpath("redfish/v1") + + # create the version resource for GET /redfish + versions =3D RfServiceVersions(rf_profile_path, "redfish") + root =3D RfServiceRoot(rf_profile_path, root_path) + + # start the flask REST API service + rfApi_SimpleServer(root, versions, host=3Drf_host, port=3Drf_port) + else: + print("invalid profile path") + + +if __name__ =3D=3D "__main__": + main(sys.argv) + + + + + #http://127.0.0.1:5000/ + + #app.run(host=3D"0.0.0.0") # run on all IPs + #run(host=3DNone, port=3DNone, debug=3DNone, **options) + # host=3D0.0.0.0 server avail externally -- all IPs + # host=3D127.0.0.1 is default + # port=3D5000 default, or port defined in SERVER_NAME config var + + + diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/__init_= _.py b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/__init__.py new file mode 100644 index 0000000000..72007ff42a --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/__init__.py @@ -0,0 +1,4 @@ +# Copyright Notice: +# Copyright 2016 Distributed Management Task Force, Inc. All rights reserv= ed. +# License: BSD 3-Clause License. For full text see link: https://github.co= m/DMTF/Redfish-Profile-Simulator/blob/master/LICENSE.md + diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/account= Service.py b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/account= Service.py new file mode 100644 index 0000000000..1c056f0b86 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/accountService= .py @@ -0,0 +1,76 @@ +# Copyright Notice: +# Copyright 2016 Distributed Management Task Force, Inc. All rights reserv= ed. +# License: BSD 3-Clause License. For full text see link: https://github.co= m/DMTF/Redfish-Profile-Simulator/blob/master/LICENSE.md + +import os + +from .resource import RfResource, RfCollection + + +class RfAccountServiceObj(RfResource): + # create instance of each AccountService + def create_sub_objects(self, base_path, rel_path): + if os.path.isdir(os.path.join(base_path, os.path.normpath("redfish= /v1/AccountService/Accounts"))): + self.components["Accounts"] =3D RfAccountCollection(base_path, + os.path.norm= path("redfish/v1/AccountService/Accounts"), + parent=3Dsel= f) + + if os.path.isdir(os.path.join(base_path, os.path.normpath("redfish= /v1/AccountService/Roles"))): + self.components["Roles"] =3D RfRoleCollection(base_path, + os.path.normpath("= redfish/v1/AccountService/Roles"), + parent=3Dself) + + def patch_resource(self, patch_data): + # first verify client didn't send us a property we cant patch + patachables =3D ("MinPasswordLength", "AccountLockoutThreshold", + "AccountLockoutDuration", "AccountLockoutCounterRes= etAfter") + + for key in patch_data.keys(): + if key not in patachables: + return 4, 400, "Invalid Patch Property Sent", "" + + # now patch the valid properties sent + for key in patch_data.keys(): + new_val =3D patch_data[key] + print("new_val:{}".format(new_val)) + try: + num_val =3D round(new_val) + except ValueError: + return 4, 400, "invalid value", "" + else: + patch_data[key] =3D num_val + + # if here, we know all the patch data is valid properties and prop= erties + new_duration =3D self.res_data["AccountLockoutDuration"] + new_reset_after =3D self.res_data["AccountLockoutCounterResetAfter= "] + if "AccountLockoutDuration" in patch_data: + new_duration =3D patch_data["AccountLockoutDuration"] + if "AccountLockoutCounterResetAfter" in patch_data: + new_reset_after =3D patch_data["AccountLockoutCounterResetAfte= r"] + if new_duration < new_reset_after: + return 4, 400, "invalid value", "" + + # if here, all values are good. set them + for key in patch_data.keys(): + self.res_data[key] =3D patch_data[key] + return 0, 204, None, None + + +class RfAccountCollection(RfCollection): + def element_type(self): + return RfAccountObj + + +# Service Collection Entries +class RfAccountObj(RfResource): + pass + + +class RfRoleCollection(RfCollection): + def element_type(self): + return RfRoleObj + + +# Service Collection Entries +class RfRoleObj(RfResource): + pass diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/chassis= .py b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/chassis.py new file mode 100644 index 0000000000..88e5a000f3 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/chassis.py @@ -0,0 +1,115 @@ +# Copyright Notice: +# Copyright 2016 Distributed Management Task Force, Inc. All rights reserv= ed. +# License: BSD 3-Clause License. For full text see link: https://github.co= m/DMTF/Redfish-Profile-Simulator/blob/master/LICENSE.md + +import os + +from .resource import RfResource, RfCollection + + +class RfChassisCollection(RfCollection): + def element_type(self): + return RfChassisObj + + +class RfChassisObj(RfResource): + # create the dependent sub-objects that live under the chassis object + def create_sub_objects(self, base_path, rel_path): + resource_path =3D os.path.join(base_path, rel_path); + contents =3D os.listdir(resource_path) + for item in contents: + if item =3D=3D "Thermal": + self.components[item] =3D RfChassisThermal(base_path, os.p= ath.join(rel_path, item), parent=3Dself) + elif item =3D=3D "Power": + self.components[item] =3D RfChassisPower(base_path, os.pat= h.join(rel_path, item), parent=3Dself) + + def patch_resource(self, patch_data): + # first verify client didn't send us a property we cant patch + for key in patch_data.keys(): + if key !=3D "AssetTag" and key !=3D "IndicatorLED": + return 4, 400, "Invalid Patch Property Sent", "" + # now patch the valid properties sent + if "AssetTag" in patch_data: + self.res_data['AssetTag'] =3D patch_data['AssetTag'] + if "IndicatorLED" in patch_data: + self.res_data['IndicatorLED'] =3D patch_data['IndicatorLED'] + return 0, 204, None, None + + def reset_resource(self, reset_data): + if "ResetType" in reset_data: + # print("RESETDATA: {}".format(resetData)) + value =3D reset_data['ResetType'] + valid_values =3D self.res_data["Actions"]["#Chassis.Reset"]["R= esetType@Redfish.AllowableValues"] + if value in valid_values: + # it is a supoported reset action modify other properties= appropritely + if value =3D=3D "On": + self.res_data["PowerState"] =3D "On" + print("PROFILE_SIM--SERVER WAS RESET. power now ON") + elif value =3D=3D "ForceOff": + self.res_data["PowerState"] =3D "Off" + print("PROFILE_SIM--SERVER WAS RESET. Power now Off") + return 0, 204, "Chassis Reset", "" + else: + return 4, 400, "Invalid reset value: ResetType", "" + else: # invalid request + return 4, 400, "Invalid request property", "" + + +# subclass Thermal Metrics +class RfChassisThermal(RfResource): + pass + + +# subclass Power Metrics +class RfChassisPower(RfResource): + def create_sub_objects(self, base_path, rel_path): + resource_path =3D os.path.join(base_path, rel_path); + contents =3D os.listdir(resource_path) + for item in contents: + if item =3D=3D "FastPowerMeter": + self.components[item] =3D RfFastPowerMeter(base_path, os.p= ath.join(rel_path, item), parent=3Dself) + elif item =3D=3D "FederatedGroupCapping": + self.components[item] =3D RfFederatedGroupCapping(base_pat= h, os.path.join(rel_path, item), parent=3Dself) + elif item =3D=3D "PowerMeter": + self.components[item] =3D RfPowerMeter(base_path, os.path.= join(rel_path, item), parent=3Dself) + + def patch_resource(self, patchData): + # first verify client didn't send us a property we cant patch + for key in patchData.keys(): + if key !=3D "PowerControl": + return 4, 400, "Invalid Patch Property Sent", "" + else: # Powercontrol: + for prop2 in patchData["PowerControl"][0].keys(): + if prop2 !=3D "PowerLimit": + return 4, 400, "Invalid Patch Property Sent", "" + else: # PowerLimit + for prop3 in patchData["PowerControl"][0]["PowerLi= mit"].keys(): + if prop3 !=3D "LimitInWatts" and prop3 !=3D "L= imitException" and prop3 !=3D "CorrectionInMs": + return 4, 400, "Invalid Patch Property Sen= t", "" + # now patch the valid properties sent + if "PowerControl" in patchData: + if "PowerLimit" in patchData["PowerControl"][0]: + patch_power_limit_dict =3D patchData["PowerControl"][0]["P= owerLimit"] + catfish_power_limit_dict =3D self.res_data["PowerControl"]= [0]["PowerLimit"] + if "LimitInWatts" in patch_power_limit_dict: + self.res_data["PowerControl"][0]["PowerLimit"]["LimitI= nWatts"] =3D \ + patch_power_limit_dict['LimitInWatts'] + if "LimitException" in patch_power_limit_dict: + self.res_data["PowerControl"][0]["PowerLimit"]['LimitE= xception'] =3D \ + patch_power_limit_dict['LimitException'] + if "CorrectionInMs" in patch_power_limit_dict: + self.res_data["PowerControl"][0]["PowerLimit"]['Correc= tionInMs'] =3D \ + patch_power_limit_dict['CorrectionInMs'] + return 0, 204, None, None + + +class RfFastPowerMeter(RfResource): + pass + + +class RfFederatedGroupCapping(RfResource): + pass + + +class RfPowerMeter(RfResource): + pass diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/common_= services.py b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/common= _services.py new file mode 100644 index 0000000000..b1a5082d45 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/common_service= s.py @@ -0,0 +1,28 @@ +import os + +from .resource import RfCollection, RfResource + + +class RfLogServiceCollection(RfCollection): + def element_type(self): + return RfLogService + + +class RfLogService(RfResource): + def create_sub_objects(self, base_path, rel_path): + resource_path =3D os.path.join(base_path, rel_path); + contents =3D os.listdir(resource_path) + for item in contents: + if item =3D=3D "Entries": + self.components[item] =3D RfLogEntriesCollection(base_path, + os.path.joi= n(rel_path, item), + parent=3Dse= lf) + + +class RfLogEntriesCollection(RfCollection): + def element_type(self): + return RfLogEntry + + +class RfLogEntry(RfResource): + pass diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/flask_r= edfish_auth.py b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/fla= sk_redfish_auth.py new file mode 100644 index 0000000000..61a5fd97e9 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/flask_redfish_= auth.py @@ -0,0 +1,278 @@ +# Copyright Notice: +# Copyright 2016 Distributed Management Task Force, Inc. All rights reserv= ed. +# License: BSD 3-Clause License. For full text see link: https://github.co= m/DMTF/Redfish-Profile-Simulator/blob/master/LICENSE.md + +""" +flask_redfish_auth + +adapted from: + flask_httpauth + =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + This module provides Basic and Digest HTTP authentication for Flask ro= utes. + :copyright: (C) 2014 by Miguel Grinberg. + :license: MIT, see LICENSE for more details, + at https://github.com/miguelgrinberg/Flask-HTTPAuth/blob/master/LI= CENSE + + see documentation at: http://flask.pocoo.org/snippets/8/ + code and docs at: https://github.com/miguelgrinberg/flask-httpau= th/ + +**** modified to implement EITHER Redfish Token Auth or Basic Auth + this file is imported by: catfishURIs.py + + Usage: In RedfishProfileSimulator: see this flow below in redfishURIs.py + ... in redfishURIs.py + from .flask_redfish_auth import RfHTTPBasicOrTokenAuth + ... + #create instance of the modified Basic or Redfish Token auth + # this is what is in this file + auth=3DRfHTTPBasicOrTokenAuth + + #define basic auth decorator used by flask + @auth.verify_basic_password + def verifyRfPasswd(user,passwd): + ... + + #define Redfish Token/Session auth decorator used by flask + @auth.verify_token + def verifyRfToken(auth_token): + .. + + @app.route("/api", methods=3D['GET']) + @auth.rfAuthRequired + def api() + ... +""" + +from functools import wraps + +from flask import request, make_response + + +# this is the Base HTTP Auth class that is used to derive the Redfish "Bas= ic or Token Auth" class +class HTTPAuth(object): + def __init__(self, scheme=3DNone, realm=3DNone): + def default_get_password(userx): + return None + + def default_basic_auth_error(): + return "Unauthorized Access" + + def default_token_auth_error(): + return "Unauthorized Access. Invalid authentication token" + + self.scheme =3D scheme + self.realm =3D realm or "Authentication Required" + self.get_password(default_get_password) + self.basic_error_handler(default_basic_auth_error) + self.token_error_handler(default_token_auth_error) + + def get_password(self, f): + self.get_password_callback =3D f + return f + + def token_error_handler(self, f): + @wraps(f) + def decorated(*args, **kwargs): + res =3D f(*args, **kwargs) + if type(res) =3D=3D str: + res =3D make_response(res) + res.status_code =3D 401 + return res + + self.auth_token_error_callback =3D decorated + return decorated + + def basic_error_handler(self, f): + @wraps(f) + def decorated(*args, **kwargs): + res =3D f(*args, **kwargs) + if type(res) =3D=3D str: + res =3D make_response(res) + res.status_code =3D 401 + if 'WWW-Authenticate' not in res.headers.keys(): + res.headers['WWW-Authenticate'] =3D self.authenticate_head= er() + return res + + self.auth_basic_error_callback =3D decorated + return decorated + + # for redfish, we need to hook this to check if its token auth before = trying basic auth + def rfAuthRequired(self, f): + @wraps(f) + def decorated(*args, **kwargs): + auth =3D request.authorization + print("in rfAuthRequired") + print("headers: {}".format(request.headers)) + # We need to ignore authentication headers for OPTIONS to avoid + # unwanted interactions with CORS. + # Chrome and Firefox issue a preflight OPTIONS request to check + # Access-Control-* headers, and will fail if it returns 401. + if request.method !=3D 'OPTIONS': + # auth is None if the Basic auth header didn't come in the= request + found_token =3D False + if (auth is None): + ###print("auth is None") + # check if we have a redfish auth token + hdr_token_key =3D "X-Auth-Token" + auth_token =3D request.headers.get(hdr_token_key) + ###print("token=3D{}".format(auth_token)) + if (auth_token is not None): + found_token =3D True + # yeah! we have an auth token in the headers + authOk =3D self.verify_token_callback(auth_token) + ###print("verify_token=3D{}".format(authOk)) + if (authOk is not True): + # we had an auth token, but it didn't validate + return (self.auth_token_error_callback()) + + # now continue with normal Basic Auth validation + if (found_token is not True): + ###print("try basic") + if auth: + password =3D self.get_password_callback(auth.usern= ame) + else: + password =3D None + ###print("basic auth: auth=3D{}, pwd=3D{}".format(auth= ,password)) + if (not self.authenticate(auth, password)): + return (self.auth_basic_error_callback()) + ###print("now execute the function") + return (f(*args, **kwargs)) + + return (decorated) + + def username(self): + if not request.authorization: + return "" + return request.authorization.username + + +# this class is derived from HTTPAuth above +class RfHTTPBasicOrTokenAuth(HTTPAuth): + def __init__(self, scheme=3DNone, realm=3DNone): + super(RfHTTPBasicOrTokenAuth, self).__init__(scheme, realm) + self.hash_password(None) + self.verify_basic_password(None) + self.verify_token(None) + + def hash_password(self, f): + self.hash_password_callback =3D f + return f + + def verify_basic_password(self, f): + self.verify_password_callback =3D f + return f + + def verify_token(self, f): + self.verify_token_callback =3D f + return f + + def authenticate_header(self): + return '{0} realm=3D"{1}"'.format(self.scheme or 'Basic', self.rea= lm) + + def authenticate(self, auth, stored_password): + if auth: + username =3D auth.username + client_password =3D auth.password + else: + username =3D "" + client_password =3D "" + if self.verify_password_callback: + return self.verify_password_callback(username, client_password) + if not auth: + return False + if self.hash_password_callback: + try: + client_password =3D self.hash_password_callback(client_pas= sword) + except TypeError: + client_password =3D self.hash_password_callback(username, + client_passw= ord) + return client_password =3D=3D stored_password + + +''' +class HTTPDigestAuth(HTTPAuth): + def __init__(self, scheme=3DNone, realm=3DNone, use_ha1_pw=3DFalse): + super(HTTPDigestAuth, self).__init__(scheme, realm) + self.use_ha1_pw =3D use_ha1_pw + self.random =3D SystemRandom() + try: + self.random.random() + except NotImplementedError: + self.random =3D Random() + + def _generate_random(): + return md5(str(self.random.random()).encode('utf-8')).hexdiges= t() + + def default_generate_nonce(): + session["auth_nonce"] =3D _generate_random() + return session["auth_nonce"] + + def default_verify_nonce(nonce): + return nonce =3D=3D session.get("auth_nonce") + + def default_generate_opaque(): + session["auth_opaque"] =3D _generate_random() + return session["auth_opaque"] + + def default_verify_opaque(opaque): + return opaque =3D=3D session.get("auth_opaque") + + self.generate_nonce(default_generate_nonce) + self.generate_opaque(default_generate_opaque) + self.verify_nonce(default_verify_nonce) + self.verify_opaque(default_verify_opaque) + + def generate_nonce(self, f): + self.generate_nonce_callback =3D f + return f + + def verify_nonce(self, f): + self.verify_nonce_callback =3D f + return f + + def generate_opaque(self, f): + self.generate_opaque_callback =3D f + return f + + def verify_opaque(self, f): + self.verify_opaque_callback =3D f + return f + + def get_nonce(self): + return self.generate_nonce_callback() + + def get_opaque(self): + return self.generate_opaque_callback() + + def generate_ha1(self, username, password): + a1 =3D username + ":" + self.realm + ":" + password + a1 =3D a1.encode('utf-8') + return md5(a1).hexdigest() + + def authenticate_header(self): + session["auth_nonce"] =3D self.get_nonce() + session["auth_opaque"] =3D self.get_opaque() + return '{0} realm=3D"{1}",nonce=3D"{49}",opaque=3D"{3}"'.format( + self.scheme or 'Digest', self.realm, session["auth_nonce"], + session["auth_opaque"]) + + def authenticate(self, auth, stored_password_or_ha1): + if not auth or not auth.username or not auth.realm or not auth.uri= \ + or not auth.nonce or not auth.response \ + or not stored_password_or_ha1: + return False + if not(self.verify_nonce_callback(auth.nonce)) or \ + not(self.verify_opaque_callback(auth.opaque)): + return False + if self.use_ha1_pw: + ha1 =3D stored_password_or_ha1 + else: + a1 =3D auth.username + ":" + auth.realm + ":" + \ + stored_password_or_ha1 + ha1 =3D md5(a1.encode('utf-8')).hexdigest() + a2 =3D request.method + ":" + auth.uri + ha2 =3D md5(a2.encode('utf-8')).hexdigest() + a3 =3D ha1 + ":" + auth.nonce + ":" + ha2 + response =3D md5(a3.encode('utf-8')).hexdigest() + return response =3D=3D auth.response +''' diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/manager= s.py b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/managers.py new file mode 100644 index 0000000000..e09ae3d500 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/managers.py @@ -0,0 +1,211 @@ +# Copyright Notice: +# Copyright 2016 Distributed Management Task Force, Inc. All rights reserv= ed. +# License: BSD 3-Clause License. For full text see link: https://github.co= m/DMTF/Redfish-Profile-Simulator/blob/master/LICENSE.md + +import os + +from .common_services import RfLogServiceCollection +from .network import RfNetworkService +from .resource import RfResource, RfCollection +from .security import RfSecurityService + + +class RfManagersCollection(RfCollection): + def element_type(self): + return RfManagerObj + + +class RfManagerObj(RfResource): + """ + create the dependent sub-objects that live under the Manager object + """ + + def create_sub_objects(self, base_path, rel_path): + resource_path =3D os.path.join(base_path, rel_path); + contents =3D os.listdir(resource_path) + for item in contents: + if item =3D=3D "EthernetInterfaces": + self.components[item] =3D RfManagerEthernetColl(base_path,= os.path.join(rel_path, item), parent=3Dself) + elif item =3D=3D "NetworkProtocol": + self.components[item] =3D RfManagerNetworkProtocol(base_pa= th, os.path.join(rel_path, item), parent=3Dself) + elif item =3D=3D "SerialInterfaces": + self.components[item] =3D RfSerialInterfaceCollection(base= _path, os.path.join(rel_path, item), + parent= =3Dself) + elif item =3D=3D "VirutalMedia": + self.components[item] =3D RfVirtualMediaCollection(base_pa= th, os.path.join(rel_path, item), parent=3Dself) + elif item =3D=3D "NICs": + self.components[item] =3D RfNics(base_path, os.path.join(r= el_path, item), parent=3Dself) + elif item =3D=3D "LogServices": + self.components[item] =3D RfLogServiceCollection(base_path= , os.path.join(rel_path, item), parent=3Dself) + elif item =3D=3D "ActiveHealthSystem": + self.components[item] =3D RfActiveHealthSystem(base_path, = os.path.join(rel_path, item), parent=3Dself) + elif item =3D=3D "DateTime": + self.components[item] =3D RfDateTime(base_path, os.path.jo= in(rel_path, item), parent=3Dself) + elif item =3D=3D "EmbeddedMedia": + self.components[item] =3D RfEmbeddedMedia(base_path, os.pa= th.join(rel_path, item), parent=3Dself) + elif item =3D=3D "FederationGroups": + self.components[item] =3D RfFederationGroupCollection(base= _path, os.path.join(rel_path, item), + parent= =3Dself) + elif item =3D=3D "FederationPeers": + self.components[item] =3D RfFederationPeerCollection(base_= path, os.path.join(rel_path, item), parent=3Dself) + elif item =3D=3D "LicenseService": + self.components[item] =3D RfLicenseServiceCollection(base_= path, os.path.join(rel_path, item), parent=3Dself) + elif item =3D=3D "SecurityService": + self.components[item] =3D RfSecurityService(base_path, os.= path.join(rel_path, item), parent=3Dself) + elif item =3D=3D "UpdateService": + self.components[item] =3D RfManagerUpdateService(base_path= , os.path.join(rel_path, item), parent=3Dself) + elif item =3D=3D "NetworkService": + self.components[item] =3D RfNetworkService(base_path, os.p= ath.join(rel_path, item), parent=3Dself) + + def patch_resource(self, patch_data): + # first verify client didn't send us a property we cant patch + for key in patch_data.keys(): + if key !=3D "DateTime" and key !=3D "DateTimeLocalOffset": + return 4, 400, "Invalid Patch Property Sent", "" + + date_time =3D None + date_time_offset =3D None + local_offset =3D None + + # now patch the valid properties sent + if "DateTime" in patch_data: + date_time =3D patch_data['DateTime'] + date_time_offset =3D date_time[-6:] # get last 6 chars ....+0= 0:00 or -00:00 + if "DateTimeLocalOffset" in patch_data: + local_offset =3D patch_data['DateTimeLocalOffset'] + + # verify that if both DateTime and DateTimeLocalOffset were sent, = thant + # the offsets are the same. (no reason to send both though) + if date_time_offset is not None and local_offset is not None: + if date_time_offset !=3D local_offset: + return 4, 409, "Offsets in DateTime and DateTimeLocalOffse= t conflict", None # 409 Conflict + + # reconcile localOffset and the offset in DateTime to write back + # if only DateTime was updated, also update dateTimeLocalOffset + if local_offset is None: + local_offset =3D date_time_offset + # if only DateTimeLocalOffset was updated (timezone change), also = update DateTime + if date_time is None: + date_time =3D self.res_data['DateTime'] # read current value = to get time + date_time =3D date_time[:-6] # strip the offset + date_time =3D date_time + local_offset # add back the offset = sent in in DateTimeLocalOFfset + + # TODO: issue 1545 in SPMF is ambiguity of what patching DateTime= LocalOffset should actually do. + # this may need to be updated once issue is resolved + + # now write the valid properties with updated values + self.res_data['DateTime'] =3D date_time + self.res_data['DateTimeLocalOffset'] =3D local_offset + return 0, 204, None, None + + def reset_resource(self, reset_data): + if "ResetType" in reset_data: + value =3D reset_data['ResetType'] + valid_values =3D self.res_data["Actions"]["#Manager.Reset"]["R= esetType@Redfish.AllowableValues"] + if value in valid_values: + # it is a supoported reset action modify other properties= appropritely + # nothing to do--manager always on in this profile + return 0, 204, "System Reset", "" + else: + return 4, 400, "Invalid reset value: ResetType", "" + else: # invalid request + return 4, 400, "Invalid request property", "" + + +class RfManagerNetworkProtocol(RfResource): + pass + + +# the Manager Ethernet Collection +class RfManagerEthernetColl(RfCollection): + def element_type(self): + return RfManagerEthernet + + +# the Manager Ethernet Instance +class RfManagerEthernet(RfResource): + def patch_resource(self, patch_data): + # TODO: check and save the data + # for now, just return ok w/ 204 no content + return 0, 204, None, None + + +class RfSerialInterfaceCollection(RfCollection): + def element_type(self): + return RfSerialInterface + + +class RfSerialInterface(RfResource): + pass + + +class RfVirtualMediaCollection(RfCollection): + def element_type(self): + return RfVirtualMedia + + +class RfVirtualMedia(RfResource): + pass + + +class RfNics(RfResource): + def create_sub_objects(self, base_path, rel_path): + resource_path =3D os.path.join(base_path, rel_path); + contents =3D os.listdir(resource_path) + for item in contents: + if item =3D=3D "Dedicated": + self.components[item] =3D RfDedicatedNicCollection(base_pa= th, + os.path.j= oin(rel_path, item), + parent=3D= self) + + +class RfDedicatedNicCollection(RfCollection): + def element_type(self): + return RfNic + + +class RfNic(RfResource): + pass + + +class RfActiveHealthSystem(RfResource): + pass + + +class RfDateTime(RfResource): + pass + + +class RfEmbeddedMedia(RfResource): + pass + + +class RfLicenseServiceCollection(RfCollection): + def element_type(self): + return RfLicenseService + + +class RfLicenseService(RfResource): + pass + + +class RfFederationGroupCollection(RfCollection): + def element_type(self): + return RfFederationGroup + + +class RfFederationGroup(RfResource): + pass + + +class RfFederationPeerCollection(RfCollection): + def element_type(self): + return RfFederationPeer + + +class RfFederationPeer(RfResource): + pass + + +class RfManagerUpdateService(RfResource): + pass diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/network= .py b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/network.py new file mode 100644 index 0000000000..d96d29c5ad --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/network.py @@ -0,0 +1,48 @@ +import os + +from .resource import RfCollection, RfResource + + +class RfNetworkService(RfResource): + pass + + +class RfEthernetCollection(RfCollection): + def element_type(self): + return RfEthernet + + def create_sub_objects(self, base_path, rel_path): + self.elements =3D {} + resource_path =3D os.path.join(base_path, rel_path); + contents =3D os.listdir(resource_path) + for item in contents: + if item =3D=3D "VLANs": + self.components[item] =3D RfVLanCollection(base_path, os.p= ath.join(rel_path, item), parent=3Dself) + else: + item_path =3D os.path.join(resource_path, item) + if os.path.isdir(item_path): + etype =3D self.element_type() # type: Type[RfEthernet= Collection] + self.elements[item] =3D etype(base_path, + os.path.normpath("%s/%s" %= (rel_path, item)), + parent=3Dself) + +class RfEthernet(RfResource): + pass + + +class RfVLanCollection(RfCollection): + def element_type(self): + return RfVLan + + +class RfVLan(RfResource): + pass + + +class RfNetworkInterfaceCollection(RfCollection): + def element_type(self): + return RfNetworkInterface + + +class RfNetworkInterface(RfResource): + pass diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/redfish= URIs.py b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/redfishURI= s.py new file mode 100644 index 0000000000..2380a4058a --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/redfishURIs.py @@ -0,0 +1,309 @@ +# Copyright Notice: +# Copyright 2016 Distributed Management Task Force, Inc. All rights reserv= ed. +# License: BSD 3-Clause License. For full text see link: https://github.co= m/DMTF/Redfish-Profile-Simulator/blob/master/LICENSE.md + +import json + +from flask import Flask +from flask import request + +from .flask_redfish_auth import RfHTTPBasicOrTokenAuth +from .resource import RfResource, RfResourceRaw, RfCollection + + +def rfApi_SimpleServer(root, versions, host=3D"127.0.0.1", port=3D5000): + app =3D Flask(__name__) + + # create auth class that does basic or redifish session auth + auth =3D RfHTTPBasicOrTokenAuth() + + # define basic auth decorator used by flask + # for basic auth, we only support user=3Dcatfish, passwd=3Dhunter + @auth.verify_basic_password + def verify_rf_passwd(user, passwd): + if user =3D=3D "root": + if passwd =3D=3D "password123456": + return True + return False + + # define Redfish Token/Session auth decorator used by flask + # for session token auth, only support toden: 123456CATFISHauthcode + @auth.verify_token + def verify_rf_token(auth_token): + # lookup the user for this token + # lookup the privileges for this user + # check privilege + # print("at verify_rf_token. auth_token=3D{}".format(auth_token)) + if auth_token =3D=3D "123456SESSIONauthcode": # the magic token + return True + else: + return False + + # define redfish URI APIs for flask + + # GET /redfish + @app.route("/redfish", methods=3D['GET']) + @app.route("/redfish/", methods=3D['GET']) + def rf_versions(): + return versions.get_resource() + + # GET /redfish/v1 + @app.route("/redfish/v1", methods=3D['GET']) + @app.route("/redfish/v1/", methods=3D['GET']) + def rf_service_root(): + return root.get_resource() + + # GET /redfish/v1/$metadata + @app.route("/redfish/v1/$metadata", methods=3D['GET']) + def rf_metadata(rf_path=3D'$metadata'): + return resolve_path(root, rf_path) + + # GET /redfish/v1/odata + @app.route("/redfish/v1/odata", methods=3D['GET']) + @app.route("/redfish/v1/odata/", methods=3D['GET']) + def rf_odata(rf_path=3D'odata'): + return resolve_path(root, rf_path) + + @app.route("/redfish/v1/", methods=3D['GET']) + @app.route("/redfish/v1//", methods=3D['GET']) + @auth.rfAuthRequired + def rf_subsystems(rf_path): + return resolve_path(root, rf_path) + + # this is a special test API -- an authenticated service root + @app.route("/redfish/v1/A", methods=3D['GET']) + @auth.rfAuthRequired + def rf_service_root2(): + print("root2") + return root.get_resource() + + @app.route("/redfish/v1/Systems/", methods=3D['PATCH']) + @app.route("/redfish/v1/Systems//", methods=3D['PATCH']) + @auth.rfAuthRequired + def rf_computer_systempatch(sys_path): + rdata =3D request.get_json(cache=3DTrue) + print("rdata:{}".format(rdata)) + obj =3D patch_path(root.systems, sys_path) + rc, status_code, err_string, resp =3D obj.patch_resource(rdata) + if rc =3D=3D 0: + return "", status_code + else: + return err_string, status_code + + @app.route("/redfish/v1/Systems//Actions/ComputerSys= tem.Reset", methods=3D['POST']) + @app.route("/redfish/v1/Systems//Actions/ComputerSys= tem.Reset/", methods=3D['POST']) + @auth.rfAuthRequired + def rf_computer_systemreset(system_id): + # print("in reset") + rdata =3D request.get_json(cache=3DTrue) + # print("rdata:{}".format(rdata)) + rc, status_code, err_string, resp =3D root.components['Systems'].g= et_element(system_id).reset_resource(rdata) + if rc =3D=3D 0: + return "", status_code + else: + return err_string, status_code + + @app.route("/redfish/v1/Systems//bios/Actions/Bios.R= esetBios", methods=3D['POST']) + @app.route("/redfish/v1/Systems//bios/Actions/Bios.R= esetBios/", methods=3D['POST']) + @auth.rfAuthRequired + def rf_computer_biosreset(system_id): + # print("in reset") + rdata =3D request.get_json(cache=3DTrue) + # print("rdata:{}".format(rdata)) + system =3D root.systems.get_element(system_id) + bios =3D system.get_component("bios") + rc, status_code, err_string, resp =3D bios.reset_resource(rdata) + if rc =3D=3D 0: + return "", status_code + else: + return err_string, status_code + + @app.route("/redfish/v1/Systems//bios/Actions/Bios.C= hangePassword", methods=3D['PATCH']) + @app.route("/redfish/v1/Systems//bios/Actions/Bios.C= hangePassword/", methods=3D['PATCH']) + @auth.rfAuthRequired + def rf_computer_change_pswd(system_id): + # print("in reset") + rdata =3D request.get_json(cache=3DTrue) + # print("rdata:{}".format(rdata)) + system =3D root.systems.get_element(system_id) + bios =3D system.get_component("bios") + rc, status_code, err_string, resp =3D bios.change_password(rdata) + if rc =3D=3D 0: + return "", status_code + else: + return err_string, status_code + + @app.route("/redfish/v1/Chassis//Actions/Chassis.Re= set", methods=3D['POST']) + @app.route("/redfish/v1/Chassis//Actions/Chassis.Re= set/", methods=3D['POST']) + @auth.rfAuthRequired + def rf_computer_chassisreset(chassis_id): + # print("in reset") + rdata =3D request.get_json(cache=3DTrue) + # print("rdata:{}".format(rdata)) + rc, status_code, err_string, resp =3D root.chassis.get_element(cha= ssis_id).reset_resource(rdata) + if rc =3D=3D 0: + return "", status_code + else: + return err_string, status_code + + @app.route("/redfish/v1/Chassis//Power", methods=3D= ['PATCH']) + @app.route("/redfish/v1/Chassis//Power/", methods= =3D['PATCH']) + @auth.rfAuthRequired + def rf_chassis_powerpatch(chassis_id): + # rawdata=3Drequest.data + rdata =3D request.get_json(cache=3DTrue) + # print("RRrdata:{}".format(rdata)) + rc, status_code, err_string, resp =3D root.chassis.get_element(cha= ssis_id).power.patch_resource(rdata) + if rc =3D=3D 0: + return "", status_code + else: + return err_string, status_code + + @app.route("/redfish/v1/Managers/", methods=3D['PAT= CH']) + @app.route("/redfish/v1/Managers//", methods=3D['PA= TCH']) + @auth.rfAuthRequired + def rf_patch_manager_entity(manager_id): + rdata =3D request.get_json(cache=3DTrue) + # print("RRrdata:{}".format(rdata)) + rc, status_code, err_string, resp =3D root.managers.get_element(ma= nager_id).patch_resource(rdata) + if rc =3D=3D 0: + return "", status_code + else: + return err_string, status_code + + # rest/v1/Managers/1 + @app.route("/redfish/v1/Managers//Actions/Manager.R= eset", methods=3D['POST']) + @app.route("/redfish/v1/Managers//Actions/Manager.R= eset/", methods=3D['POST']) + @auth.rfAuthRequired + def rf_reset_manager(manager_id): + rdata =3D request.get_json(cache=3DTrue) + # print("rdata:{}".format(rdata)) + rc, status_code, err_string, resp =3D root.managers.get_element(ma= nager_id).reset_resource(rdata) + if rc =3D=3D 0: + return "", status_code + else: + return err_string, status_code + + @app.route("/redfish/v1/Managers//EthernetInterface= s/", methods=3D['PATCH']) + @app.route("/redfish/v1/Managers//EthernetInterface= s//", methods=3D['PATCH']) + @auth.rfAuthRequired + def rf_patch_manager_nic_entity(manager_id, eth_id): + resp =3D root.managers.get_element(manager_id).ethernetColl.get_in= terface(eth_id).get_resource() + rdata =3D request.get_json(cache=3DTrue) + # print("RRrdata:{}".format(rdata)) + ethernet_coll =3D root.managers.get_element(manager_id).ethernetCo= ll + rc, status_code, err_string, resp =3D ethernet_coll.get_interface(= eth_id).patch_resource(rdata) + if rc =3D=3D 0: + return "", status_code + else: + return err_string, status_code + + @app.route("/redfish/v1/SessionService", methods=3D['PATCH']) + @app.route("/redfish/v1/SessionService/", methods=3D['PATCH']) + @auth.rfAuthRequired + def rf_patch_session_service(): + rdata =3D request.get_json(cache=3DTrue) + # print("RRrdata:{}".format(rdata)) + rc, status_code, err_string, resp =3D root.sessionService.patch_re= source(rdata) + if rc =3D=3D 0: + return "", status_code + else: + return err_string, status_code + + # TODO: call root.sessionService.sessions.sessionLogin(usr,pwd), retur= n resp, status_code, hdr + # login API, user catfish, password=3Dhunter, authToken=3D123456CATFI= SHauthcode + @app.route("/redfish/v1/SessionService/Sessions", methods=3D['POST']) + def rf_login(): + print("login") + rdata =3D request.get_json(cache=3DTrue) + print("rdata:{}".format(rdata)) + if rdata["UserName"] =3D=3D "root" and rdata["Password"] =3D=3D "p= assword123456": + x =3D {"Id": "SESSION123456"} + resp =3D json.dumps(x) + print("resp:{}".format(resp)) + hdr =3D {"X-Auth-Token": "123456SESSIONauthcode", + "Location": "/redfish/v1/SessionService/Sessions/SESSIO= N123456"} + return resp, 201, hdr + else: + return "", 401 + + # TODO: call root.sessionService.sessions.delete(sessId), return resp,= status,hdr + # logout API + @app.route("/redfish/v1/SessionService/Sessions/", = methods=3D['DELETE']) + @auth.rfAuthRequired + def rf_session_logout(session_id): + print("session logout %s" % session_id) + # rdata=3Drequest.get_json(cache=3DTrue) + # print("rdata:{}".format(rdata)) + return "", 204 + + @app.route("/redfish/v1/AccountService", methods=3D['PATCH']) + @auth.rfAuthRequired + def rf_patch_account_service(): + rdata =3D request.get_json(cache=3DTrue) + rc, status_code, err_string, resp =3D root.accountService.patch_re= source(rdata) + if rc =3D=3D 0: + return "", status_code + else: + return err_string, status_code + + def resolve_path(service, path): + parts =3D path.split('/') + result =3D service + current_obj =3D service + for part in parts: + if isinstance(current_obj, RfCollection): + result =3D current_obj.get_element(part) + current_obj =3D result + elif isinstance(current_obj, RfResource): + result =3D current_obj.get_component(part) + if not result: + result =3D current_obj.get_attribute(part) + break + else: + current_obj =3D result + + if isinstance(result, (RfResource, RfResourceRaw)): + return result.get_resource() + else: + return result + + def patch_path(service, path): + parts =3D path.split('/') + result =3D None + current_obj =3D service + for part in parts: + if isinstance(current_obj, RfCollection): + result =3D current_obj.get_element(part) + current_obj =3D result + elif isinstance(current_obj, RfResource): + result =3D current_obj.get_component(part) + if not result: + result =3D current_obj + break + else: + current_obj =3D result + return result + + ''' + @app.route("/rest/v1/xxx/x", methods=3D['GET']) + def rfXxxx(): + resp=3Dxxx.getObject() + return(resp) + ''' + + # END file redfishURIs + + # start Flask REST engine running + app.run(host=3Dhost, port=3Dport) + + # never returns + + +''' +reference source links: +https://gist.github.com/lrei/2408383 +http://docs.python-requests.org/en/v0.10.6/api/ +http://flask.pocoo.org/docs/0.10/quickstart/ + +''' diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/resourc= e.py b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/resource.py new file mode 100644 index 0000000000..6fee348064 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/resource.py @@ -0,0 +1,100 @@ +# Copyright Notice: +# Copyright 2016 Distributed Management Task Force, Inc. All rights reserv= ed. +# License: BSD 3-Clause License. For full text see link: https://github.co= m/DMTF/Redfish-Profile-Simulator/blob/master/LICENSE.md + +import json +import os +import sys + +import flask + +if sys.version_info >=3D (3, 5): + from typing import Type + + +class RfResource: + def __init__(self, base_path, rel_path, parent=3DNone): + self.parent =3D parent + self.components =3D {} + + path =3D os.path.join(base_path, rel_path) + indx_file_path =3D os.path.join(path, "index.json") + print("*****Loading Mockup json file:{}".format(indx_file_path)) + if os.path.exists(indx_file_path): + res_file =3D open(indx_file_path, "r") + res_rawdata =3D res_file.read() + self.res_data =3D json.loads(res_rawdata) + self.create_sub_objects(base_path, rel_path) + self.final_init_processing(base_path, rel_path) + else: + self.res_data =3D {} + + def create_sub_objects(self, base_path, rel_path): + pass + + def final_init_processing(self, base_path, rel_path): + pass + + def get_resource(self): + return flask.jsonify(self.res_data) + + def get_attribute(self, attribute): + return flask.jsonify(self.res_data[attribute]) + + def get_component(self, component): + if component in self.components: + return self.components[component] + else: + return None + + def patch_resource(self, patch_data): + for key in patch_data.keys(): + if key in self.res_data: + self.res_data[key] =3D patch_data[key] + else: + raise Exception("attribute %s not found" % key) + + +class RfResourceRaw: + def __init__(self, base_path, rel_path, parent=3DNone): + self.parent =3D parent + path =3D os.path.join(base_path, rel_path) + indx_file_path =3D os.path.join(path, "index.xml") + print("*****Loading Mockup raw data file:{}".format(indx_file_path= )) + res_file =3D open(indx_file_path, "r") + res_raw_data =3D res_file.read() + self.res_data =3D res_raw_data + self.create_subobjects(base_path, rel_path) + self.final_init_processing(base_path, rel_path) + + def create_subobjects(self, base_path, rel_path): + pass + + def final_init_processing(self, base_path, rel_path): + pass + + def get_resource(self): + return flask.Response(response=3Dself.res_data, status=3D200, mime= type=3D'application/xml') + + +class RfCollection(RfResource): + def create_sub_objects(self, base_path, rel_path): + self.elements =3D {} + subpath =3D os.path.join(base_path, rel_path) + contents =3D os.listdir(subpath) + for item in contents: + item_path =3D os.path.join(subpath, item) + if os.path.isdir(item_path): + etype =3D self.element_type() # type: Type[RfResource] + self.elements[item] =3D etype(base_path, + os.path.normpath("%s/%s" % (re= l_path, item)), + parent=3Dself) + + def element_type(self): + pass + + def get_elements(self): + return self.elements + + def get_element(self, element_id): + return self.elements[element_id] diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/securit= y.py b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/security.py new file mode 100644 index 0000000000..deec1b2df9 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/security.py @@ -0,0 +1,35 @@ +import os + +from .resource import RfResource + + +class RfSecurityService(RfResource): + def create_sub_objects(self, base_path, rel_path): + resource_path =3D os.path.join(base_path, rel_path); + contents =3D os.listdir(resource_path) + for item in contents: + if item =3D=3D "ESKM": + self.components[item] =3D RfESKM(base_path, os.path.join(r= el_path, item), parent=3Dself) + if item =3D=3D "HttpsCert": + self.components[item] =3D RfHttpsCert(base_path, os.path.j= oin(rel_path, item), parent=3Dself) + if item =3D=3D "SSO": + self.components[item] =3D RfSSO(base_path, os.path.join(re= l_path, item), parent=3Dself) + if item =3D=3D "CertificateAuthentication": + self.components[item] =3D RfCertificateAuthentication(base= _path, os.path.join(rel_path, item), + parent= =3Dself) + + +class RfESKM(RfResource): + pass + + +class RfHttpsCert(RfResource): + pass + + +class RfSSO(RfResource): + pass + + +class RfCertificateAuthentication(RfResource): + pass diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/service= Root.py b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/serviceRoo= t.py new file mode 100644 index 0000000000..6334ab1b5a --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/serviceRoot.py @@ -0,0 +1,87 @@ +# Copyright Notice: +# Copyright 2016 Distributed Management Task Force, Inc. All rights reserv= ed. +# License: BSD 3-Clause License. For full text see link: https://github.co= m/DMTF/Redfish-Profile-Simulator/blob/master/LICENSE.md + +import os + +from .accountService import RfAccountServiceObj +from .chassis import RfChassisCollection +from .managers import RfManagersCollection +from .resource import RfResource, RfCollection +from .resource import RfResourceRaw +from .sessionService import RfSessionServiceObj +from .systems import RfSystemsCollection +from .updateService import RfUpdateServiceObj + + +class RfServiceRoot(RfResource): + def create_sub_objects(self, base_path, rel_path): + resource_path =3D os.path.join(base_path, rel_path); + contents =3D os.listdir(resource_path) + for item in contents: + if item =3D=3D "odata": + self.components[item] =3D RfOdataServiceDoc(base_path, os.= path.join(rel_path, item), parent=3Dself) + elif item =3D=3D "$metadata": + self.components[item] =3D RfOdataMetadata(base_path, os.pa= th.join(rel_path, item), parent=3Dself) + elif item =3D=3D "Systems": + self.components[item] =3D RfSystemsCollection(base_path, o= s.path.join(rel_path, item), parent=3Dself) + elif item =3D=3D "Chassis": + self.components[item] =3D RfChassisCollection(base_path, o= s.path.join(rel_path, item), parent=3Dself) + elif item =3D=3D "Managers": + self.components[item] =3D RfManagersCollection(base_path, = os.path.join(rel_path, item), parent=3Dself) + elif item =3D=3D "AccountService": + self.components[item] =3D RfAccountServiceObj(base_path, o= s.path.join(rel_path, item), parent=3Dself) + elif item =3D=3D "SessionService": + self.components[item] =3D RfSessionServiceObj(base_path, o= s.path.join(rel_path, item), parent=3Dself) + elif item =3D=3D "ResourceDirectory": + self.components[item] =3D RfResourceDirectoryObj(base_path= , os.path.join(rel_path, item), parent=3Dself) + elif item =3D=3D "UpdateService": + self.components[item] =3D RfUpdateServiceObj(base_path, os= .path.join(rel_path, item), parent=3Dself) + elif item =3D=3D "Registries": + self.components[item] =3D RfRegistryCollection(base_path, = os.path.join(rel_path, item), parent=3Dself) + elif item =3D=3D "EventService": + self.components[item] =3D RfEventServiceObj(base_path, os.= path.join(rel_path, item), parent=3Dself) + + def final_init_processing(self, base_path, rel_path): + print("\n\n{}".format(self.res_data['Name'])) + + +class RfOdataServiceDoc(RfResource): + pass + + +class RfOdataMetadata(RfResourceRaw): + pass + + +class RfResourceDirectoryObj(RfResource): + pass + + +class RfRegistryCollection(RfCollection): + def element_type(self): + return RfRegistry + + +class RfRegistry(RfResource): + pass + + +class RfEventServiceObj(RfResource): + def create_sub_objects(self, base_path, rel_path): + resource_path =3D os.path.join(base_path, rel_path); + contents =3D os.listdir(resource_path) + for item in contents: + if item =3D=3D "EventSubscriptions": + self.components[item] =3D RfEventSubscriptionCollection(ba= se_path, + os.p= ath.join(rel_path, item), + pare= nt=3Dself) + + +class RfEventSubscriptionCollection(RfCollection): + def element_type(self): + return RfEventSubscription + + +class RfEventSubscription(RfResource): + pass diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/service= Versions.py b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/servic= eVersions.py new file mode 100644 index 0000000000..00279e5019 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/serviceVersion= s.py @@ -0,0 +1,9 @@ +# Copyright Notice: +# Copyright 2016 Distributed Management Task Force, Inc. All rights reserv= ed. +# License: BSD 3-Clause License. For full text see link: https://github.co= m/DMTF/Redfish-Profile-Simulator/blob/master/LICENSE.md + +from .resource import RfResource + + +class RfServiceVersions(RfResource): + pass diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/session= Service.py b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/session= Service.py new file mode 100644 index 0000000000..0eeb93b91a --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/sessionService= .py @@ -0,0 +1,41 @@ +# Copyright Notice: +# Copyright 2016 Distributed Management Task Force, Inc. All rights reserv= ed. +# License: BSD 3-Clause License. For full text see link: https://github.co= m/DMTF/Redfish-Profile-Simulator/blob/master/LICENSE.md + +import os + +from .resource import RfResource, RfCollection + + +class RfSessionServiceObj(RfResource): + # create instance of sessionService + def create_sub_objects(self, base_path, rel_path): + self.components["Sessions"] =3D RfSessionCollection(base_path, + os.path.normpath= ("redfish/v1/SessionService/Sessions"), + parent=3Dself) + + def patch_resource(self, patch_data): + # first verify client didn't send us a property we cant patch + for key in patch_data.keys(): + if key !=3D "SessionTimeout": + return 4, 400, "Invalid Patch Property Sent", "" + # now patch the valid properties sent + if "SessionTimeout" in patch_data: + new_val =3D patch_data['SessionTimeout'] + if new_val < 30 or new_val > 86400: + return 4, 400, "Bad Request-not in correct range", "" + else: + self.res_data['SessionTimeout'] =3D new_val + return 0, 204, None, None + else: + return 4, 400, "Invalid Patch Property Sent", "" + + +class RfSessionCollection(RfCollection): + def element_type(self): + return RfSessionObj + + +# Service Collection Entries +class RfSessionObj(RfResource): + pass diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/storage= .py b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/storage.py new file mode 100644 index 0000000000..04586d8332 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/storage.py @@ -0,0 +1,116 @@ +# Copyright Notice: +# Copyright 2016 Distributed Management Task Force, Inc. All rights reserv= ed. +# License: BSD 3-Clause License. For full text see link: https://github.co= m/DMTF/Redfish-Profile-Simulator/blob/master/LICENSE.md + +import os + +from .resource import RfResource, RfCollection + + +class RfSimpleStorageCollection(RfCollection): + def element_type(self): + return RfSimpleStorage + + +class RfSimpleStorage(RfResource): + pass + + +class RfSmartStorage(RfResource): + def create_sub_objects(self, base_path, rel_path): + resource_path =3D os.path.join(base_path, rel_path); + contents =3D os.listdir(resource_path) + for item in contents: + if item =3D=3D "ArrayControllers": + self.components[item] =3D RfArrayControllerCollection(base= _path, + os.pat= h.join(rel_path, item), + parent= =3Dself) + if item =3D=3D "HostBusAdapters": + self.components[item] =3D RfHostBusAdapterCollection(base_= path, + os.path= .join(rel_path, item), + parent= =3Dself) + + +class RfArrayControllerCollection(RfCollection): + def element_type(self): + return RfArrayController + + +class RfArrayController(RfResource): + def create_sub_objects(self, base_path, rel_path): + resource_path =3D os.path.join(base_path, rel_path); + contents =3D os.listdir(resource_path) + for item in contents: + if item =3D=3D "DiskDrives": + self.components[item] =3D RfDiskDriveCollection(base_path,= os.path.join(rel_path, item), + parent=3Dsel= f) + if item =3D=3D "LogicalDrives": + self.components[item] =3D RfLogicalDriveCollection(base_pa= th, os.path.join(rel_path, item), + parent=3D= self) + + if item =3D=3D "StorageEnclosures": + self.components[item] =3D RfStorageEnclosureCollection(bas= e_path, os.path.join(rel_path, item), + paren= t=3Dself) + if item =3D=3D "UnconfiguredDrives": + self.components[item] =3D RfUnconfiguredDriveCollection(ba= se_path, os.path.join(rel_path, item), + pare= nt=3Dself) + + +class RfHostBusAdapterCollection(RfCollection): + def element_type(self): + return RfHostBusAdapter + + +class RfHostBusAdapter(RfResource): + pass + + +class RfDiskDriveCollection(RfCollection): + def element_type(self): + return RfDiskDrive + + +class RfDiskDrive(RfResource): + pass + + +class RfLogicalDriveCollection(RfCollection): + def element_type(self): + return RfLogicalDrive + + +class RfLogicalDrive(RfResource): + def create_sub_objects(self, base_path, rel_path): + resource_path =3D os.path.join(base_path, rel_path); + contents =3D os.listdir(resource_path) + for item in contents: + if item =3D=3D "DataDrives": + self.components[item] =3D RfDataDriveCollection(base_path,= os.path.join(rel_path, item), + parent=3Dsel= f) + + +class RfDataDriveCollection(RfCollection): + def element_type(self): + return RfDataDrive + + +class RfDataDrive(RfResource): + pass + + +class RfStorageEnclosureCollection(RfCollection): + def element_type(self): + return RfStorageEnclosure + + +class RfStorageEnclosure(RfResource): + pass + + +class RfUnconfiguredDriveCollection(RfCollection): + def element_type(self): + return RfUnconfiguredDrive + + +class RfUnconfiguredDrive(RfResource): + pass diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/systems= .py b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/systems.py new file mode 100644 index 0000000000..b107f035db --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/systems.py @@ -0,0 +1,198 @@ +# Copyright Notice: +# Copyright 2016 Distributed Management Task Force, Inc. All rights reserv= ed. +# License: BSD 3-Clause License. For full text see link: https://github.co= m/DMTF/Redfish-Profile-Simulator/blob/master/LICENSE.md + +import os + +from .common_services import RfLogServiceCollection +from .network import RfEthernetCollection, RfNetworkInterfaceCollection +from .resource import RfResource, RfCollection +from .storage import RfSimpleStorageCollection, RfSmartStorage + + +class RfSystemsCollection(RfCollection): + def element_type(self): + return RfSystemObj + + +class RfSystemObj(RfResource): + def create_sub_objects(self, base_path, rel_path): + resource_path =3D os.path.join(base_path, rel_path) + contents =3D os.listdir(resource_path) + for item in contents: + if item =3D=3D "Bios": + self.components[item] =3D RfBios(base_path, os.path.join(r= el_path, item), parent=3Dself) + elif item =3D=3D "EthernetInterfaces": + self.components[item] =3D RfEthernetCollection(base_path, = os.path.join(rel_path, item), parent=3Dself) + elif item =3D=3D "LogServices": + self.components[item] =3D RfLogServiceCollection(base_path= , os.path.join(rel_path, item), parent=3Dself) + elif item =3D=3D "Memory": + self.components[item] =3D RfMemoryCollection(base_path, os= .path.join(rel_path, item), parent=3Dself) + elif item =3D=3D "Processors": + self.components[item] =3D RfProcessorCollection(base_path,= os.path.join(rel_path, item), parent=3Dself) + elif item =3D=3D "SimpleStorage": + self.components[item] =3D RfSimpleStorageCollection(base_p= ath, os.path.join(rel_path, item), parent=3Dself) + elif item =3D=3D "SmartStorage": + self.components[item] =3D RfSmartStorage(base_path, os.pat= h.join(rel_path, item), parent=3Dself) + elif item =3D=3D "SecureBoot": + self.components[item] =3D RfSecureBoot(base_path, os.path.= join(rel_path, item), parent=3Dself) + elif item =3D=3D "NetworkInterfaces": + self.components[item] =3D RfNetworkInterfaceCollection(bas= e_path, os.path.join(rel_path, item), parent=3Dself) + elif item =3D=3D "PCIeDevices": + self.components[item] =3D RfPCIeDeviceCollection(base_path= , os.path.join(rel_path, item), parent=3Dself) + elif item =3D=3D "PCISlots": + self.components[item] =3D RfPCISlotCollection(base_path, o= s.path.join(rel_path, item), parent=3Dself) + elif item =3D=3D "FirmwareInventory": + self.components[item] =3D RfSystemFirmwareInventory(base_p= ath, os.path.join(rel_path, item), parent=3Dself) + elif item =3D=3D "USBDevices": + self.components[item] =3D RfUSBDeviceCollection(base_path,= os.path.join(rel_path, item), parent=3Dself) + elif item =3D=3D "USBPorts": + self.components[item] =3D RfUSBPortCollection(base_path, o= s.path.join(rel_path, item), parent=3Dself) + + def patch_resource(self, patch_data): + # first verify client didn't send us a property we cant patch + for key in patch_data.keys(): + if key !=3D "AssetTag" and key !=3D "IndicatorLED" and key != =3D "Boot": + return 4, 400, "Invalid Patch Property Sent", "" + elif key =3D=3D "Boot": + for prop2 in patch_data["Boot"].keys(): + if prop2 !=3D "BootSourceOverrideEnabled" and prop2 != =3D "BootSourceOverrideTarget": + return 4, 400, "Invalid Patch Property Sent", "" + # now patch the valid properties sent + if "AssetTag" in patch_data: + print("assetTag:{}".format(patch_data["AssetTag"])) + self.res_data['AssetTag'] =3D patch_data['AssetTag'] + if "IndicatorLED" in patch_data: + self.res_data['IndicatorLED'] =3D patch_data['IndicatorLED'] + if "Boot" in patch_data: + boot_data =3D patch_data["Boot"] + if "BootSourceOverrideEnabled" in boot_data: + value =3D boot_data["BootSourceOverrideEnabled"] + valid_values =3D ["Once", "Disabled", "Continuous"] + if value in valid_values: + self.res_data['Boot']['BootSourceOverrideEnabled'] =3D= value + else: + return 4, 400, "Invalid_Value_Specified: BootSourceOve= rrideEnable", "" + if "BootSourceOverrideTarget" in boot_data: + value =3D boot_data["BootSourceOverrideTarget"] + valid_values =3D self.res_data['Boot']['BootSourceOverride= Target@Redfish.AllowableValues'] + if value in valid_values: + self.res_data['Boot']['BootSourceOverrideTarget'] =3D = value + else: + return 4, 400, "Invalid_Value_Specified: BootSourceOve= rrideTarget", "" + return 0, 204, None, None + + def reset_resource(self, reset_data): + if "ResetType" in reset_data: + # print("RESETDATA: {}".format(resetData)) + value =3D reset_data['ResetType'] + valid_values =3D self.res_data["Actions"]["#ComputerSystem.Res= et"]["ResetType@Redfish.AllowableValues"] + if value in valid_values: + # it is a supoported reset action modify other properties= appropritely + if value =3D=3D "On" or value =3D=3D "ForceRestart" or val= ue =3D=3D "GracefulRestart": + self.res_data["PowerState"] =3D "On" + print("PROFILE_SIM--SERVER WAS RESET. power now ON") + elif value =3D=3D "GracefulShutdown" or value =3D=3D "Forc= eOff": + self.res_data["PowerState"] =3D "Off" + print("PROFILE_SIM--SERVER WAS RESET. Power now Off") + return 0, 204, "System Reset", "" + else: + return 4, 400, "Invalid reset value: ResetType", "" + else: # invalid request + return 4, 400, "Invalid request property", "" + + +# subclass Logs Collection +class RfMemoryCollection(RfCollection): + def element_type(self): + return RfMemory + + +class RfMemory(RfResource): + pass + + +class RfProcessorCollection(RfCollection): + def element_type(self): + return RfProcessor + + +class RfProcessor(RfResource): + pass + + +class RfBios(RfResource): + def create_sub_objects(self, base_path, rel_path): + resource_path =3D os.path.join(base_path, rel_path) + contents =3D os.listdir(resource_path) + for item in contents: + if item =3D=3D "Settings": + self.components[item] =3D RfBiosSettings(base_path, os.pat= h.join(rel_path, item), parent=3Dself) + + def reset_resource(self, req_data): + print("bios was reset") + return 0, 204, "Bios Reset", "" + + def change_password(self, req_data): + if "PasswordName" in req_data and "OldPassword" in req_data and "N= ewPassword" in req_data: + print("changed password of type %s" % req_data["PasswordName"]) + return 0, 204, "Password Change", "" + else: # invalid request + return 4, 400, "Invalid request property", "" + + +class RfBiosSettings(RfResource): + def patch_resource(self, patch_data): + if "Attributes" not in patch_data: + return 4, 400, "Invalid Payload. No Attributes found", "" + for key in patch_data["Attributes"].keys(): + # verify client didn't send us a property we cant patch + if key not in self.res_data["Attributes"]: + return 4, 400, "Invalid Patch Property Sent", "" + else: + self.parent.res_data["Attributes"][key] =3D patch_data["At= tributes"][key] + return 0, 204, None, None + + +class RfPCIeDeviceCollection(RfCollection): + def element_type(self): + return RfPCIeDevice + + +class RfPCIeDevice(RfResource): + pass + + +class RfPCISlotCollection(RfCollection): + def element_type(self): + return RfPCISlot + + +class RfPCISlot(RfResource): + pass + + +class RfSecureBoot(RfResource): + pass + + +class RfSystemFirmwareInventory(RfResource): + pass + + +class RfUSBDeviceCollection(RfCollection): + def element_type(self): + return RfUSBDevice + + +class RfUSBDevice(RfResource): + pass + + +class RfUSBPortCollection(RfCollection): + def element_type(self): + return RfUSBPort + + +class RfUSBPort(RfResource): + pass diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/updateS= ervice.py b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/updateSe= rvice.py new file mode 100644 index 0000000000..66bdf35f42 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/updateService.= py @@ -0,0 +1,84 @@ +# Copyright Notice: +# Copyright 2016 Distributed Management Task Force, Inc. All rights reserv= ed. +# License: BSD 3-Clause License. For full text see link: https://github.co= m/DMTF/Redfish-Profile-Simulator/blob/master/LICENSE.md + +import os + +from .resource import RfResource, RfCollection + + +class RfUpdateServiceObj(RfResource): + def create_sub_objects(self, base_path, rel_path): + if os.path.isdir(os.path.join(base_path, os.path.normpath("redfish= /v1/UpdateService/ComponentRepository"))): + self.components["ComponentRepository"] \ + =3D RfComponentRepositoryCollection(base_path, + os.path.normpath("redfis= h/v1/UpdateService/ComponentRepository"), + parent=3Dself) + if os.path.isdir(os.path.join(base_path, os.path.normpath("redfish= /v1/UpdateService/FirmwareInventory"))): + self.components["FirmwareInventory"] \ + =3D RfFirmwareInventoryCollection(base_path, + os.path.normpath("redfish/= v1/UpdateService/FirmwareInventory"), + parent=3Dself) + + if os.path.isdir(os.path.join(base_path, os.path.normpath("redfish= /v1/UpdateService/InstallSets"))): + self.components["InstallSets"] \ + =3D RfInstallSetCollection(base_path, + os.path.normpath("redfish/v1/Upda= teService/InstallSets"), + parent=3Dself) + + if os.path.isdir(os.path.join(base_path, os.path.normpath("redfish= /v1/UpdateService/SoftwareInventory"))): + self.components["SoftwareInventory"] \ + =3D RfSoftwareInventoryCollection(base_path, + os.path.normpath("redfish/= v1/UpdateService/SoftwareInventory"), + parent=3Dself) + + if os.path.isdir(os.path.join(base_path, os.path.normpath("redfish= /v1/UpdateService/UpdateTaskQueue"))): + self.components["UpdateTaskQueue"] \ + =3D RfUpdateTaskQueueCollection(base_path, + os.path.normpath("redfish/v1= /UpdateService/UpdateTaskQueue"), + parent=3Dself) + + +class RfComponentRepositoryCollection(RfCollection): + def element_type(self): + return RfComponentRepository + + +class RfComponentRepository(RfResource): + pass + + +class RfFirmwareInventoryCollection(RfCollection): + def element_type(self): + return RfComponentRepository + + +class RfFirmwareInventory(RfResource): + pass + + +class RfInstallSetCollection(RfCollection): + def element_type(self): + return RfInstallSet + + +class RfInstallSet(RfResource): + pass + + +class RfSoftwareInventoryCollection(RfCollection): + def element_type(self): + return RfSoftwareInventory + + +class RfSoftwareInventory(RfResource): + pass + + +class RfUpdateTaskQueueCollection(RfCollection): + def element_type(self): + return RfUpdateTaskQueue + + +class RfUpdateTaskQueue(RfResource): + pass --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#78063): https://edk2.groups.io/g/devel/message/78063 Mute This Topic: https://groups.io/mt/84374361/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun May 5 11:18:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+78062+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78062+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1626937415; cv=none; d=zohomail.com; s=zohoarc; b=mRsUDAzREVzAE+ncN941bwoZp/Pod1SvI6FSQzpvjTIicnB5qSQbB8Sux0KfEaku+JFrxJKRPhcCi3cgPjCSz8NxSufUmkZwekSw91pkmUgtmQ+FitoJ743q0KWP8uWzONGhikx8gzplYbMZLo3euesBjsy0X8qi3chtfVsGfhQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626937415; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=SgSmW1DmN7fdsrg8Bjy+XHZi/3/1hSlwI+pykzvExzA=; b=SpkVG4x1eeud6TUL/J+lhfCbWovIUM/3mLzsDo76gVANRAJW9Yue9canLlbgdx/j5UF37zJ1RPvbySuDbxcj1idrLksKrwbKPjhD2TzxcrcIyjRLRIKPQeP4KN3pW1RCLtJSL9Ard8i+Kf/1xM1eAdfH69XItPGDjRXTFJW5j3U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78062+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1626937415318192.35333241707804; Thu, 22 Jul 2021 00:03:35 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id dkJCYY1788612xHBC4kOB8Rt; Thu, 22 Jul 2021 00:03:34 -0700 X-Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web12.4648.1626937413355606363 for ; Thu, 22 Jul 2021 00:03:33 -0700 X-Received: from pps.filterd (m0134421.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16M6wFRm032076; Thu, 22 Jul 2021 07:03:26 GMT X-Received: from g4t3427.houston.hpe.com (g4t3427.houston.hpe.com [15.241.140.73]) by mx0b-002e3701.pphosted.com with ESMTP id 39xtrykf98-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Jul 2021 07:03:25 +0000 X-Received: from g9t2301.houston.hpecorp.net (g9t2301.houston.hpecorp.net [16.220.97.129]) by g4t3427.houston.hpe.com (Postfix) with ESMTP id 75AA56C; Thu, 22 Jul 2021 07:03:25 +0000 (UTC) X-Received: from abner-virtual-machine.asiapacific.hpqcorp.net (abner-virtual-machine.asiapacific.hpqcorp.net [15.119.210.153]) by g9t2301.houston.hpecorp.net (Postfix) with ESMTP id 92FAD48; Thu, 22 Jul 2021 07:03:24 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: Nickle Wang , Liming Gao Subject: [edk2-devel] [staging/edk2-redfish-client Tools PATCH 2/6] RedfishClientPkg/Tools: Add more Redfish resource Date: Thu, 22 Jul 2021 14:08:13 +0800 Message-Id: <20210722060817.18564-3-abner.chang@hpe.com> In-Reply-To: <20210722060817.18564-1-abner.chang@hpe.com> References: <20210722060817.18564-1-abner.chang@hpe.com> X-Proofpoint-ORIG-GUID: fy8e9iwy2gKF422hl-SDi2zlXtTfBY0n X-Proofpoint-GUID: fy8e9iwy2gKF422hl-SDi2zlXtTfBY0n X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-HPE-SCL: -1 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,abner.chang@hpe.com X-Gm-Message-State: X145oaStz2lsVz3AEs4e6pfwx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1626937414; bh=fyFrSacID1dtH98BZOjTofVku2yP7HY+3OfdgNlHQWs=; h=Cc:Date:From:Reply-To:Subject:To; b=TMQMMTAM3WvhWz6gRTE7BrzxdzI721S+dbD6nw1TC52hoRMFTMZcg8WCd5CjPtNeWVc a2dNz3GfI+FdUSSSFxNRdtMYg6+c2ULt3xvKR8MaKfSVvzjFTQ01Prw5rAQXEqQ0Ku4os r1dNoniX8GYzOTzed6szxX0cmRI1oO09FaQ= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1626937416280100003 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add more Redfish resource for EDK2 Redfish development. - Add two more systems to profile. - Add BIOS, Memory and Log service to profile. Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Liming Gao Reviewed-by: Nickle Wang --- .../redfish/v1/$metadata/index.xml | 6 +- .../index.json | 16 ++ .../redfish/v1/Registries/index.json | 14 ++ .../2M220100SL/Bios/Settings/index.json | 31 +++ .../v1/Systems/2M220100SL/Bios/index.json | 202 ++++++++++++++++++ .../v1/Systems/2M220100SL/Memory/1/index.json | 56 +++++ .../v1/Systems/2M220100SL/Memory/2/index.json | 46 ++++ .../v1/Systems/2M220100SL/Memory/3/index.json | 46 ++++ .../v1/Systems/2M220100SL/Memory/4/index.json | 46 ++++ .../v1/Systems/2M220100SL/Memory/index.json | 22 ++ .../redfish/v1/Systems/2M220100SL/index.json | 10 +- .../2M220101SL/Bios/Settings/index.json | 13 ++ .../v1/Systems/2M220101SL/Bios/index.json | 17 ++ .../Systems/2M220101SL/BootOptions/index.json | 10 + .../LogServices/SEL/Entries/1/index.json | 28 +++ .../LogServices/SEL/Entries/2/index.json | 28 +++ .../LogServices/SEL/Entries/index.json | 64 ++++++ .../2M220101SL/LogServices/SEL/index.json | 27 +++ .../Systems/2M220101SL/LogServices/index.json | 15 ++ .../2M220101SL/Memory/_backup/1/index.json | 56 +++++ .../2M220101SL/Memory/_backup/2/index.json | 46 ++++ .../2M220101SL/Memory/_backup/3/index.json | 46 ++++ .../2M220101SL/Memory/_backup/4/index.json | 46 ++++ .../2M220101SL/Memory/_backup/index.json | 22 ++ .../v1/Systems/2M220101SL/Memory/index.json | 10 + .../redfish/v1/Systems/2M220101SL/index.json | 82 +++++++ .../2M220102SL/Bios/Settings/index.json | 31 +++ .../v1/Systems/2M220102SL/Bios/index.json | 202 ++++++++++++++++++ .../LogServices/SEL/Entries/1/index.json | 28 +++ .../LogServices/SEL/Entries/2/index.json | 28 +++ .../LogServices/SEL/Entries/index.json | 64 ++++++ .../2M220102SL/LogServices/SEL/index.json | 27 +++ .../Systems/2M220102SL/LogServices/index.json | 15 ++ .../v1/Systems/2M220102SL/Memory/1/index.json | 56 +++++ .../v1/Systems/2M220102SL/Memory/2/index.json | 46 ++++ .../v1/Systems/2M220102SL/Memory/3/index.json | 46 ++++ .../v1/Systems/2M220102SL/Memory/4/index.json | 46 ++++ .../v1/Systems/2M220102SL/Memory/index.json | 22 ++ .../redfish/v1/Systems/2M220102SL/index.json | 76 +++++++ .../redfish/v1/Systems/index.json | 10 +- .../SimpleOcpServerV1/redfish/v1/index.json | 7 +- 41 files changed, 1702 insertions(+), 7 deletions(-) create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Registries/BiosAttributeRegistryUefiKeywo= rd.v1_0_0/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Registries/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220100SL/Bios/Settings/index.js= on create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220100SL/Bios/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220100SL/Memory/1/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220100SL/Memory/2/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220100SL/Memory/3/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220100SL/Memory/4/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220100SL/Memory/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220101SL/Bios/Settings/index.js= on create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220101SL/Bios/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220101SL/BootOptions/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220101SL/LogServices/SEL/Entrie= s/1/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220101SL/LogServices/SEL/Entrie= s/2/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220101SL/LogServices/SEL/Entrie= s/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220101SL/LogServices/SEL/index.= json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220101SL/LogServices/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220101SL/Memory/_backup/1/index= .json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220101SL/Memory/_backup/2/index= .json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220101SL/Memory/_backup/3/index= .json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220101SL/Memory/_backup/4/index= .json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220101SL/Memory/_backup/index.j= son create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220101SL/Memory/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220101SL/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220102SL/Bios/Settings/index.js= on create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220102SL/Bios/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220102SL/LogServices/SEL/Entrie= s/1/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220102SL/LogServices/SEL/Entrie= s/2/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220102SL/LogServices/SEL/Entrie= s/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220102SL/LogServices/SEL/index.= json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220102SL/LogServices/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220102SL/Memory/1/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220102SL/Memory/2/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220102SL/Memory/3/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220102SL/Memory/4/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220102SL/Memory/index.json create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/Mockup= Data/SimpleOcpServerV1/redfish/v1/Systems/2M220102SL/index.json diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/$metadata/index.xml b/RedfishClientPkg/Tools/Red= fish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/$metadata/in= dex.xml index 37d9529b10..ff5628a214 100644 --- a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/$metadata/index.xml +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/$metadata/index.xml @@ -1,5 +1,5 @@ - + =20 @@ -21,6 +21,10 @@ + + + + diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Registries/BiosAttributeRegistryUefiKeyword.v1_0= _0/index.json b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData= /SimpleOcpServerV1/redfish/v1/Registries/BiosAttributeRegistryUefiKeyword.v= 1_0_0/index.json new file mode 100644 index 0000000000..7e36897004 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Registries/BiosAttributeRegistryUefiKeyword.v1_0_0/inde= x.json @@ -0,0 +1,16 @@ +{ + "@Redfish.Copyright": "Copyright (c) 2019, Intel Corporation. All righ= ts reserved. SPDX-License-Identifier: BSD-2-Clause-Patent.", + "@odata.type": "#AttributeRegistry.v1_0_0.AttributeRegistry", + "@odata.id": "/redfish/v1/Registries/BiosAttributeRegistryUefiKeyword.= v1_0_0", + "Description": "This registry defines a representation of BIOS Attribu= te instances (UEFI configuration keyword).", + "Id": "BiosAttributeRegistryUefiKeyword.v1_0_0", + "Language": "en", + "Name": "BIOS Attribute Registry", + "OwningEntity": "Intel", + "RegistryVersion": "1.0.0", + "RegistryEntries": { + "Attributes": [], + "Menus": [], + "Dependencies": [] + } +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Registries/index.json b/RedfishClientPkg/Tools/R= edfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/Registries= /index.json new file mode 100644 index 0000000000..cc651e1b5b --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Registries/index.json @@ -0,0 +1,14 @@ +{ + "@Redfish.Copyright": "Copyright (c) 2019, Intel Corporation. All righ= ts reserved. SPDX-License-Identifier: BSD-2-Clause-Patent.", + "@odata.context": "/redfish/v1/$metadata#MessageRegistryFileCollection= .MessageRegistryFileCollection", + "@odata.id": "/redfish/v1/Registries", + "@odata.type": "#MessageRegistryFileCollection.MessageRegistryFileColl= ection", + "Name": "Registry File Collection", + "Description": "Registry Repository", + "Members@odata.count": 1, + "Members": [ + { + "@odata.id": "/redfish/v1/Registries/BiosAttributeRegistryUefi= Keyword.v1_0_0" + } + ] +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220100SL/Bios/Settings/index.json b/Re= dfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1= /redfish/v1/Systems/2M220100SL/Bios/Settings/index.json new file mode 100644 index 0000000000..a7a5542447 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220100SL/Bios/Settings/index.json @@ -0,0 +1,31 @@ +{ + "@odata.type": "#Bios.v1_0_2.Bios", + "Id": "SD", + "Name": "BIOS Configuration Pending Settings", + "Description": "BIOS Configuration Pending Settings. These settings wi= ll be applied on next system reboot.", + "AttributeRegistry": "/redfish/v1/Registries/BiosAttributeRegistryUefi= Keyword.v1_0_0", + "Attributes": { + "ns_Dev9_iSCSIInitiatorName": "iqn.test.init", + "ns_Dev9_iSCSIMacAddr": "8C:DC:D4:26:C9:74", + "ns_Dev9_iSCSIAddAttempts": "attempt:2", + "ns_Dev9_iSCSIAttemptName2": "Attempt 2", + "ns_Dev9_iSCSIBootEnable2": 1, + "ns_Dev9_iSCSIIpAddressType2": 0, + "ns_Dev9_iSCSIConnectRetry2": 5, + "ns_Dev9_iSCSIConnectTimeout2": 300, + "ns_Dev9_iSCSIISID2": "0CDCD4654321", + "ns_Dev9_iSCSIInitiatorIpAddress2": "192.168.111.101", + "ns_Dev9_iSCSIInitiatorNetmask2": "255.255.255.0", + "ns_Dev9_iSCSIInitiatorGateway2": "192.168.111.1", + "ns_Dev9_iSCSITargetTcpPort2": 3260, + "ns_Dev9_iSCSITargetName2": "iqn.2016-06:067", + "ns_Dev9_iSCSITargetIpAddress2": "192.168.111.1", + "ns_Dev9_iSCSILUN2": "0", + "ns_Dev9_iSCSIInitiatorInfoViaDHCP2": 0, + "ns_Dev9_iSCSIAuthenticationMethod2": 0, + "ns_Dev9_iSCSIChapType2": 0 + }, + "@odata.context": "/redfish/v1/$metadata#Bios.Bios", + "@odata.id": "/redfish/v1/Systems/2M220100SL/Bios/Settings", + "@Redfish.Copyright": "Copyright (c) 2019, Intel Corporation. All righ= ts reserved. SPDX-License-Identifier: BSD-2-Clause-Patent.
Copyright 2= 014-2016 Distributed Management Task Force, Inc. (DMTF). For the full DMTF = copyright policy, see http://www.dmtf.org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220100SL/Bios/index.json b/RedfishClie= ntPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/= v1/Systems/2M220100SL/Bios/index.json new file mode 100644 index 0000000000..540dcd309f --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220100SL/Bios/index.json @@ -0,0 +1,202 @@ +{ + "@odata.type": "#Bios.v1_0_2.Bios", + "Id": "Bios", + "Name": "BIOS Configuration Current Settings", + "Description": "BIOS Configuration Current Settings", + "AttributeRegistry": "/redfish/v1/Registries/BiosAttributeRegistryUefi= Keyword.v1_0_0", + "Attributes": { + "ns_Dev9_iSCSIInitiatorName": "iqn.test.init", + "ns_Dev9_iSCSIMacAddr": "8C:DC:D4:26:C9:74", + "ns_Dev9_iSCSIAttemptOrder": "", + "ns_Dev9_iSCSIAddAttempts": "", + "ns_Dev9_iSCSIDeleteAttempts": "", + "ns_Dev9_iSCSIDisplayAttemptList": "Attempt:2 ", + "ns_Dev9_iSCSIAttemptName1": "", + "ns_Dev9_iSCSIBootEnable1": 0, + "ns_Dev9_iSCSIIpAddressType1": 0, + "ns_Dev9_iSCSIConnectRetry1": 0, + "ns_Dev9_iSCSIConnectTimeout1": 0, + "ns_Dev9_iSCSIISID1": "", + "ns_Dev9_iSCSIInitiatorInfoViaDHCP1": 0, + "ns_Dev9_iSCSIInitiatorIpAddress1": "", + "ns_Dev9_iSCSIInitiatorNetmask1": "", + "ns_Dev9_iSCSIInitiatorGateway1": "", + "ns_Dev9_iSCSITargetInfoViaDHCP1": 0, + "ns_Dev9_iSCSITargetTcpPort1": 0, + "ns_Dev9_iSCSITargetName1": "", + "ns_Dev9_iSCSITargetIpAddress1": "", + "ns_Dev9_iSCSILUN1": "", + "ns_Dev9_iSCSIAuthenticationMethod1": 0, + "ns_Dev9_iSCSIChapType1": 0, + "ns_Dev9_iSCSIChapUsername1": "", + "ns_Dev9_iSCSIChapSecret1": "", + "ns_Dev9_iSCSIReverseChapUsername1": "", + "ns_Dev9_iSCSIReverseChapSecret1": "", + "ns_Dev9_iSCSIAttemptName2": "Attempt 2", + "ns_Dev9_iSCSIBootEnable2": 0, + "ns_Dev9_iSCSIIpAddressType2": 0, + "ns_Dev9_iSCSIConnectRetry2": 5, + "ns_Dev9_iSCSIConnectTimeout2": 300, + "ns_Dev9_iSCSIISID2": "0CDCD4654321", + "ns_Dev9_iSCSIInitiatorInfoViaDHCP2": 0, + "ns_Dev9_iSCSIInitiatorIpAddress2": "192.168.1.188", + "ns_Dev9_iSCSIInitiatorNetmask2": "255.255.255.0", + "ns_Dev9_iSCSIInitiatorGateway2": "192.168.1.177", + "ns_Dev9_iSCSITargetInfoViaDHCP2": 0, + "ns_Dev9_iSCSITargetTcpPort2": 3260, + "ns_Dev9_iSCSITargetName2": "iqn.test.target", + "ns_Dev9_iSCSITargetIpAddress2": "192.168.1.155", + "ns_Dev9_iSCSILUN2": "1", + "ns_Dev9_iSCSIAuthenticationMethod2": 0, + "ns_Dev9_iSCSIChapType2": 0, + "ns_Dev9_iSCSIChapUsername2": "", + "ns_Dev9_iSCSIChapSecret2": "", + "ns_Dev9_iSCSIReverseChapUsername2": "", + "ns_Dev9_iSCSIReverseChapSecret2": "", + "ns_Dev9_iSCSIAttemptName3": "", + "ns_Dev9_iSCSIBootEnable3": 0, + "ns_Dev9_iSCSIIpAddressType3": 0, + "ns_Dev9_iSCSIConnectRetry3": 0, + "ns_Dev9_iSCSIConnectTimeout3": 0, + "ns_Dev9_iSCSIISID3": "", + "ns_Dev9_iSCSIInitiatorInfoViaDHCP3": 0, + "ns_Dev9_iSCSIInitiatorIpAddress3": "", + "ns_Dev9_iSCSIInitiatorNetmask3": "", + "ns_Dev9_iSCSIInitiatorGateway3": "", + "ns_Dev9_iSCSITargetInfoViaDHCP3": 0, + "ns_Dev9_iSCSITargetTcpPort3": 0, + "ns_Dev9_iSCSITargetName3": "", + "ns_Dev9_iSCSITargetIpAddress3": "", + "ns_Dev9_iSCSILUN3": "", + "ns_Dev9_iSCSIAuthenticationMethod3": 0, + "ns_Dev9_iSCSIChapType3": 0, + "ns_Dev9_iSCSIChapUsername3": "", + "ns_Dev9_iSCSIChapSecret3": "", + "ns_Dev9_iSCSIReverseChapUsername3": "", + "ns_Dev9_iSCSIReverseChapSecret3": "", + "ns_Dev9_iSCSIAttemptName4": "", + "ns_Dev9_iSCSIBootEnable4": 0, + "ns_Dev9_iSCSIIpAddressType4": 0, + "ns_Dev9_iSCSIConnectRetry4": 0, + "ns_Dev9_iSCSIConnectTimeout4": 0, + "ns_Dev9_iSCSIISID4": "", + "ns_Dev9_iSCSIInitiatorInfoViaDHCP4": 0, + "ns_Dev9_iSCSIInitiatorIpAddress4": "", + "ns_Dev9_iSCSIInitiatorNetmask4": "", + "ns_Dev9_iSCSIInitiatorGateway4": "", + "ns_Dev9_iSCSITargetInfoViaDHCP4": 0, + "ns_Dev9_iSCSITargetTcpPort4": 0, + "ns_Dev9_iSCSITargetName4": "", + "ns_Dev9_iSCSITargetIpAddress4": "", + "ns_Dev9_iSCSILUN4": "", + "ns_Dev9_iSCSIAuthenticationMethod4": 0, + "ns_Dev9_iSCSIChapType4": 0, + "ns_Dev9_iSCSIChapUsername4": "", + "ns_Dev9_iSCSIChapSecret4": "", + "ns_Dev9_iSCSIReverseChapUsername4": "", + "ns_Dev9_iSCSIReverseChapSecret4": "", + "ns_Dev9_iSCSIAttemptName5": "", + "ns_Dev9_iSCSIBootEnable5": 0, + "ns_Dev9_iSCSIIpAddressType5": 0, + "ns_Dev9_iSCSIConnectRetry5": 0, + "ns_Dev9_iSCSIConnectTimeout5": 0, + "ns_Dev9_iSCSIISID5": "", + "ns_Dev9_iSCSIInitiatorInfoViaDHCP5": 0, + "ns_Dev9_iSCSIInitiatorIpAddress5": "", + "ns_Dev9_iSCSIInitiatorNetmask5": "", + "ns_Dev9_iSCSIInitiatorGateway5": "", + "ns_Dev9_iSCSITargetInfoViaDHCP5": 0, + "ns_Dev9_iSCSITargetTcpPort5": 0, + "ns_Dev9_iSCSITargetName5": "", + "ns_Dev9_iSCSITargetIpAddress5": "", + "ns_Dev9_iSCSILUN5": "", + "ns_Dev9_iSCSIAuthenticationMethod5": 0, + "ns_Dev9_iSCSIChapType5": 0, + "ns_Dev9_iSCSIChapUsername5": "", + "ns_Dev9_iSCSIChapSecret5": "", + "ns_Dev9_iSCSIReverseChapUsername5": "", + "ns_Dev9_iSCSIReverseChapSecret5": "", + "ns_Dev9_iSCSIAttemptName6": "", + "ns_Dev9_iSCSIBootEnable6": 0, + "ns_Dev9_iSCSIIpAddressType6": 0, + "ns_Dev9_iSCSIConnectRetry6": 0, + "ns_Dev9_iSCSIConnectTimeout6": 0, + "ns_Dev9_iSCSIISID6": "", + "ns_Dev9_iSCSIInitiatorInfoViaDHCP6": 0, + "ns_Dev9_iSCSIInitiatorIpAddress6": "", + "ns_Dev9_iSCSIInitiatorNetmask6": "", + "ns_Dev9_iSCSIInitiatorGateway6": "", + "ns_Dev9_iSCSITargetInfoViaDHCP6": 0, + "ns_Dev9_iSCSITargetTcpPort6": 0, + "ns_Dev9_iSCSITargetName6": "", + "ns_Dev9_iSCSITargetIpAddress6": "", + "ns_Dev9_iSCSILUN6": "", + "ns_Dev9_iSCSIAuthenticationMethod6": 0, + "ns_Dev9_iSCSIChapType6": 0, + "ns_Dev9_iSCSIChapUsername6": "", + "ns_Dev9_iSCSIChapSecret6": "", + "ns_Dev9_iSCSIReverseChapUsername6": "", + "ns_Dev9_iSCSIReverseChapSecret6": "", + "ns_Dev9_iSCSIAttemptName7": "", + "ns_Dev9_iSCSIBootEnable7": 0, + "ns_Dev9_iSCSIIpAddressType7": 0, + "ns_Dev9_iSCSIConnectRetry7": 0, + "ns_Dev9_iSCSIConnectTimeout7": 0, + "ns_Dev9_iSCSIISID7": "", + "ns_Dev9_iSCSIInitiatorInfoViaDHCP7": 0, + "ns_Dev9_iSCSIInitiatorIpAddress7": "", + "ns_Dev9_iSCSIInitiatorNetmask7": "", + "ns_Dev9_iSCSIInitiatorGateway7": "", + "ns_Dev9_iSCSITargetInfoViaDHCP7": 0, + "ns_Dev9_iSCSITargetTcpPort7": 0, + "ns_Dev9_iSCSITargetName7": "", + "ns_Dev9_iSCSITargetIpAddress7": "", + "ns_Dev9_iSCSILUN7": "", + "ns_Dev9_iSCSIAuthenticationMethod7": 0, + "ns_Dev9_iSCSIChapType7": 0, + "ns_Dev9_iSCSIChapUsername7": "", + "ns_Dev9_iSCSIChapSecret7": "", + "ns_Dev9_iSCSIReverseChapUsername7": "", + "ns_Dev9_iSCSIReverseChapSecret7": "", + "ns_Dev9_iSCSIAttemptName8": "", + "ns_Dev9_iSCSIBootEnable8": 0, + "ns_Dev9_iSCSIIpAddressType8": 0, + "ns_Dev9_iSCSIConnectRetry8": 0, + "ns_Dev9_iSCSIConnectTimeout8": 0, + "ns_Dev9_iSCSIISID8": "", + "ns_Dev9_iSCSIInitiatorInfoViaDHCP8": 0, + "ns_Dev9_iSCSIInitiatorIpAddress8": "", + "ns_Dev9_iSCSIInitiatorNetmask8": "", + "ns_Dev9_iSCSIInitiatorGateway8": "", + "ns_Dev9_iSCSITargetInfoViaDHCP8": 0, + "ns_Dev9_iSCSITargetTcpPort8": 0, + "ns_Dev9_iSCSITargetName8": "", + "ns_Dev9_iSCSITargetIpAddress8": "", + "ns_Dev9_iSCSILUN8": "", + "ns_Dev9_iSCSIAuthenticationMethod8": 0, + "ns_Dev9_iSCSIChapType8": 0, + "ns_Dev9_iSCSIChapUsername8": "", + "ns_Dev9_iSCSIChapSecret8": "", + "ns_Dev9_iSCSIReverseChapUsername8": "", + "ns_Dev9_iSCSIReverseChapSecret8": "" + }, + "@Redfish.Settings": { + "@odata.type": "#Settings.v1_0_4.Settings", + "ETag": "someetag", + "Messages": [ + { + "MessageId": "Base.1.0.SettingsFailed", + "RelatedProperties": [ + "#/Attributes/BootMode" + ] + } + ], + "SettingsObject": { + "@odata.id": "/redfish/v1/Systems/2M220100SL/Bios/Settings" + }, + "Time": "2012-03-07T14:44.30-05:00" + }, + "@odata.context": "/redfish/v1/$metadata#Bios.Bios", + "@odata.id": "/redfish/v1/Systems/2M220100SL/Bios", + "@Redfish.Copyright": "Copyright (c) 2019, Intel Corporation. All righ= ts reserved. SPDX-License-Identifier: BSD-2-Clause-Patent.
Copyright 2= 014-2016 Distributed Management Task Force, Inc. (DMTF). For the full DMTF = copyright policy, see http://www.dmtf.org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220100SL/Memory/1/index.json b/Redfish= ClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redf= ish/v1/Systems/2M220100SL/Memory/1/index.json new file mode 100644 index 0000000000..084b3543fa --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220100SL/Memory/1/index.json @@ -0,0 +1,56 @@ +{ + "@odata.context": "/redfish/v1/$metadata#Memory.Memory", + "@odata.id": "/redfish/v1/Systems/2M220100SL/Memory/1/", + "@odata.type": "#Memory.v1_7_1.Memory", + "Id": "1", + "BaseModuleType": "RDIMM", + "BusWidthBits": 72, + "CacheSizeMiB": 0, + "CapacityMiB": 8192, + "DataWidthBits": 64, + "DeviceLocator": "PROC 1 DIMM 1", + "ErrorCorrection": "MultiBitECC", + "LogicalSizeMiB": 0, + "Manufacturer": "Micron", + "MemoryDeviceType": "DDR4", + "MemoryLocation": { + "Channel": 6, + "MemoryController": 3, + "Slot": 1, + "Socket": 1 + }, + "MemoryMedia": [ + "DRAM" + ], + "MemoryType": "DRAM", + "Name": "proc1dimm1", + "NonVolatileSizeMiB": 0, + "Oem": { + "Hpe": { + "@odata.context": "/redfish/v1/$metadata#HpeMemoryExt.HpeMemoryExt", + "@odata.type": "#HpeMemoryExt.v2_5_0.HpeMemoryExt", + "BaseModuleType": "RDIMM", + "DIMMStatus": "GoodInUse", + "MaxOperatingSpeedMTs": 3200, + "MinimumVoltageVoltsX10": 12, + "VendorName": "Micron" + } + }, + "OperatingMemoryModes": [ + "Volatile" + ], + "OperatingSpeedMhz": 2666, + "PartNumber": "9ASF1G72PZ-3G2E1", + "PersistentRegionSizeLimitMiB": 0, + "RankCount": 1, + "SecurityCapabilities": {}, + "SerialNumber": "218BCAC5", + "Status": { + "Health": "OK", + "State": "Enabled" + }, + "VendorID": "11264", + "VolatileRegionSizeLimitMiB": 8192, + "VolatileSizeMiB": 8192 +} + diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220100SL/Memory/2/index.json b/Redfish= ClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redf= ish/v1/Systems/2M220100SL/Memory/2/index.json new file mode 100644 index 0000000000..87dbc82cc1 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220100SL/Memory/2/index.json @@ -0,0 +1,46 @@ +{ + "@odata.context": "/redfish/v1/$metadata#Memory.Memory", + "@odata.id": "/redfish/v1/Systems/2M220100SL/Memory/2/", + "@odata.type": "#Memory.v1_7_1.Memory", + "Id": "2", + "BusWidthBits": 72, + "CacheSizeMiB": 0, + "CapacityMiB": 0, + "DataWidthBits": 64, + "DeviceLocator": "PROC 1 DIMM 2", + "ErrorCorrection": "MultiBitECC", + "LogicalSizeMiB": 0, + "MemoryLocation": { + "Channel": 6, + "MemoryController": 3, + "Slot": 2, + "Socket": 1 + }, + "MemoryMedia": [ + "DRAM" + ], + "MemoryType": "DRAM", + "Name": "proc1dimm2", + "NonVolatileSizeMiB": 0, + "Oem": { + "Hpe": { + "@odata.context": "/redfish/v1/$metadata#HpeMemoryExt.HpeMemoryExt", + "@odata.type": "#HpeMemoryExt.v2_5_0.HpeMemoryExt", + "DIMMStatus": "NotPresent", + "MinimumVoltageVoltsX10": 0 + } + }, + "OperatingMemoryModes": [ + "Volatile" + ], + "PersistentRegionSizeLimitMiB": 0, + "RankCount": null, + "SecurityCapabilities": {}, + "Status": { + "Health": "OK", + "State": "Absent" + }, + "VendorID": "0", + "VolatileRegionSizeLimitMiB": 0, + "VolatileSizeMiB": 0 +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220100SL/Memory/3/index.json b/Redfish= ClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redf= ish/v1/Systems/2M220100SL/Memory/3/index.json new file mode 100644 index 0000000000..1f5b6ef206 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220100SL/Memory/3/index.json @@ -0,0 +1,46 @@ +{ + "@odata.context": "/redfish/v1/$metadata#Memory.Memory", + "@odata.id": "/redfish/v1/Systems/2M220100SL/Memory/3/", + "@odata.type": "#Memory.v1_7_1.Memory", + "Id": "3", + "BusWidthBits": 72, + "CacheSizeMiB": 0, + "CapacityMiB": 0, + "DataWidthBits": 64, + "DeviceLocator": "PROC 1 DIMM 3", + "ErrorCorrection": "MultiBitECC", + "LogicalSizeMiB": 0, + "MemoryLocation": { + "Channel": 5, + "MemoryController": 3, + "Slot": 3, + "Socket": 1 + }, + "MemoryMedia": [ + "DRAM" + ], + "MemoryType": "DRAM", + "Name": "proc1dimm3", + "NonVolatileSizeMiB": 0, + "Oem": { + "Hpe": { + "@odata.context": "/redfish/v1/$metadata#HpeMemoryExt.HpeMemoryExt", + "@odata.type": "#HpeMemoryExt.v2_5_0.HpeMemoryExt", + "DIMMStatus": "NotPresent", + "MinimumVoltageVoltsX10": 0 + } + }, + "OperatingMemoryModes": [ + "Volatile" + ], + "PersistentRegionSizeLimitMiB": 0, + "RankCount": null, + "SecurityCapabilities": {}, + "Status": { + "Health": "OK", + "State": "Absent" + }, + "VendorID": "0", + "VolatileRegionSizeLimitMiB": 0, + "VolatileSizeMiB": 0 +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220100SL/Memory/4/index.json b/Redfish= ClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redf= ish/v1/Systems/2M220100SL/Memory/4/index.json new file mode 100644 index 0000000000..d97fe2ed5a --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220100SL/Memory/4/index.json @@ -0,0 +1,46 @@ +{ + "@odata.context": "/redfish/v1/$metadata#Memory.Memory", + "@odata.id": "/redfish/v1/Systems/2M220100SL/Memory/4/", + "@odata.type": "#Memory.v1_7_1.Memory", + "Id": "4", + "BusWidthBits": 72, + "CacheSizeMiB": 0, + "CapacityMiB": 0, + "DataWidthBits": 64, + "DeviceLocator": "PROC 1 DIMM 4", + "ErrorCorrection": "MultiBitECC", + "LogicalSizeMiB": 0, + "MemoryLocation": { + "Channel": 5, + "MemoryController": 3, + "Slot": 4, + "Socket": 1 + }, + "MemoryMedia": [ + "DRAM" + ], + "MemoryType": "DRAM", + "Name": "proc1dimm4", + "NonVolatileSizeMiB": 0, + "Oem": { + "Hpe": { + "@odata.context": "/redfish/v1/$metadata#HpeMemoryExt.HpeMemoryExt", + "@odata.type": "#HpeMemoryExt.v2_5_0.HpeMemoryExt", + "DIMMStatus": "NotPresent", + "MinimumVoltageVoltsX10": 0 + } + }, + "OperatingMemoryModes": [ + "Volatile" + ], + "PersistentRegionSizeLimitMiB": 0, + "RankCount": null, + "SecurityCapabilities": {}, + "Status": { + "Health": "OK", + "State": "Absent" + }, + "VendorID": "0", + "VolatileRegionSizeLimitMiB": 0, + "VolatileSizeMiB": 0 +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220100SL/Memory/index.json b/RedfishCl= ientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfis= h/v1/Systems/2M220100SL/Memory/index.json new file mode 100644 index 0000000000..cebddce076 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220100SL/Memory/index.json @@ -0,0 +1,22 @@ +{ + "@odata.context": "/redfish/v1/$metadata#MemoryCollection.MemoryCollecti= on", + "@odata.id": "/redfish/v1/Systems/2M220100SL/Memory", + "@odata.type": "#MemoryCollection.MemoryCollection", + "Description": "Memory DIMM Collection", + "Name": "Memory DIMM Collection", + "Members": [ + { + "@odata.id": "/redfish/v1/Systems/2M220100SL/Memory/1" + }, + { + "@odata.id": "/redfish/v1/Systems/2M220100SL/Memory/2" + }, + { + "@odata.id": "/redfish/v1/Systems/2M220100SL/Memory/3" + }, + { + "@odata.id": "/redfish/v1/Systems/2M220100SL/Memory/4" + } + ], + "Members@odata.count": 4 +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220100SL/index.json b/RedfishClientPkg= /Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/Sy= stems/2M220100SL/index.json index 814f5f6373..dbba691302 100644 --- a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220100SL/index.json +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220100SL/index.json @@ -10,7 +10,7 @@ "SKU": "867530", "PartNumber": "224071-J23", "Description": "Catfish Implementation Recipe of simple scale-out mono= lithic server", - "UUID": "00000000-0000-0000-0000-000000000000", + "UUID": "badfaced-aaaa-beef-1313-131313131313", "HostName": "catfishHostname", "PowerState": "On", "BiosVersion": "X00.1.2.3.4(build-23)", @@ -34,9 +34,15 @@ "UefiHttp" ] }, + "Bios": { + "@odata.id": "/redfish/v1/Systems/2M220100SL/Bios" + }, "LogServices": { "@odata.id": "/redfish/v1/Systems/2M220100SL/LogServices" }, + "Memory": { + "@odata.id": "/redfish/v1/Systems/2M220100SL/Memory" + }, "Links": { "Chassis": [ { @@ -66,5 +72,5 @@ }, "@odata.context": "/redfish/v1/$metadata#ComputerSystem.ComputerSystem= ", "@odata.id": "/redfish/v1/Systems/2M220100SL", - "@Redfish.Copyright": "Copyright 2014-2016 Distributed Management Task= Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmt= f.org/about/policies/copyright." + "@Redfish.Copyright": "Copyright (c) 2019, Intel Corporation. All righ= ts reserved. SPDX-License-Identifier: BSD-2-Clause-Patent.
Copyright 2= 014-2016 Distributed Management Task Force, Inc. (DMTF). For the full DMTF = copyright policy, see http://www.dmtf.org/about/policies/copyright." } diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220101SL/Bios/Settings/index.json b/Re= dfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1= /redfish/v1/Systems/2M220101SL/Bios/Settings/index.json new file mode 100644 index 0000000000..fa2786d6f5 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220101SL/Bios/Settings/index.json @@ -0,0 +1,13 @@ +{ + "@odata.type": "#Bios.v1_0_2.Bios", + "Id": "SD", + "Name": "BIOS Configuration Pending Settings", + "Description": "BIOS Configuration Pending Settings. These settings wi= ll be applied on next system reboot.", + "AttributeRegistry": "/redfish/v1/Registries/BiosAttributeRegistryUefi= Keyword.v1_0_0", + "Attributes": { + "xUEFIns_Dev0006_iSCSIInitiatorName": "iqn.test.init" + }, + "@odata.context": "/redfish/v1/$metadata#Bios.Bios", + "@odata.id": "/redfish/v1/Systems/2M220101SL/Bios/Settings", + "@Redfish.Copyright": "Copyright (c) 2019, Intel Corporation. All righ= ts reserved. SPDX-License-Identifier: BSD-2-Clause-Patent.
Copyright 2= 014-2016 Distributed Management Task Force, Inc. (DMTF). For the full DMTF = copyright policy, see http://www.dmtf.org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220101SL/Bios/index.json b/RedfishClie= ntPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/= v1/Systems/2M220101SL/Bios/index.json new file mode 100644 index 0000000000..db56911d7f --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220101SL/Bios/index.json @@ -0,0 +1,17 @@ +{ + "@odata.type": "#Bios.v1_0_2.Bios", + "Id": "Bios", + "Name": "BIOS Configuration Current Settings", + "Description": "BIOS Configuration Current Settings.", + "AttributeRegistry": "/redfish/v1/Registries/BiosAttributeRegistryUefi= Keyword.v1_0_0", + "Attributes": {}, + "@Redfish.Settings": { + "@odata.type": "#Settings.v1_0_4.Settings", + "SettingsObject": { + "@odata.id": "/redfish/v1/Systems/2M220101SL/Bios/Settings" + } + }, + "@odata.context": "/redfish/v1/$metadata#Bios.Bios", + "@odata.id": "/redfish/v1/Systems/2M220101SL/Bios", + "@Redfish.Copyright": "Copyright (c) 2019, Intel Corporation. All righ= ts reserved. SPDX-License-Identifier: BSD-2-Clause-Patent." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220101SL/BootOptions/index.json b/Redf= ishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/r= edfish/v1/Systems/2M220101SL/BootOptions/index.json new file mode 100644 index 0000000000..06940176bb --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220101SL/BootOptions/index.json @@ -0,0 +1,10 @@ +{ + "@Redfish.Copyright": "Copyright (c) 2019, Intel Corporation. All righ= ts reserved. SPDX-License-Identifier: BSD-2-Clause-Patent.", + "@odata.context": "/redfish/v1/$metadata#BootOptionCollection.BootOpti= onCollection", + "@odata.id": "/redfish/v1/Systems/2M220101SL/BootOptions", + "@odata.type": "#BootOptionCollection.BootOptionCollection", + "Name": "UEFI Boot Options Collection", + "Members@odata.count": 0, + "Members": [ + ] +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220101SL/LogServices/SEL/Entries/1/ind= ex.json b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Simpl= eOcpServerV1/redfish/v1/Systems/2M220101SL/LogServices/SEL/Entries/1/index.= json new file mode 100644 index 0000000000..bbd86ec2b9 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220101SL/LogServices/SEL/Entries/1/index.json @@ -0,0 +1,28 @@ +{ + "@odata.type": "#LogEntry.v1_0_2.LogEntry", + "Id": "1", + "Name": "Log Entry 1", + "EntryType": "SEL", + "OemRecordFormat": "CompanyX", + "RecordId": 1, + "Severity": "Critical", + "Created": "2012-03-07T14:44", + "EntryCode": "Assert", + "SensorType": "Temperature", + "SensorNumber": 1, + "Message": "Message for Event, Description for SEL, OEM depends", + "MessageId": "Event.1.0.TempAssert", + "MessageArgs": [ + "ArrayOfMessageArgs" + ], + "Links": { + "OriginOfCondition": { + "@odata.id": "/redfish/v1/Chassis/1/Thermal" + }, + "Oem": {} + }, + "Oem": {}, + "@odata.context": "/redfish/v1/$metadata#LogEntry.LogEntry", + "@odata.id": "/redfish/v1/Systems/2M220101SL/LogServices/SEL/Entries/1= ", + "@Redfish.Copyright":"Copyright 2014-2016 Distributed Management Task = Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmtf= .org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220101SL/LogServices/SEL/Entries/2/ind= ex.json b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Simpl= eOcpServerV1/redfish/v1/Systems/2M220101SL/LogServices/SEL/Entries/2/index.= json new file mode 100644 index 0000000000..b5d54973b7 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220101SL/LogServices/SEL/Entries/2/index.json @@ -0,0 +1,28 @@ +{ + "@odata.type": "#LogEntry.v1_0_2.LogEntry", + "Id": "2", + "Name": "Log Entry 2", + "EntryType": "SEL", + "OEMRecordFormat": "CompanyX", + "RecordId": 2, + "Severity": "Critical", + "Created": "2012-03-07T14:45", + "EntryCode": "Assert", + "SensorType": "Temperature", + "SensorNumber": 2, + "Message": "Message for Event, Description for SEL, OEM depends", + "MessageId": "Event.1.0.TempAssert", + "MessageArgs": [ + "ArrayOfMessageArgs" + ], + "Links": { + "OriginOfCondition": { + "@odata.id": "/redfish/v1/Chassis/1/Thermal" + }, + "Oem": {} + }, + "Oem": {}, + "@odata.context": "/redfish/v1/$metadata#LogEntry.LogEntry", + "@odata.id": "/redfish/v1/Systems/2M220101SL/LogServices/SEL/Entries/2= ", + "@Redfish.Copyright":"Copyright 2014-2016 Distributed Management Task = Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmtf= .org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220101SL/LogServices/SEL/Entries/index= .json b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleO= cpServerV1/redfish/v1/Systems/2M220101SL/LogServices/SEL/Entries/index.json new file mode 100644 index 0000000000..85477cdc7f --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220101SL/LogServices/SEL/Entries/index.json @@ -0,0 +1,64 @@ +{ + "@odata.type": "#LogEntryCollection.LogEntryCollection", + "Name": "Log Service Collection", + "Description": "Collection of Logs for this System", + "Members@odata.count": 2, + "Members": [ + { + "@odata.type": "#LogEntry.v1_0_2.LogEntry", + "Id": "1", + "Name": "Log Entry 1", + "EntryType": "SEL", + "OemRecordFormat": "CompanyX", + "RecordId": 1, + "Severity": "Critical", + "Created": "2012-03-07T14:44", + "EntryCode": "Assert", + "SensorType": "Temperature", + "Number": 1, + "Message": "Message for Event, Description for SEL, OEM depend= s", + "MessageId": "Event.1.0.TempAssert", + "MessageArgs": [ + "ArrayOfMessageArgs" + ], + "Links": { + "OriginOfCondition": { + "@odata.id": "/redfish/v1/Chassis/1/Thermal" + }, + "Oem": {} + }, + "Oem": {}, + "@odata.id": "/redfish/v1/Systems/2M220101SL/LogServices/SEL/E= ntries/1" + }, + { + "@odata.type": "#LogEntry.v1_0_2.LogEntry", + "Id": "2", + "Name": "Log Entry 2", + "EntryType": "SEL", + "OEMRecordFormat": "CompanyX", + "RecordId": 2, + "Severity": "Critical", + "Created": "2012-03-07T14:45", + "EntryCode": "Assert", + "SensorType": "Temperature", + "Number": 2, + "Message": "Message for Event, Description for SEL, OEM depend= s", + "MessageId": "Event.1.0.TempAssert", + "MessageArgs": [ + "ArrayOfMessageArgs" + ], + "Links": { + "OriginOfCondition": { + "@odata.id": "/redfish/v1/Chassis/1/Thermal" + }, + "Oem": {} + }, + "Oem": {}, + "@odata.id": "/redfish/v1/Systems/2M220101SL/LogServices/SEL/E= ntries/2" + } + ], + "@odata.nextLink": "/redfish/v1/Systems/2M220101SL/LogServices/SEL/Ent= ries?$skiptoken=3D2", + "@odata.context": "/redfish/v1/$metadata#LogEntryCollection.LogEntryCo= llection", + "@odata.id": "/redfish/v1/Systems/2M220101SL/LogServices/SEL/Entries", + "@Redfish.Copyright":"Copyright 2014-2016 Distributed Management Task = Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmtf= .org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220101SL/LogServices/SEL/index.json b/= RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServer= V1/redfish/v1/Systems/2M220101SL/LogServices/SEL/index.json new file mode 100644 index 0000000000..8a72dd3aca --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220101SL/LogServices/SEL/index.json @@ -0,0 +1,27 @@ +{ + "@odata.type": "#LogService.v1_0_2.LogService", + "Id": "SEL", + "Name": "System Log Service", + "MaxNumberOfRecords": 1000, + "OverWritePolicy": "WrapsWhenFull", + "DateTime": "2015-03-13T04:14:33+06:00", + "DateTimeLocalOffset": "+06:00", + "ServiceEnabled": true, + "Status": { + "State": "Enabled", + "Health": "OK" + }, + "Oem": {}, + "Actions": { + "#LogService.ClearLog": { + "target": "/redfish/v1/Systems/2M220101SL/LogServices/SEL/Acti= ons/LogService.Reset" + }, + "Oem": {} + }, + "Entries": { + "@odata.id": "/redfish/v1/Systems/2M220101SL/LogServices/SEL/Entri= es" + }, + "@odata.context": "/redfish/v1/$metadata#LogService.LogService", + "@odata.id": "/redfish/v1/Systems/2M220101SL/LogServices/SEL", + "@Redfish.Copyright": "Copyright 2014-2016 Distributed Management Task= Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmt= f.org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220101SL/LogServices/index.json b/Redf= ishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/r= edfish/v1/Systems/2M220101SL/LogServices/index.json new file mode 100644 index 0000000000..db754eded0 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220101SL/LogServices/index.json @@ -0,0 +1,15 @@ +{ + "@odata.type": "#LogServiceCollection.LogServiceCollection", + "Name": "Log Service Collection", + "Description": "Collection of Logs for this System", + "Members@odata.count": 1, + "Members": [ + { + "@odata.id": "/redfish/v1/Systems/2M220101SL/LogServices/SEL" + } + ], + "Oem": {}, + "@odata.context": "/redfish/v1/$metadata#LogServiceCollection.LogServi= ceCollection", + "@odata.id": "/redfish/v1/Systems/2M220101SL/LogServices", + "@Redfish.Copyright": "Copyright 2014-2016 Distributed Management Task= Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmt= f.org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220101SL/Memory/_backup/1/index.json b= /RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServe= rV1/redfish/v1/Systems/2M220101SL/Memory/_backup/1/index.json new file mode 100644 index 0000000000..3504d7b1d0 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220101SL/Memory/_backup/1/index.json @@ -0,0 +1,56 @@ +{ + "@odata.context": "/redfish/v1/$metadata#Memory.Memory", + "@odata.id": "/redfish/v1/Systems/2M220101SL/Memory/1/", + "@odata.type": "#Memory.v1_7_1.Memory", + "Id": "1", + "BaseModuleType": "RDIMM", + "BusWidthBits": 72, + "CacheSizeMiB": 0, + "CapacityMiB": 8192, + "DataWidthBits": 64, + "DeviceLocator": "PROC 1 DIMM 1", + "ErrorCorrection": "MultiBitECC", + "LogicalSizeMiB": 0, + "Manufacturer": "Micron", + "MemoryDeviceType": "DDR4", + "MemoryLocation": { + "Channel": 6, + "MemoryController": 3, + "Slot": 1, + "Socket": 1 + }, + "MemoryMedia": [ + "DRAM" + ], + "MemoryType": "DRAM", + "Name": "proc1dimm1", + "NonVolatileSizeMiB": 0, + "Oem": { + "Hpe": { + "@odata.context": "/redfish/v1/$metadata#HpeMemoryExt.HpeMemoryExt", + "@odata.type": "#HpeMemoryExt.v2_5_0.HpeMemoryExt", + "BaseModuleType": "RDIMM", + "DIMMStatus": "GoodInUse", + "MaxOperatingSpeedMTs": 3200, + "MinimumVoltageVoltsX10": 12, + "VendorName": "Micron" + } + }, + "OperatingMemoryModes": [ + "Volatile" + ], + "OperatingSpeedMhz": 2666, + "PartNumber": "9ASF1G72PZ-3G2E1", + "PersistentRegionSizeLimitMiB": 0, + "RankCount": 1, + "SecurityCapabilities": {}, + "SerialNumber": "218BCAC5", + "Status": { + "Health": "OK", + "State": "Enabled" + }, + "VendorID": "11264", + "VolatileRegionSizeLimitMiB": 8192, + "VolatileSizeMiB": 8192 +} + diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220101SL/Memory/_backup/2/index.json b= /RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServe= rV1/redfish/v1/Systems/2M220101SL/Memory/_backup/2/index.json new file mode 100644 index 0000000000..979a9e22f2 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220101SL/Memory/_backup/2/index.json @@ -0,0 +1,46 @@ +{ + "@odata.context": "/redfish/v1/$metadata#Memory.Memory", + "@odata.id": "/redfish/v1/Systems/2M220101SL/Memory/2/", + "@odata.type": "#Memory.v1_7_1.Memory", + "Id": "2", + "BusWidthBits": 72, + "CacheSizeMiB": 0, + "CapacityMiB": 0, + "DataWidthBits": 64, + "DeviceLocator": "PROC 1 DIMM 2", + "ErrorCorrection": "MultiBitECC", + "LogicalSizeMiB": 0, + "MemoryLocation": { + "Channel": 6, + "MemoryController": 3, + "Slot": 2, + "Socket": 1 + }, + "MemoryMedia": [ + "DRAM" + ], + "MemoryType": "DRAM", + "Name": "proc1dimm2", + "NonVolatileSizeMiB": 0, + "Oem": { + "Hpe": { + "@odata.context": "/redfish/v1/$metadata#HpeMemoryExt.HpeMemoryExt", + "@odata.type": "#HpeMemoryExt.v2_5_0.HpeMemoryExt", + "DIMMStatus": "NotPresent", + "MinimumVoltageVoltsX10": 0 + } + }, + "OperatingMemoryModes": [ + "Volatile" + ], + "PersistentRegionSizeLimitMiB": 0, + "RankCount": null, + "SecurityCapabilities": {}, + "Status": { + "Health": "OK", + "State": "Absent" + }, + "VendorID": "0", + "VolatileRegionSizeLimitMiB": 0, + "VolatileSizeMiB": 0 +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220101SL/Memory/_backup/3/index.json b= /RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServe= rV1/redfish/v1/Systems/2M220101SL/Memory/_backup/3/index.json new file mode 100644 index 0000000000..504640a0cc --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220101SL/Memory/_backup/3/index.json @@ -0,0 +1,46 @@ +{ + "@odata.context": "/redfish/v1/$metadata#Memory.Memory", + "@odata.id": "/redfish/v1/Systems/2M220101SL/Memory/3/", + "@odata.type": "#Memory.v1_7_1.Memory", + "Id": "3", + "BusWidthBits": 72, + "CacheSizeMiB": 0, + "CapacityMiB": 0, + "DataWidthBits": 64, + "DeviceLocator": "PROC 1 DIMM 3", + "ErrorCorrection": "MultiBitECC", + "LogicalSizeMiB": 0, + "MemoryLocation": { + "Channel": 5, + "MemoryController": 3, + "Slot": 3, + "Socket": 1 + }, + "MemoryMedia": [ + "DRAM" + ], + "MemoryType": "DRAM", + "Name": "proc1dimm3", + "NonVolatileSizeMiB": 0, + "Oem": { + "Hpe": { + "@odata.context": "/redfish/v1/$metadata#HpeMemoryExt.HpeMemoryExt", + "@odata.type": "#HpeMemoryExt.v2_5_0.HpeMemoryExt", + "DIMMStatus": "NotPresent", + "MinimumVoltageVoltsX10": 0 + } + }, + "OperatingMemoryModes": [ + "Volatile" + ], + "PersistentRegionSizeLimitMiB": 0, + "RankCount": null, + "SecurityCapabilities": {}, + "Status": { + "Health": "OK", + "State": "Absent" + }, + "VendorID": "0", + "VolatileRegionSizeLimitMiB": 0, + "VolatileSizeMiB": 0 +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220101SL/Memory/_backup/4/index.json b= /RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServe= rV1/redfish/v1/Systems/2M220101SL/Memory/_backup/4/index.json new file mode 100644 index 0000000000..fda1d59da5 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220101SL/Memory/_backup/4/index.json @@ -0,0 +1,46 @@ +{ + "@odata.context": "/redfish/v1/$metadata#Memory.Memory", + "@odata.id": "/redfish/v1/Systems/2M220101SL/Memory/4/", + "@odata.type": "#Memory.v1_7_1.Memory", + "Id": "4", + "BusWidthBits": 72, + "CacheSizeMiB": 0, + "CapacityMiB": 0, + "DataWidthBits": 64, + "DeviceLocator": "PROC 1 DIMM 4", + "ErrorCorrection": "MultiBitECC", + "LogicalSizeMiB": 0, + "MemoryLocation": { + "Channel": 5, + "MemoryController": 3, + "Slot": 4, + "Socket": 1 + }, + "MemoryMedia": [ + "DRAM" + ], + "MemoryType": "DRAM", + "Name": "proc1dimm4", + "NonVolatileSizeMiB": 0, + "Oem": { + "Hpe": { + "@odata.context": "/redfish/v1/$metadata#HpeMemoryExt.HpeMemoryExt", + "@odata.type": "#HpeMemoryExt.v2_5_0.HpeMemoryExt", + "DIMMStatus": "NotPresent", + "MinimumVoltageVoltsX10": 0 + } + }, + "OperatingMemoryModes": [ + "Volatile" + ], + "PersistentRegionSizeLimitMiB": 0, + "RankCount": null, + "SecurityCapabilities": {}, + "Status": { + "Health": "OK", + "State": "Absent" + }, + "VendorID": "0", + "VolatileRegionSizeLimitMiB": 0, + "VolatileSizeMiB": 0 +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220101SL/Memory/_backup/index.json b/R= edfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV= 1/redfish/v1/Systems/2M220101SL/Memory/_backup/index.json new file mode 100644 index 0000000000..250773f6ad --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220101SL/Memory/_backup/index.json @@ -0,0 +1,22 @@ +{ + "@odata.context": "/redfish/v1/$metadata#MemoryCollection.MemoryCollecti= on", + "@odata.id": "/redfish/v1/Systems/2M220101SL/Memory", + "@odata.type": "#MemoryCollection.MemoryCollection", + "Description": "Memory DIMM Collection", + "Name": "Memory DIMM Collection", + "Members": [ + { + "@odata.id": "/redfish/v1/Systems/2M220101SL/Memory/1" + }, + { + "@odata.id": "/redfish/v1/Systems/2M220101SL/Memory/2" + }, + { + "@odata.id": "/redfish/v1/Systems/2M220101SL/Memory/3" + }, + { + "@odata.id": "/redfish/v1/Systems/2M220101SL/Memory/4" + } + ], + "Members@odata.count": 4 +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220101SL/Memory/index.json b/RedfishCl= ientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfis= h/v1/Systems/2M220101SL/Memory/index.json new file mode 100644 index 0000000000..4f76c9a965 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220101SL/Memory/index.json @@ -0,0 +1,10 @@ +{ + "@odata.context": "/redfish/v1/$metadata#MemoryCollection.MemoryCollecti= on", + "@odata.id": "/redfish/v1/Systems/2M220101SL/Memory", + "@odata.type": "#MemoryCollection.MemoryCollection", + "Description": "Memory DIMM Collection", + "Name": "Memory DIMM Collection", + "Members": [ + ], + "Members@odata.count": 0 +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220101SL/index.json b/RedfishClientPkg= /Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/Sy= stems/2M220101SL/index.json new file mode 100644 index 0000000000..3147cb8827 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220101SL/index.json @@ -0,0 +1,82 @@ +{ + "@odata.type": "#ComputerSystem.v1_1_0.ComputerSystem", + "Id": "2M220101SL", + "Name": "Catfish System", + "SystemType": "Physical", + "AssetTag": "CATFISHASSETTAG", + "Manufacturer": "CatfishManufacturer", + "Model": "YellowCat1000", + "SerialNumber": "2M220101SL", + "SKU": "", + "PartNumber": "", + "Description": "Catfish Implementation Recipe of simple scale-out mono= lithic server", + "UUID": "BADFACED-DEAD-BEEF-1313-131313131313", + "HostName": "catfishHostname", + "PowerState": "On", + "BiosVersion": "X00.1.2.3.4(build-23)", + "Status": { + "State": "Enabled", + "Health": "OK" + }, + "IndicatorLED": "Off", + "Boot": { + "BootSourceOverrideEnabled": "Once", + "BootSourceOverrideMode": "UEFI", + "BootOptions": { + "@odata.id": "/redfish/v1/Systems/2M220101SL/BootOptions" + }, + "BootSourceOverrideTarget": "UefiBootNext", + "BootNext": "", + "BootOrder": [ + ], + "BootSourceOverrideTarget@Redfish.AllowableValues": [ + "None", + "Pxe", + "Usb", + "Hdd", + "BiosSetup", + "UefiTarget", + "UefiHttp", + "UefiBootNext" + ] + }, + "Bios": { + "@odata.id": "/redfish/v1/Systems/2M220101SL/Bios" + }, + "LogServices": { + "@odata.id": "/redfish/v1/Systems/2M220101SL/LogServices" + }, + "Memory": { + "@odata.id": "/redfish/v1/Systems/2M220101SL/Memory" + }, + "Links": { + "Chassis": [ + { + "@odata.id": "/redfish/v1/Chassis/A33" + } + ], + "ManagedBy": [ + { + "@odata.id": "/redfish/v1/Managers/bmc" + } + ], + "Oem": {} + }, + "Actions": { + "#ComputerSystem.Reset": { + "target": "/redfish/v1/Systems/2M220101SL/Actions/ComputerSyst= em.Reset", + "ResetType@Redfish.AllowableValues": [ + "On", + "ForceOff", + "GracefulShutdown", + "ForceRestart", + "Nmi", + "GracefulRestart", + "ForceOn" + ] + } + }, + "@odata.context": "/redfish/v1/$metadata#ComputerSystem.ComputerSystem= ", + "@odata.id": "/redfish/v1/Systems/2M220101SL", + "@Redfish.Copyright": "Copyright (c) 2019, Intel Corporation. All righ= ts reserved. SPDX-License-Identifier: BSD-2-Clause-Patent.
Copyright 2= 014-2016 Distributed Management Task Force, Inc. (DMTF). For the full DMTF = copyright policy, see http://www.dmtf.org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220102SL/Bios/Settings/index.json b/Re= dfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1= /redfish/v1/Systems/2M220102SL/Bios/Settings/index.json new file mode 100644 index 0000000000..086f534c60 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220102SL/Bios/Settings/index.json @@ -0,0 +1,31 @@ +{ + "@odata.type": "#Bios.v1_0_2.Bios", + "Id": "SD", + "Name": "BIOS Configuration Pending Settings", + "Description": "BIOS Configuration Pending Settings. These settings wi= ll be applied on next system reboot.", + "AttributeRegistry": "/redfish/v1/Registries/BiosAttributeRegistryUefi= Keyword.v1_0_0", + "Attributes": { + "ns_Dev9_iSCSIInitiatorName": "iqn.test.init", + "ns_Dev9_iSCSIMacAddr": "8C:DC:D4:26:C9:74", + "ns_Dev9_iSCSIAddAttempts": "attempt:2", + "ns_Dev9_iSCSIAttemptName2": "Attempt 2", + "ns_Dev9_iSCSIBootEnable2": 1, + "ns_Dev9_iSCSIIpAddressType2": 0, + "ns_Dev9_iSCSIConnectRetry2": 5, + "ns_Dev9_iSCSIConnectTimeout2": 300, + "ns_Dev9_iSCSIISID2": "0CDCD4654321", + "ns_Dev9_iSCSIInitiatorIpAddress2": "192.168.111.101", + "ns_Dev9_iSCSIInitiatorNetmask2": "255.255.255.0", + "ns_Dev9_iSCSIInitiatorGateway2": "192.168.111.1", + "ns_Dev9_iSCSITargetTcpPort2": 3260, + "ns_Dev9_iSCSITargetName2": "iqn.2016-06:067", + "ns_Dev9_iSCSITargetIpAddress2": "192.168.111.1", + "ns_Dev9_iSCSILUN2": "0", + "ns_Dev9_iSCSIInitiatorInfoViaDHCP2": 0, + "ns_Dev9_iSCSIAuthenticationMethod2": 0, + "ns_Dev9_iSCSIChapType2": 0 + }, + "@odata.context": "/redfish/v1/$metadata#Bios.Bios", + "@odata.id": "/redfish/v1/Systems/2M220102SL/Bios/SD", + "@Redfish.Copyright": "Copyright (c) 2019, Intel Corporation. All righ= ts reserved. SPDX-License-Identifier: BSD-2-Clause-Patent.
Copyright 2= 014-2016 Distributed Management Task Force, Inc. (DMTF). For the full DMTF = copyright policy, see http://www.dmtf.org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220102SL/Bios/index.json b/RedfishClie= ntPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/= v1/Systems/2M220102SL/Bios/index.json new file mode 100644 index 0000000000..b758584470 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220102SL/Bios/index.json @@ -0,0 +1,202 @@ +{ + "@odata.type": "#Bios.v1_0_2.Bios", + "Id": "Bios", + "Name": "BIOS Configuration Current Settings", + "Description": "BIOS Configuration Current Settings", + "AttributeRegistry": "/redfish/v1/Registries/BiosAttributeRegistryUefi= Keyword.v1_0_0", + "Attributes": { + "ns_Dev9_iSCSIInitiatorName": "iqn.test.init", + "ns_Dev9_iSCSIMacAddr": "8C:DC:D4:26:C9:74", + "ns_Dev9_iSCSIAttemptOrder": "", + "ns_Dev9_iSCSIAddAttempts": "", + "ns_Dev9_iSCSIDeleteAttempts": "", + "ns_Dev9_iSCSIDisplayAttemptList": "Attempt:2 ", + "ns_Dev9_iSCSIAttemptName1": "", + "ns_Dev9_iSCSIBootEnable1": 0, + "ns_Dev9_iSCSIIpAddressType1": 0, + "ns_Dev9_iSCSIConnectRetry1": 0, + "ns_Dev9_iSCSIConnectTimeout1": 0, + "ns_Dev9_iSCSIISID1": "", + "ns_Dev9_iSCSIInitiatorInfoViaDHCP1": 0, + "ns_Dev9_iSCSIInitiatorIpAddress1": "", + "ns_Dev9_iSCSIInitiatorNetmask1": "", + "ns_Dev9_iSCSIInitiatorGateway1": "", + "ns_Dev9_iSCSITargetInfoViaDHCP1": 0, + "ns_Dev9_iSCSITargetTcpPort1": 0, + "ns_Dev9_iSCSITargetName1": "", + "ns_Dev9_iSCSITargetIpAddress1": "", + "ns_Dev9_iSCSILUN1": "", + "ns_Dev9_iSCSIAuthenticationMethod1": 0, + "ns_Dev9_iSCSIChapType1": 0, + "ns_Dev9_iSCSIChapUsername1": "", + "ns_Dev9_iSCSIChapSecret1": "", + "ns_Dev9_iSCSIReverseChapUsername1": "", + "ns_Dev9_iSCSIReverseChapSecret1": "", + "ns_Dev9_iSCSIAttemptName2": "Attempt 2", + "ns_Dev9_iSCSIBootEnable2": 0, + "ns_Dev9_iSCSIIpAddressType2": 0, + "ns_Dev9_iSCSIConnectRetry2": 5, + "ns_Dev9_iSCSIConnectTimeout2": 300, + "ns_Dev9_iSCSIISID2": "0CDCD4654321", + "ns_Dev9_iSCSIInitiatorInfoViaDHCP2": 0, + "ns_Dev9_iSCSIInitiatorIpAddress2": "192.168.1.188", + "ns_Dev9_iSCSIInitiatorNetmask2": "255.255.255.0", + "ns_Dev9_iSCSIInitiatorGateway2": "192.168.1.177", + "ns_Dev9_iSCSITargetInfoViaDHCP2": 0, + "ns_Dev9_iSCSITargetTcpPort2": 3260, + "ns_Dev9_iSCSITargetName2": "iqn.test.target", + "ns_Dev9_iSCSITargetIpAddress2": "192.168.1.155", + "ns_Dev9_iSCSILUN2": "1", + "ns_Dev9_iSCSIAuthenticationMethod2": 0, + "ns_Dev9_iSCSIChapType2": 0, + "ns_Dev9_iSCSIChapUsername2": "", + "ns_Dev9_iSCSIChapSecret2": "", + "ns_Dev9_iSCSIReverseChapUsername2": "", + "ns_Dev9_iSCSIReverseChapSecret2": "", + "ns_Dev9_iSCSIAttemptName3": "", + "ns_Dev9_iSCSIBootEnable3": 0, + "ns_Dev9_iSCSIIpAddressType3": 0, + "ns_Dev9_iSCSIConnectRetry3": 0, + "ns_Dev9_iSCSIConnectTimeout3": 0, + "ns_Dev9_iSCSIISID3": "", + "ns_Dev9_iSCSIInitiatorInfoViaDHCP3": 0, + "ns_Dev9_iSCSIInitiatorIpAddress3": "", + "ns_Dev9_iSCSIInitiatorNetmask3": "", + "ns_Dev9_iSCSIInitiatorGateway3": "", + "ns_Dev9_iSCSITargetInfoViaDHCP3": 0, + "ns_Dev9_iSCSITargetTcpPort3": 0, + "ns_Dev9_iSCSITargetName3": "", + "ns_Dev9_iSCSITargetIpAddress3": "", + "ns_Dev9_iSCSILUN3": "", + "ns_Dev9_iSCSIAuthenticationMethod3": 0, + "ns_Dev9_iSCSIChapType3": 0, + "ns_Dev9_iSCSIChapUsername3": "", + "ns_Dev9_iSCSIChapSecret3": "", + "ns_Dev9_iSCSIReverseChapUsername3": "", + "ns_Dev9_iSCSIReverseChapSecret3": "", + "ns_Dev9_iSCSIAttemptName4": "", + "ns_Dev9_iSCSIBootEnable4": 0, + "ns_Dev9_iSCSIIpAddressType4": 0, + "ns_Dev9_iSCSIConnectRetry4": 0, + "ns_Dev9_iSCSIConnectTimeout4": 0, + "ns_Dev9_iSCSIISID4": "", + "ns_Dev9_iSCSIInitiatorInfoViaDHCP4": 0, + "ns_Dev9_iSCSIInitiatorIpAddress4": "", + "ns_Dev9_iSCSIInitiatorNetmask4": "", + "ns_Dev9_iSCSIInitiatorGateway4": "", + "ns_Dev9_iSCSITargetInfoViaDHCP4": 0, + "ns_Dev9_iSCSITargetTcpPort4": 0, + "ns_Dev9_iSCSITargetName4": "", + "ns_Dev9_iSCSITargetIpAddress4": "", + "ns_Dev9_iSCSILUN4": "", + "ns_Dev9_iSCSIAuthenticationMethod4": 0, + "ns_Dev9_iSCSIChapType4": 0, + "ns_Dev9_iSCSIChapUsername4": "", + "ns_Dev9_iSCSIChapSecret4": "", + "ns_Dev9_iSCSIReverseChapUsername4": "", + "ns_Dev9_iSCSIReverseChapSecret4": "", + "ns_Dev9_iSCSIAttemptName5": "", + "ns_Dev9_iSCSIBootEnable5": 0, + "ns_Dev9_iSCSIIpAddressType5": 0, + "ns_Dev9_iSCSIConnectRetry5": 0, + "ns_Dev9_iSCSIConnectTimeout5": 0, + "ns_Dev9_iSCSIISID5": "", + "ns_Dev9_iSCSIInitiatorInfoViaDHCP5": 0, + "ns_Dev9_iSCSIInitiatorIpAddress5": "", + "ns_Dev9_iSCSIInitiatorNetmask5": "", + "ns_Dev9_iSCSIInitiatorGateway5": "", + "ns_Dev9_iSCSITargetInfoViaDHCP5": 0, + "ns_Dev9_iSCSITargetTcpPort5": 0, + "ns_Dev9_iSCSITargetName5": "", + "ns_Dev9_iSCSITargetIpAddress5": "", + "ns_Dev9_iSCSILUN5": "", + "ns_Dev9_iSCSIAuthenticationMethod5": 0, + "ns_Dev9_iSCSIChapType5": 0, + "ns_Dev9_iSCSIChapUsername5": "", + "ns_Dev9_iSCSIChapSecret5": "", + "ns_Dev9_iSCSIReverseChapUsername5": "", + "ns_Dev9_iSCSIReverseChapSecret5": "", + "ns_Dev9_iSCSIAttemptName6": "", + "ns_Dev9_iSCSIBootEnable6": 0, + "ns_Dev9_iSCSIIpAddressType6": 0, + "ns_Dev9_iSCSIConnectRetry6": 0, + "ns_Dev9_iSCSIConnectTimeout6": 0, + "ns_Dev9_iSCSIISID6": "", + "ns_Dev9_iSCSIInitiatorInfoViaDHCP6": 0, + "ns_Dev9_iSCSIInitiatorIpAddress6": "", + "ns_Dev9_iSCSIInitiatorNetmask6": "", + "ns_Dev9_iSCSIInitiatorGateway6": "", + "ns_Dev9_iSCSITargetInfoViaDHCP6": 0, + "ns_Dev9_iSCSITargetTcpPort6": 0, + "ns_Dev9_iSCSITargetName6": "", + "ns_Dev9_iSCSITargetIpAddress6": "", + "ns_Dev9_iSCSILUN6": "", + "ns_Dev9_iSCSIAuthenticationMethod6": 0, + "ns_Dev9_iSCSIChapType6": 0, + "ns_Dev9_iSCSIChapUsername6": "", + "ns_Dev9_iSCSIChapSecret6": "", + "ns_Dev9_iSCSIReverseChapUsername6": "", + "ns_Dev9_iSCSIReverseChapSecret6": "", + "ns_Dev9_iSCSIAttemptName7": "", + "ns_Dev9_iSCSIBootEnable7": 0, + "ns_Dev9_iSCSIIpAddressType7": 0, + "ns_Dev9_iSCSIConnectRetry7": 0, + "ns_Dev9_iSCSIConnectTimeout7": 0, + "ns_Dev9_iSCSIISID7": "", + "ns_Dev9_iSCSIInitiatorInfoViaDHCP7": 0, + "ns_Dev9_iSCSIInitiatorIpAddress7": "", + "ns_Dev9_iSCSIInitiatorNetmask7": "", + "ns_Dev9_iSCSIInitiatorGateway7": "", + "ns_Dev9_iSCSITargetInfoViaDHCP7": 0, + "ns_Dev9_iSCSITargetTcpPort7": 0, + "ns_Dev9_iSCSITargetName7": "", + "ns_Dev9_iSCSITargetIpAddress7": "", + "ns_Dev9_iSCSILUN7": "", + "ns_Dev9_iSCSIAuthenticationMethod7": 0, + "ns_Dev9_iSCSIChapType7": 0, + "ns_Dev9_iSCSIChapUsername7": "", + "ns_Dev9_iSCSIChapSecret7": "", + "ns_Dev9_iSCSIReverseChapUsername7": "", + "ns_Dev9_iSCSIReverseChapSecret7": "", + "ns_Dev9_iSCSIAttemptName8": "", + "ns_Dev9_iSCSIBootEnable8": 0, + "ns_Dev9_iSCSIIpAddressType8": 0, + "ns_Dev9_iSCSIConnectRetry8": 0, + "ns_Dev9_iSCSIConnectTimeout8": 0, + "ns_Dev9_iSCSIISID8": "", + "ns_Dev9_iSCSIInitiatorInfoViaDHCP8": 0, + "ns_Dev9_iSCSIInitiatorIpAddress8": "", + "ns_Dev9_iSCSIInitiatorNetmask8": "", + "ns_Dev9_iSCSIInitiatorGateway8": "", + "ns_Dev9_iSCSITargetInfoViaDHCP8": 0, + "ns_Dev9_iSCSITargetTcpPort8": 0, + "ns_Dev9_iSCSITargetName8": "", + "ns_Dev9_iSCSITargetIpAddress8": "", + "ns_Dev9_iSCSILUN8": "", + "ns_Dev9_iSCSIAuthenticationMethod8": 0, + "ns_Dev9_iSCSIChapType8": 0, + "ns_Dev9_iSCSIChapUsername8": "", + "ns_Dev9_iSCSIChapSecret8": "", + "ns_Dev9_iSCSIReverseChapUsername8": "", + "ns_Dev9_iSCSIReverseChapSecret8": "" + }, + "@Redfish.Settings": { + "@odata.type": "#Settings.v1_0_4.Settings", + "ETag": "someetag", + "Messages": [ + { + "MessageId": "Base.1.0.SettingsFailed", + "RelatedProperties": [ + "#/Attributes/BootMode" + ] + } + ], + "SettingsObject": { + "@odata.id": "/redfish/v1/Systems/2M220102SL/Bios/Settings" + }, + "Time": "2012-03-07T14:44.30-05:00" + }, + "@odata.context": "/redfish/v1/$metadata#Bios.Bios", + "@odata.id": "/redfish/v1/Systems/2M220102SL/Bios", + "@Redfish.Copyright": "Copyright (c) 2019, Intel Corporation. All righ= ts reserved. SPDX-License-Identifier: BSD-2-Clause-Patent.
Copyright 2= 014-2016 Distributed Management Task Force, Inc. (DMTF). For the full DMTF = copyright policy, see http://www.dmtf.org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220102SL/LogServices/SEL/Entries/1/ind= ex.json b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Simpl= eOcpServerV1/redfish/v1/Systems/2M220102SL/LogServices/SEL/Entries/1/index.= json new file mode 100644 index 0000000000..bc04581973 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220102SL/LogServices/SEL/Entries/1/index.json @@ -0,0 +1,28 @@ +{ + "@odata.type": "#LogEntry.v1_0_2.LogEntry", + "Id": "1", + "Name": "Log Entry 1", + "EntryType": "SEL", + "OemRecordFormat": "CompanyX", + "RecordId": 1, + "Severity": "Critical", + "Created": "2012-03-07T14:44", + "EntryCode": "Assert", + "SensorType": "Temperature", + "SensorNumber": 1, + "Message": "Message for Event, Description for SEL, OEM depends", + "MessageId": "Event.1.0.TempAssert", + "MessageArgs": [ + "ArrayOfMessageArgs" + ], + "Links": { + "OriginOfCondition": { + "@odata.id": "/redfish/v1/Chassis/1/Thermal" + }, + "Oem": {} + }, + "Oem": {}, + "@odata.context": "/redfish/v1/$metadata#LogEntry.LogEntry", + "@odata.id": "/redfish/v1/Systems/2M220102SL/LogServices/SEL/Entries/1= ", + "@Redfish.Copyright":"Copyright 2014-2016 Distributed Management Task = Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmtf= .org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220102SL/LogServices/SEL/Entries/2/ind= ex.json b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Simpl= eOcpServerV1/redfish/v1/Systems/2M220102SL/LogServices/SEL/Entries/2/index.= json new file mode 100644 index 0000000000..f4d8e1dbbe --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220102SL/LogServices/SEL/Entries/2/index.json @@ -0,0 +1,28 @@ +{ + "@odata.type": "#LogEntry.v1_0_2.LogEntry", + "Id": "2", + "Name": "Log Entry 2", + "EntryType": "SEL", + "OEMRecordFormat": "CompanyX", + "RecordId": 2, + "Severity": "Critical", + "Created": "2012-03-07T14:45", + "EntryCode": "Assert", + "SensorType": "Temperature", + "SensorNumber": 2, + "Message": "Message for Event, Description for SEL, OEM depends", + "MessageId": "Event.1.0.TempAssert", + "MessageArgs": [ + "ArrayOfMessageArgs" + ], + "Links": { + "OriginOfCondition": { + "@odata.id": "/redfish/v1/Chassis/1/Thermal" + }, + "Oem": {} + }, + "Oem": {}, + "@odata.context": "/redfish/v1/$metadata#LogEntry.LogEntry", + "@odata.id": "/redfish/v1/Systems/2M220102SL/LogServices/SEL/Entries/2= ", + "@Redfish.Copyright":"Copyright 2014-2016 Distributed Management Task = Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmtf= .org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220102SL/LogServices/SEL/Entries/index= .json b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleO= cpServerV1/redfish/v1/Systems/2M220102SL/LogServices/SEL/Entries/index.json new file mode 100644 index 0000000000..5ecd92a9d3 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220102SL/LogServices/SEL/Entries/index.json @@ -0,0 +1,64 @@ +{ + "@odata.type": "#LogEntryCollection.LogEntryCollection", + "Name": "Log Service Collection", + "Description": "Collection of Logs for this System", + "Members@odata.count": 2, + "Members": [ + { + "@odata.type": "#LogEntry.v1_0_2.LogEntry", + "Id": "1", + "Name": "Log Entry 1", + "EntryType": "SEL", + "OemRecordFormat": "CompanyX", + "RecordId": 1, + "Severity": "Critical", + "Created": "2012-03-07T14:44", + "EntryCode": "Assert", + "SensorType": "Temperature", + "Number": 1, + "Message": "Message for Event, Description for SEL, OEM depend= s", + "MessageId": "Event.1.0.TempAssert", + "MessageArgs": [ + "ArrayOfMessageArgs" + ], + "Links": { + "OriginOfCondition": { + "@odata.id": "/redfish/v1/Chassis/1/Thermal" + }, + "Oem": {} + }, + "Oem": {}, + "@odata.id": "/redfish/v1/Systems/2M220102SL/LogServices/SEL/E= ntries/1" + }, + { + "@odata.type": "#LogEntry.v1_0_2.LogEntry", + "Id": "2", + "Name": "Log Entry 2", + "EntryType": "SEL", + "OEMRecordFormat": "CompanyX", + "RecordId": 2, + "Severity": "Critical", + "Created": "2012-03-07T14:45", + "EntryCode": "Assert", + "SensorType": "Temperature", + "Number": 2, + "Message": "Message for Event, Description for SEL, OEM depend= s", + "MessageId": "Event.1.0.TempAssert", + "MessageArgs": [ + "ArrayOfMessageArgs" + ], + "Links": { + "OriginOfCondition": { + "@odata.id": "/redfish/v1/Chassis/1/Thermal" + }, + "Oem": {} + }, + "Oem": {}, + "@odata.id": "/redfish/v1/Systems/2M220102SL/LogServices/SEL/E= ntries/2" + } + ], + "@odata.nextLink": "/redfish/v1/Systems/2M220102SL/LogServices/SEL/Ent= ries?$skiptoken=3D2", + "@odata.context": "/redfish/v1/$metadata#LogEntryCollection.LogEntryCo= llection", + "@odata.id": "/redfish/v1/Systems/2M220102SL/LogServices/SEL/Entries", + "@Redfish.Copyright":"Copyright 2014-2016 Distributed Management Task = Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmtf= .org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220102SL/LogServices/SEL/index.json b/= RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServer= V1/redfish/v1/Systems/2M220102SL/LogServices/SEL/index.json new file mode 100644 index 0000000000..f0444e82b8 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220102SL/LogServices/SEL/index.json @@ -0,0 +1,27 @@ +{ + "@odata.type": "#LogService.v1_0_2.LogService", + "Id": "SEL", + "Name": "System Log Service", + "MaxNumberOfRecords": 1000, + "OverWritePolicy": "WrapsWhenFull", + "DateTime": "2015-03-13T04:14:33+06:00", + "DateTimeLocalOffset": "+06:00", + "ServiceEnabled": true, + "Status": { + "State": "Enabled", + "Health": "OK" + }, + "Oem": {}, + "Actions": { + "#LogService.ClearLog": { + "target": "/redfish/v1/Systems/2M220102SL/LogServices/SEL/Acti= ons/LogService.Reset" + }, + "Oem": {} + }, + "Entries": { + "@odata.id": "/redfish/v1/Systems/2M220102SL/LogServices/SEL/Entri= es" + }, + "@odata.context": "/redfish/v1/$metadata#LogService.LogService", + "@odata.id": "/redfish/v1/Systems/2M220102SL/LogServices/SEL", + "@Redfish.Copyright": "Copyright 2014-2016 Distributed Management Task= Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmt= f.org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220102SL/LogServices/index.json b/Redf= ishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/r= edfish/v1/Systems/2M220102SL/LogServices/index.json new file mode 100644 index 0000000000..7c57266193 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220102SL/LogServices/index.json @@ -0,0 +1,15 @@ +{ + "@odata.type": "#LogServiceCollection.LogServiceCollection", + "Name": "Log Service Collection", + "Description": "Collection of Logs for this System", + "Members@odata.count": 1, + "Members": [ + { + "@odata.id": "/redfish/v1/Systems/2M220102SL/LogServices/SEL" + } + ], + "Oem": {}, + "@odata.context": "/redfish/v1/$metadata#LogServiceCollection.LogServi= ceCollection", + "@odata.id": "/redfish/v1/Systems/2M220102SL/LogServices", + "@Redfish.Copyright": "Copyright 2014-2016 Distributed Management Task= Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmt= f.org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220102SL/Memory/1/index.json b/Redfish= ClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redf= ish/v1/Systems/2M220102SL/Memory/1/index.json new file mode 100644 index 0000000000..3f4909f47f --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220102SL/Memory/1/index.json @@ -0,0 +1,56 @@ +{ + "@odata.context": "/redfish/v1/$metadata#Memory.Memory", + "@odata.id": "/redfish/v1/Systems/2M220102SL/Memory/1/", + "@odata.type": "#Memory.v1_7_1.Memory", + "Id": "1", + "BaseModuleType": "RDIMM", + "BusWidthBits": 72, + "CacheSizeMiB": 0, + "CapacityMiB": 8192, + "DataWidthBits": 64, + "DeviceLocator": "PROC 1 DIMM 1", + "ErrorCorrection": "MultiBitECC", + "LogicalSizeMiB": 0, + "Manufacturer": "Micron", + "MemoryDeviceType": "DDR4", + "MemoryLocation": { + "Channel": 6, + "MemoryController": 3, + "Slot": 1, + "Socket": 1 + }, + "MemoryMedia": [ + "DRAM" + ], + "MemoryType": "DRAM", + "Name": "proc1dimm1", + "NonVolatileSizeMiB": 0, + "Oem": { + "Hpe": { + "@odata.context": "/redfish/v1/$metadata#HpeMemoryExt.HpeMemoryExt", + "@odata.type": "#HpeMemoryExt.v2_5_0.HpeMemoryExt", + "BaseModuleType": "RDIMM", + "DIMMStatus": "GoodInUse", + "MaxOperatingSpeedMTs": 3200, + "MinimumVoltageVoltsX10": 12, + "VendorName": "Micron" + } + }, + "OperatingMemoryModes": [ + "Volatile" + ], + "OperatingSpeedMhz": 2666, + "PartNumber": "9ASF1G72PZ-3G2E1", + "PersistentRegionSizeLimitMiB": 0, + "RankCount": 1, + "SecurityCapabilities": {}, + "SerialNumber": "218BCAC5", + "Status": { + "Health": "OK", + "State": "Enabled" + }, + "VendorID": "11264", + "VolatileRegionSizeLimitMiB": 8192, + "VolatileSizeMiB": 8192 +} + diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220102SL/Memory/2/index.json b/Redfish= ClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redf= ish/v1/Systems/2M220102SL/Memory/2/index.json new file mode 100644 index 0000000000..8318079a06 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220102SL/Memory/2/index.json @@ -0,0 +1,46 @@ +{ + "@odata.context": "/redfish/v1/$metadata#Memory.Memory", + "@odata.id": "/redfish/v1/Systems/2M220102SL/Memory/2/", + "@odata.type": "#Memory.v1_7_1.Memory", + "Id": "2", + "BusWidthBits": 72, + "CacheSizeMiB": 0, + "CapacityMiB": 0, + "DataWidthBits": 64, + "DeviceLocator": "PROC 1 DIMM 2", + "ErrorCorrection": "MultiBitECC", + "LogicalSizeMiB": 0, + "MemoryLocation": { + "Channel": 6, + "MemoryController": 3, + "Slot": 2, + "Socket": 1 + }, + "MemoryMedia": [ + "DRAM" + ], + "MemoryType": "DRAM", + "Name": "proc1dimm2", + "NonVolatileSizeMiB": 0, + "Oem": { + "Hpe": { + "@odata.context": "/redfish/v1/$metadata#HpeMemoryExt.HpeMemoryExt", + "@odata.type": "#HpeMemoryExt.v2_5_0.HpeMemoryExt", + "DIMMStatus": "NotPresent", + "MinimumVoltageVoltsX10": 0 + } + }, + "OperatingMemoryModes": [ + "Volatile" + ], + "PersistentRegionSizeLimitMiB": 0, + "RankCount": null, + "SecurityCapabilities": {}, + "Status": { + "Health": "OK", + "State": "Absent" + }, + "VendorID": "0", + "VolatileRegionSizeLimitMiB": 0, + "VolatileSizeMiB": 0 +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220102SL/Memory/3/index.json b/Redfish= ClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redf= ish/v1/Systems/2M220102SL/Memory/3/index.json new file mode 100644 index 0000000000..e9387ceb8e --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220102SL/Memory/3/index.json @@ -0,0 +1,46 @@ +{ + "@odata.context": "/redfish/v1/$metadata#Memory.Memory", + "@odata.id": "/redfish/v1/Systems/2M220102SL/Memory/3/", + "@odata.type": "#Memory.v1_7_1.Memory", + "Id": "3", + "BusWidthBits": 72, + "CacheSizeMiB": 0, + "CapacityMiB": 0, + "DataWidthBits": 64, + "DeviceLocator": "PROC 1 DIMM 3", + "ErrorCorrection": "MultiBitECC", + "LogicalSizeMiB": 0, + "MemoryLocation": { + "Channel": 5, + "MemoryController": 3, + "Slot": 3, + "Socket": 1 + }, + "MemoryMedia": [ + "DRAM" + ], + "MemoryType": "DRAM", + "Name": "proc1dimm3", + "NonVolatileSizeMiB": 0, + "Oem": { + "Hpe": { + "@odata.context": "/redfish/v1/$metadata#HpeMemoryExt.HpeMemoryExt", + "@odata.type": "#HpeMemoryExt.v2_5_0.HpeMemoryExt", + "DIMMStatus": "NotPresent", + "MinimumVoltageVoltsX10": 0 + } + }, + "OperatingMemoryModes": [ + "Volatile" + ], + "PersistentRegionSizeLimitMiB": 0, + "RankCount": null, + "SecurityCapabilities": {}, + "Status": { + "Health": "OK", + "State": "Absent" + }, + "VendorID": "0", + "VolatileRegionSizeLimitMiB": 0, + "VolatileSizeMiB": 0 +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220102SL/Memory/4/index.json b/Redfish= ClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redf= ish/v1/Systems/2M220102SL/Memory/4/index.json new file mode 100644 index 0000000000..d4af4cf50e --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220102SL/Memory/4/index.json @@ -0,0 +1,46 @@ +{ + "@odata.context": "/redfish/v1/$metadata#Memory.Memory", + "@odata.id": "/redfish/v1/Systems/2M220102SL/Memory/4/", + "@odata.type": "#Memory.v1_7_1.Memory", + "Id": "4", + "BusWidthBits": 72, + "CacheSizeMiB": 0, + "CapacityMiB": 0, + "DataWidthBits": 64, + "DeviceLocator": "PROC 1 DIMM 4", + "ErrorCorrection": "MultiBitECC", + "LogicalSizeMiB": 0, + "MemoryLocation": { + "Channel": 5, + "MemoryController": 3, + "Slot": 4, + "Socket": 1 + }, + "MemoryMedia": [ + "DRAM" + ], + "MemoryType": "DRAM", + "Name": "proc1dimm4", + "NonVolatileSizeMiB": 0, + "Oem": { + "Hpe": { + "@odata.context": "/redfish/v1/$metadata#HpeMemoryExt.HpeMemoryExt", + "@odata.type": "#HpeMemoryExt.v2_5_0.HpeMemoryExt", + "DIMMStatus": "NotPresent", + "MinimumVoltageVoltsX10": 0 + } + }, + "OperatingMemoryModes": [ + "Volatile" + ], + "PersistentRegionSizeLimitMiB": 0, + "RankCount": null, + "SecurityCapabilities": {}, + "Status": { + "Health": "OK", + "State": "Absent" + }, + "VendorID": "0", + "VolatileRegionSizeLimitMiB": 0, + "VolatileSizeMiB": 0 +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220102SL/Memory/index.json b/RedfishCl= ientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfis= h/v1/Systems/2M220102SL/Memory/index.json new file mode 100644 index 0000000000..0bf30eed44 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220102SL/Memory/index.json @@ -0,0 +1,22 @@ +{ + "@odata.context": "/redfish/v1/$metadata#MemoryCollection.MemoryCollecti= on", + "@odata.id": "/redfish/v1/Systems/2M220102SL/Memory", + "@odata.type": "#MemoryCollection.MemoryCollection", + "Description": "Memory DIMM Collection", + "Name": "Memory DIMM Collection", + "Members": [ + { + "@odata.id": "/redfish/v1/Systems/2M220102SL/Memory/1" + }, + { + "@odata.id": "/redfish/v1/Systems/2M220102SL/Memory/2" + }, + { + "@odata.id": "/redfish/v1/Systems/2M220102SL/Memory/3" + }, + { + "@odata.id": "/redfish/v1/Systems/2M220102SL/Memory/4" + } + ], + "Members@odata.count": 4 +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/2M220102SL/index.json b/RedfishClientPkg= /Tools/Redfish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/Sy= stems/2M220102SL/index.json new file mode 100644 index 0000000000..49b2d25f53 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/2M220102SL/index.json @@ -0,0 +1,76 @@ +{ + "@odata.type": "#ComputerSystem.v1_1_0.ComputerSystem", + "Id": "2M220102SL", + "Name": "Catfish System", + "SystemType": "Physical", + "AssetTag": "CATFISHASSETTAG", + "Manufacturer": "CatfishManufacturer", + "Model": "YellowCat1000", + "SerialNumber": "2M220102SL", + "SKU": "", + "PartNumber": "", + "Description": "Catfish Implementation Recipe of simple scale-out mono= lithic server", + "UUID": "badfaced-5555-beef-1313-131313131313", + "HostName": "catfishHostname", + "PowerState": "On", + "BiosVersion": "X00.1.2.3.4(build-23)", + "Status": { + "State": "Enabled", + "Health": "OK" + }, + "IndicatorLED": "Off", + "Boot": { + "BootSourceOverrideEnabled": "Once", + "BootSourceOverrideMode": "UEFI", + "UefiTargetBootSourceOverride": "uefiDevicePath", + "BootSourceOverrideTarget": "Pxe", + "BootSourceOverrideTarget@Redfish.AllowableValues": [ + "None", + "Pxe", + "Usb", + "Hdd", + "BiosSetup", + "UefiTarget", + "UefiHttp" + ] + }, + "Bios": { + "@odata.id": "/redfish/v1/Systems/2M220102SL/Bios" + }, + "LogServices": { + "@odata.id": "/redfish/v1/Systems/2M220102SL/LogServices" + }, + "Memory": { + "@odata.id": "/redfish/v1/Systems/2M220102SL/Memory" + }, + "Links": { + "Chassis": [ + { + "@odata.id": "/redfish/v1/Chassis/A33" + } + ], + "ManagedBy": [ + { + "@odata.id": "/redfish/v1/Managers/bmc" + } + ], + "Oem": {} + }, + "Actions": { + "#ComputerSystem.Reset": { + "target": "/redfish/v1/Systems/2M220102SL/Actions/ComputerSyst= em.Reset", + "ResetType@Redfish.AllowableValues": [ + "On", + "ForceOff", + "GracefulShutdown", + "ForceRestart", + "Nmi", + "GracefulRestart", + "ForceOn" + ] + } + }, + "@odata.context": "/redfish/v1/$metadata#ComputerSystem.ComputerSystem= ", + "@odata.id": "/redfish/v1/Systems/2M220102SL", + "@Redfish.Copyright": "Copyright (c) 2019, Intel Corporation. All righ= ts reserved. SPDX-License-Identifier: BSD-2-Clause-Patent.
Copyright 2= 014-2016 Distributed Management Task Force, Inc. (DMTF). For the full DMTF = copyright policy, see http://www.dmtf.org/about/policies/copyright." +} diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/Systems/index.json b/RedfishClientPkg/Tools/Redf= ish-Profile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/Systems/index= .json index 091849e1a6..e5aaea38bf 100644 --- a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/index.json +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/Systems/index.json @@ -1,13 +1,19 @@ { "@odata.type": "#ComputerSystemCollection.ComputerSystemCollection", "Name": "Computer System Collection", - "Members@odata.count": 1, + "Members@odata.count": 3, "Members": [ { "@odata.id": "/redfish/v1/Systems/2M220100SL" + }, + { + "@odata.id": "/redfish/v1/Systems/2M220101SL" + }, + { + "@odata.id": "/redfish/v1/Systems/2M220102SL" } ], "@odata.context": "/redfish/v1/$metadata#ComputerSystemCollection.Comp= uterSystemCollection", "@odata.id": "/redfish/v1/Systems", - "@Redfish.Copyright": "Copyright 2014-2016 Distributed Management Task= Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmt= f.org/about/policies/copyright." + "@Redfish.Copyright": "Copyright (c) 2019, Intel Corporation. All righ= ts reserved. SPDX-License-Identifier: BSD-2-Clause-Patent.
Copyright 2= 014-2016 Distributed Management Task Force, Inc. (DMTF). For the full DMTF = copyright policy, see http://www.dmtf.org/about/policies/copyright." } diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/Si= mpleOcpServerV1/redfish/v1/index.json b/RedfishClientPkg/Tools/Redfish-Prof= ile-Simulator/MockupData/SimpleOcpServerV1/redfish/v1/index.json index 89312bcec1..b2d3dda6ca 100644 --- a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/index.json +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/MockupData/SimpleOcp= ServerV1/redfish/v1/index.json @@ -3,7 +3,7 @@ "Id": "RootService", "Name": "Root Service", "RedfishVersion": "1.0.2", - "UUID": "92384634-2938-2342-8820-489239905423", + "UUID": "3FB208AC-2185-498C-BF46-DC23DA587B55", "Systems": { "@odata.id": "/redfish/v1/Systems" }, @@ -19,6 +19,9 @@ "AccountService": { "@odata.id": "/redfish/v1/AccountService" }, + "Registries": { + "@odata.id": "/redfish/v1/Registries" + }, "Links": { "Sessions": { "@odata.id": "/redfish/v1/SessionService/Sessions" @@ -27,5 +30,5 @@ "Oem": {}, "@odata.context": "/redfish/v1/$metadata#ServiceRoot.ServiceRoot", "@odata.id": "/redfish/v1/", - "@Redfish.Copyright": "Copyright 2014-2016 Distributed Management Task= Force, Inc. (DMTF). For the full DMTF copyright policy, see http://www.dmt= f.org/about/policies/copyright." + "@Redfish.Copyright": "Copyright (c) 2019, Intel Corporation. All righ= ts reserved. SPDX-License-Identifier: BSD-2-Clause-Patent.
Copyright 2= 014-2016 Distributed Management Task Force, Inc. (DMTF). For the full DMTF = copyright policy, see http://www.dmtf.org/about/policies/copyright." } --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#78062): https://edk2.groups.io/g/devel/message/78062 Mute This Topic: https://groups.io/mt/84374360/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun May 5 11:18:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+78064+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78064+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1626937416; cv=none; d=zohomail.com; s=zohoarc; b=c83IjtvqQ0AXhhE/6nxNMDQ5l8ceKfVPj01DrMzBVmXkFFFd3w1UnL6Y2xbS5BraIk0s+WHxz6uBshV6xYB5WylnVILZ6E6DiFIf4q8pIvYlnkrrTPd0j6sNMmpecVdB6F0GeiMbKqYiVxiRdEa4/8Y7Z+ztXUoJ9sAfm9Ux+Lw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626937416; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=kahZ4wmytYMFwzGeuTBda5THfe/O6+Aaq8AQnWW7UoQ=; b=kxlH11Vf1f0bU9ZRGHy3Db2zWTVWOwF8GWkWxOxbJ8XqO32W5Yo1XS0Kz4UgARWNKfiIBD+Z8ULLQz9svyjGTA4M9t8XDZeG14zZqd9xJLmRCBO40nfX+RvhlzCLIpZbW01UHoOsaDYcb4nezjeTyvgP8334dVXv0wVyuL0tTyA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78064+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1626937416124490.8925478534153; Thu, 22 Jul 2021 00:03:36 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id K8uIYY1788612xLNOzqhlO9I; Thu, 22 Jul 2021 00:03:35 -0700 X-Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web11.4664.1626937413510161341 for ; Thu, 22 Jul 2021 00:03:33 -0700 X-Received: from pps.filterd (m0150245.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16M731tn008052; Thu, 22 Jul 2021 07:03:27 GMT X-Received: from g9t5008.houston.hpe.com (g9t5008.houston.hpe.com [15.241.48.72]) by mx0b-002e3701.pphosted.com with ESMTP id 39xs2a4f9x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Jul 2021 07:03:27 +0000 X-Received: from g9t2301.houston.hpecorp.net (g9t2301.houston.hpecorp.net [16.220.97.129]) by g9t5008.houston.hpe.com (Postfix) with ESMTP id AC0E472; Thu, 22 Jul 2021 07:03:26 +0000 (UTC) X-Received: from abner-virtual-machine.asiapacific.hpqcorp.net (abner-virtual-machine.asiapacific.hpqcorp.net [15.119.210.153]) by g9t2301.houston.hpecorp.net (Postfix) with ESMTP id C4F3957; Thu, 22 Jul 2021 07:03:25 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: Nickle Wang , Liming Gao Subject: [edk2-devel] [staging/edk2-redfish-client Tools PATCH 3/6] RedfishClientPkg/Redfish-Profile-Simulator: Add more features Date: Thu, 22 Jul 2021 14:08:14 +0800 Message-Id: <20210722060817.18564-4-abner.chang@hpe.com> In-Reply-To: <20210722060817.18564-1-abner.chang@hpe.com> References: <20210722060817.18564-1-abner.chang@hpe.com> X-Proofpoint-GUID: BE_mi9EPsChjp5l30kuR0oXxwWO0630b X-Proofpoint-ORIG-GUID: BE_mi9EPsChjp5l30kuR0oXxwWO0630b X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-HPE-SCL: -1 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,abner.chang@hpe.com X-Gm-Message-State: zMmrFwvhrdP500KqN0n8Yrlbx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1626937415; bh=0HvxIJGkIw7xbrDoz0j+cqHDEFAvO8CenG3D4BST9NQ=; h=Cc:Date:From:Reply-To:Subject:To; b=uXYsPBKAlfQB5yKv0qdH/fQJw3d1rzTNQAMP4qRL8otbTHhFmL8MUVvKmDgAK5CTfrn epKZ+4MPiSBw1byBnNUcCsTKou8VeZHAnvyG7w/SvXTEZi6QX4drHZoOUTS6fXPY81lAc R2xzYt9OGND16YH+YsEmkV3Wg8T2FOEM3RQ= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1626937418298100010 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" - Add HTTPs support - Add ETAG support - Change default credential to admin/pwd123456 - Add HTTP methods on BIOS managed resource. Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Liming Gao Reviewed-by: Nickle Wang --- .../redfishProfileSimulator.py | 92 ++++++++-- .../v1sim/redfishURIs.py | 161 ++++++++++++------ .../v1sim/registry.py | 14 ++ .../v1sim/resource.py | 27 ++- .../v1sim/systems.py | 85 ++++++++- 5 files changed, 311 insertions(+), 68 deletions(-) create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/= registry.py diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/redfishProfil= eSimulator.py b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/redfishPro= fileSimulator.py index 24be52bafc..91c792a2b7 100644 --- a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/redfishProfileSimula= tor.py +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/redfishProfileSimula= tor.py @@ -1,4 +1,9 @@ # Copyright Notice: +# +# Copyright (c) 2019, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# Copyright Notice: # Copyright 2016 Distributed Management Task Force, Inc. All rights reserv= ed. # License: BSD 3-Clause License. For full text see link: https://github.co= m/DMTF/Redfish-Profile-Simulator/blob/master/LICENSE.md =20 @@ -9,13 +14,16 @@ import sys import getopt import os +import functools +import flask +import werkzeug =20 rfVersion =3D "0.9.6" rfProgram1 =3D "redfishProfileSimulator" rfProgram2 =3D " " rfUsage1 =3D "[-Vh] [--Version][--help]" -rfUsage2 =3D "[-H] [-P] [-p]" -rfUsage3 =3D "[--Host=3D] [--Port=3D] [--profile_path=3D]" +rfUsage2 =3D "[-H] [-P] [-C] [-K] [-p]" +rfUsage3 =3D "[--Host=3D] [--Port=3D] [--Cert=3D] [--K= ey=3D] [--profile_path=3D]" =20 =20 def rf_usage(): @@ -27,18 +35,19 @@ def rf_usage(): =20 def rf_help(): print(rfProgram1,"implements a simulation of a redfish service for= the \"Simple OCP Server V1\" Mockup.") - print(" The simulation includes an http server, RestEngine, and dy= namic Redfish datamodel.") + print(" The simulation includes an http/https server, RestEngine, = and dynamic Redfish datamodel.") print(" You can GET, PATHCH,... to the service just like a real Re= dfish service.") print(" Both Basic and Redfish Session/Token authentication is sup= ported (for a single user/passwd and token") print(" the user/passwd is: root/password123456. The authT= oken is: 123456SESSIONauthcode") print(" these can be changed by editing the redfishURIs.py file= . will make dynamic later.") - print(" The http service and Rest engine is built on Flask, and al= l code is Python 3.4+") + print(" The http/https service and Rest engine is built on Flask, = and all code is Python 3.4+") print(" The data model resources are \"initialized\" from the SPMF= \"SimpleOcpServerV1\" Mockup.") print(" and stored as python dictionaries--then the dictionari= es are updated with patches, posts, deletes.") print(" The program can be extended to support other mockup \"prof= iles\".") print("") - print(" By default, the simulation runs on localhost (127.0.0.1), = on port 5000.") - print(" These can be changed with CLI options: -P -H | --port=3D --host=3D") + print(" By default, the simulation runs over http, on localhost (1= 27.0.0.1), on port 5000.") + print(" These can be changed with CLI options: -P -C -= K -H | --port=3D --Cert=3D --Key=3D --host= =3D") + print(" -C -K | --Cert=3D --Key=3D options m= ust be used together with port 443 to enable https session.") print("") print("Version: ", rfVersion) rf_usage() @@ -47,19 +56,69 @@ def rf_help(): print(" -h, --help, --- he= lp") print(" -H, --Host=3D --- = host IP address. dflt=3D127.0.0.1") print(" -P, --Port=3D --- = the port to use. dflt=3D5000") + print(" -C, --Cert=3D --- = Server certificate.") + print(" -K, --Key=3D --- = Server key.") print(" -p, --profile=3D --- = the path to the Redfish profile to use. " "dflt=3D\"./MockupData/SimpleOcpServerV1\" ") =20 +# Conditional Requests with ETags +# http://flask.pocoo.org/snippets/95/ +def conditional(func): + '''Start conditional method execution for this resource''' + @functools.wraps(func) + def wrapper(*args, **kwargs): + flask.g.condtnl_etags_start =3D True + return func(*args, **kwargs) + return wrapper + +class NotModified(werkzeug.exceptions.HTTPException): + code =3D 304 + def get_response(self, environment): + return flask.Response(status=3D304) + +class PreconditionRequired(werkzeug.exceptions.HTTPException): + code =3D 428 + description =3D ('

This request is required to be ' + 'conditional; try using "If-Match".') + name =3D 'Precondition Required' + def get_response(self, environment): + resp =3D super(PreconditionRequired, + self).get_response(environment) + resp.status =3D str(self.code) + ' ' + self.name.upper() + return resp =20 def main(argv): + #Monkey patch the set_etag() method for conditional request. + _old_set_etag =3D werkzeug.ETagResponseMixin.set_etag + @functools.wraps(werkzeug.ETagResponseMixin.set_etag) + def _new_set_etag(self, etag, weak=3DFalse): + # only check the first time through; when called twice + # we're modifying + if (hasattr(flask.g, 'condtnl_etags_start') and + flask.g.condtnl_etags_start): + if flask.request.method in ('PUT', 'DELETE', 'PATCH'): + if not flask.request.if_match: + raise PreconditionRequired + if etag not in flask.request.if_match: + flask.abort(412) + elif (flask.request.method =3D=3D 'GET' and + flask.request.if_none_match and + etag in flask.request.if_none_match): + raise NotModified + flask.g.condtnl_etags_start =3D False + _old_set_etag(self, etag, weak) + werkzeug.ETagResponseMixin.set_etag =3D _new_set_etag + # set default option args rf_profile_path =3D os.path.abspath("./MockupData/SimpleOcpServerV1") - rf_host =3D "127.0.0.1" + rf_host =3D "0.0.0.0" rf_port =3D 5000 + rf_cert =3D"" + rf_key=3D"" =20 try: - opts, args =3D getopt.getopt(argv[1:], "VhH:P:p:", - ["Version", "help", "Host=3D", "Port=3D= ", "profile=3D"]) + opts, args =3D getopt.getopt(argv[1:], "VhH:P:C:K:p:", + ["Version", "help", "Host=3D", "Port=3D= ", "Cert=3D", "Key=3D", "profile=3D"]) except getopt.GetoptError: print(rfProgram1, ": Error parsing options") rf_usage() @@ -77,11 +136,24 @@ def main(argv): rf_host =3D arg elif opt in "--Port=3D": rf_port=3Dint(arg) + elif opt in "--Cert=3D": + rf_cert=3Darg + elif opt in "--Key=3D": + rf_key=3Darg else: print(" ", rfProgram1, ": Error: unsupported option") rf_usage() sys.exit(2) =20 + if rf_port =3D=3D 443: + if rf_cert =3D=3D "" or rf_key =3D=3D "": + print(" ", rfProgram1, ": Error: port 443 must be used toget= her with -C and -K to enable https session") + sys.exit(2) + else: + if rf_cert !=3D "" or rf_key !=3D "": + print(" ", rfProgram1, ": Error: -C and -K option= s must be used together with port 443 to enable https session") + sys.exit(2) + print("{} Version: {}".format(rfProgram1,rfVersion)) print(" Starting redfishProfileSimulator at: hostIP=3D{}, port=3D{= }".format(rf_host, rf_port)) print(" Using Profile at {}".format(rf_profile_path)) @@ -102,7 +174,7 @@ def main(argv): root =3D RfServiceRoot(rf_profile_path, root_path) =20 # start the flask REST API service - rfApi_SimpleServer(root, versions, host=3Drf_host, port=3Drf_port) + rfApi_SimpleServer(root, versions, host=3Drf_host, port=3Drf_port,= cert=3Drf_cert, key=3Drf_key) else: print("invalid profile path") =20 diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/redfish= URIs.py b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/redfishURI= s.py index 2380a4058a..3c912f7ce1 100644 --- a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/redfishURIs.py +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/redfishURIs.py @@ -1,17 +1,23 @@ +# +# Copyright Notice: +# Copyright (c) 2019, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# # Copyright Notice: # Copyright 2016 Distributed Management Task Force, Inc. All rights reserv= ed. # License: BSD 3-Clause License. For full text see link: https://github.co= m/DMTF/Redfish-Profile-Simulator/blob/master/LICENSE.md =20 import json +from collections import OrderedDict =20 from flask import Flask from flask import request =20 from .flask_redfish_auth import RfHTTPBasicOrTokenAuth -from .resource import RfResource, RfResourceRaw, RfCollection =20 +from werkzeug.serving import WSGIRequestHandler =20 -def rfApi_SimpleServer(root, versions, host=3D"127.0.0.1", port=3D5000): +def rfApi_SimpleServer(root, versions, host=3D"127.0.0.1", port=3D5000, ce= rt=3D"", key=3D""): app =3D Flask(__name__) =20 # create auth class that does basic or redifish session auth @@ -21,8 +27,8 @@ def rfApi_SimpleServer(root, versions, host=3D"127.0.0.1"= , port=3D5000): # for basic auth, we only support user=3Dcatfish, passwd=3Dhunter @auth.verify_basic_password def verify_rf_passwd(user, passwd): - if user =3D=3D "root": - if passwd =3D=3D "password123456": + if user =3D=3D "admin": + if passwd =3D=3D "pwd123456": return True return False =20 @@ -43,13 +49,13 @@ def rfApi_SimpleServer(root, versions, host=3D"127.0.0.= 1", port=3D5000): =20 # GET /redfish @app.route("/redfish", methods=3D['GET']) - @app.route("/redfish/", methods=3D['GET']) + #@app.route("/redfish/", methods=3D['GET']) def rf_versions(): return versions.get_resource() =20 # GET /redfish/v1 @app.route("/redfish/v1", methods=3D['GET']) - @app.route("/redfish/v1/", methods=3D['GET']) + #@app.route("/redfish/v1/", methods=3D['GET']) def rf_service_root(): return root.get_resource() =20 @@ -65,8 +71,9 @@ def rfApi_SimpleServer(root, versions, host=3D"127.0.0.1"= , port=3D5000): return resolve_path(root, rf_path) =20 @app.route("/redfish/v1/", methods=3D['GET']) - @app.route("/redfish/v1//", methods=3D['GET']) + #@app.route("/redfish/v1//", methods=3D['GET']) @auth.rfAuthRequired + @conditional def rf_subsystems(rf_path): return resolve_path(root, rf_path) =20 @@ -78,135 +85,189 @@ def rfApi_SimpleServer(root, versions, host=3D"127.0.= 0.1", port=3D5000): return root.get_resource() =20 @app.route("/redfish/v1/Systems/", methods=3D['PATCH']) - @app.route("/redfish/v1/Systems//", methods=3D['PATCH']) + #@app.route("/redfish/v1/Systems//", methods=3D['PATCH'= ]) @auth.rfAuthRequired def rf_computer_systempatch(sys_path): - rdata =3D request.get_json(cache=3DTrue) + rdata =3D json.loads(request.data,object_pairs_hook=3DOrderedDict) print("rdata:{}".format(rdata)) - obj =3D patch_path(root.systems, sys_path) + obj =3D patch_path(root.components['Systems'], sys_path) rc, status_code, err_string, resp =3D obj.patch_resource(rdata) if rc =3D=3D 0: - return "", status_code + return resp, status_code + else: + return err_string, status_code + + @app.route("/redfish/v1/Systems//BootOptions/", methods=3D['GET']) + @auth.rfAuthRequired + def rf_computer_bootoptions_get(system_id, bootOptIdx): + return root.components['Systems'].get_element(system_id).component= s['BootOptions'].get_bootOpt(bootOptIdx) + + @app.route("/redfish/v1/Systems//BootOptions/", methods=3D['DELETE']) + @auth.rfAuthRequired + def rf_computer_bootoptions_del(system_id, bootOptIdx): + print("in rf_computer_bootoptions_del") + rc, status_code, err_string, resp =3D root.components['Systems'].= get_element(system_id).components['BootOptions'].delete_bootOpt(bootOptIdx) + if rc =3D=3D 0: + return resp, status_code + else: + return err_string, status_code + + @app.route("/redfish/v1/Systems//BootOptions/", methods=3D['PATCH']) + @auth.rfAuthRequired + def rf_computer_bootoption_patch(system_id, bootOptIdx): + print ("in POST boot options") + rdata =3D json.loads(request.data,object_pairs_hook=3DOrderedDict) + print("rdata:{}".format(rdata)) + rc, status_code, err_string, resp =3D root.components['Systems'].g= et_element(system_id).components['BootOptions'].patch_bootOpt(bootOptIdx, r= data) + if rc =3D=3D 0: + return resp, status_code + else: + return err_string, status_code + + @app.route("/redfish/v1/Systems//BootOptions", metho= ds=3D['POST']) + @auth.rfAuthRequired + def rf_computer_bootoptions_post(system_id): + print ("in POST boot options") + rdata =3D json.loads(request.data,object_pairs_hook=3DOrderedDict) + print("rdata:{}".format(rdata)) + rc, status_code, err_string, resp =3D root.components['Systems'].g= et_element(system_id).components['BootOptions'].post_resource(rdata) + if rc =3D=3D 0: + return resp, status_code else: return err_string, status_code =20 @app.route("/redfish/v1/Systems//Actions/ComputerSys= tem.Reset", methods=3D['POST']) - @app.route("/redfish/v1/Systems//Actions/ComputerSys= tem.Reset/", methods=3D['POST']) + #@app.route("/redfish/v1/Systems//Actions/ComputerSy= stem.Reset/", methods=3D['POST']) @auth.rfAuthRequired def rf_computer_systemreset(system_id): # print("in reset") - rdata =3D request.get_json(cache=3DTrue) + rdata =3D json.loads(request.data,object_pairs_hook=3DOrderedDict) # print("rdata:{}".format(rdata)) rc, status_code, err_string, resp =3D root.components['Systems'].g= et_element(system_id).reset_resource(rdata) if rc =3D=3D 0: - return "", status_code + return resp, status_code else: return err_string, status_code =20 - @app.route("/redfish/v1/Systems//bios/Actions/Bios.R= esetBios", methods=3D['POST']) - @app.route("/redfish/v1/Systems//bios/Actions/Bios.R= esetBios/", methods=3D['POST']) + @app.route("/redfish/v1/Systems//Bios/Actions/Bios.R= esetBios", methods=3D['POST']) + #@app.route("/redfish/v1/Systems//Bios/Actions/Bios.= ResetBios/", methods=3D['POST']) @auth.rfAuthRequired def rf_computer_biosreset(system_id): # print("in reset") - rdata =3D request.get_json(cache=3DTrue) + rdata =3D json.loads(request.data,object_pairs_hook=3DOrderedDict) # print("rdata:{}".format(rdata)) system =3D root.systems.get_element(system_id) - bios =3D system.get_component("bios") + bios =3D system.get_component("Bios") rc, status_code, err_string, resp =3D bios.reset_resource(rdata) if rc =3D=3D 0: - return "", status_code + return resp, status_code else: return err_string, status_code =20 - @app.route("/redfish/v1/Systems//bios/Actions/Bios.C= hangePassword", methods=3D['PATCH']) - @app.route("/redfish/v1/Systems//bios/Actions/Bios.C= hangePassword/", methods=3D['PATCH']) + @app.route("/redfish/v1/Systems//Bios/Actions/Bios.C= hangePassword", methods=3D['PATCH']) + #@app.route("/redfish/v1/Systems//Bios/Actions/Bios.= ChangePassword/", methods=3D['PATCH']) @auth.rfAuthRequired def rf_computer_change_pswd(system_id): # print("in reset") - rdata =3D request.get_json(cache=3DTrue) + rdata =3D json.loads(request.data,object_pairs_hook=3DOrderedDict) # print("rdata:{}".format(rdata)) system =3D root.systems.get_element(system_id) - bios =3D system.get_component("bios") + bios =3D system.get_component("Bios") rc, status_code, err_string, resp =3D bios.change_password(rdata) if rc =3D=3D 0: - return "", status_code + return resp, status_code else: return err_string, status_code =20 @app.route("/redfish/v1/Chassis//Actions/Chassis.Re= set", methods=3D['POST']) - @app.route("/redfish/v1/Chassis//Actions/Chassis.Re= set/", methods=3D['POST']) + #@app.route("/redfish/v1/Chassis//Actions/Chassis.R= eset/", methods=3D['POST']) @auth.rfAuthRequired def rf_computer_chassisreset(chassis_id): # print("in reset") - rdata =3D request.get_json(cache=3DTrue) + rdata =3D json.loads(request.data,object_pairs_hook=3DOrderedDict) # print("rdata:{}".format(rdata)) rc, status_code, err_string, resp =3D root.chassis.get_element(cha= ssis_id).reset_resource(rdata) if rc =3D=3D 0: - return "", status_code + return resp, status_code else: return err_string, status_code =20 @app.route("/redfish/v1/Chassis//Power", methods=3D= ['PATCH']) - @app.route("/redfish/v1/Chassis//Power/", methods= =3D['PATCH']) + #@app.route("/redfish/v1/Chassis//Power/", methods= =3D['PATCH']) @auth.rfAuthRequired def rf_chassis_powerpatch(chassis_id): # rawdata=3Drequest.data - rdata =3D request.get_json(cache=3DTrue) + rdata =3D json.loads(request.data,object_pairs_hook=3DOrderedDict) # print("RRrdata:{}".format(rdata)) rc, status_code, err_string, resp =3D root.chassis.get_element(cha= ssis_id).power.patch_resource(rdata) + if rc =3D=3D 0: + return resp, status_code + else: + return err_string, status_code + + @app.route("/redfish/v1/Registries/", methods=3D['PATCH= ']) + @auth.rfAuthRequired + def rf_registries_patch(sys_path): + rdata =3D json.loads(request.data,object_pairs_hook=3DOrderedDict) + print("rdata:{}".format(rdata)) + obj =3D patch_path(root.components['Registries'], sys_path) + rc, status_code, err_string, resp =3D obj.patch_resource(rdata) if rc =3D=3D 0: return "", status_code else: return err_string, status_code =20 @app.route("/redfish/v1/Managers/", methods=3D['PAT= CH']) - @app.route("/redfish/v1/Managers//", methods=3D['PA= TCH']) + #@app.route("/redfish/v1/Managers//", methods=3D['P= ATCH']) @auth.rfAuthRequired def rf_patch_manager_entity(manager_id): - rdata =3D request.get_json(cache=3DTrue) + rdata =3D json.loads(request.data,object_pairs_hook=3DOrderedDict) # print("RRrdata:{}".format(rdata)) rc, status_code, err_string, resp =3D root.managers.get_element(ma= nager_id).patch_resource(rdata) if rc =3D=3D 0: - return "", status_code + return resp, status_code else: return err_string, status_code =20 # rest/v1/Managers/1 @app.route("/redfish/v1/Managers//Actions/Manager.R= eset", methods=3D['POST']) - @app.route("/redfish/v1/Managers//Actions/Manager.R= eset/", methods=3D['POST']) + #@app.route("/redfish/v1/Managers//Actions/Manager.= Reset/", methods=3D['POST']) @auth.rfAuthRequired def rf_reset_manager(manager_id): - rdata =3D request.get_json(cache=3DTrue) + rdata =3D json.loads(request.data,object_pairs_hook=3DOrderedDict) # print("rdata:{}".format(rdata)) rc, status_code, err_string, resp =3D root.managers.get_element(ma= nager_id).reset_resource(rdata) if rc =3D=3D 0: - return "", status_code + return resp, status_code else: return err_string, status_code =20 @app.route("/redfish/v1/Managers//EthernetInterface= s/", methods=3D['PATCH']) - @app.route("/redfish/v1/Managers//EthernetInterface= s//", methods=3D['PATCH']) + #@app.route("/redfish/v1/Managers//EthernetInterfac= es//", methods=3D['PATCH']) @auth.rfAuthRequired def rf_patch_manager_nic_entity(manager_id, eth_id): resp =3D root.managers.get_element(manager_id).ethernetColl.get_in= terface(eth_id).get_resource() - rdata =3D request.get_json(cache=3DTrue) + rdata =3D json.loads(request.data,object_pairs_hook=3DOrderedDict) # print("RRrdata:{}".format(rdata)) ethernet_coll =3D root.managers.get_element(manager_id).ethernetCo= ll rc, status_code, err_string, resp =3D ethernet_coll.get_interface(= eth_id).patch_resource(rdata) if rc =3D=3D 0: - return "", status_code + return resp, status_code else: return err_string, status_code =20 + @app.route("/redfish/v1/SessionService", methods=3D['GET']) + def rf_get_session_service(): + return root.components['SessionService'].get_resource() + @app.route("/redfish/v1/SessionService", methods=3D['PATCH']) - @app.route("/redfish/v1/SessionService/", methods=3D['PATCH']) - @auth.rfAuthRequired + #@app.route("/redfish/v1/SessionService/", methods=3D['PATCH']) def rf_patch_session_service(): - rdata =3D request.get_json(cache=3DTrue) + rdata =3D json.loads(request.data,object_pairs_hook=3DOrderedDict) # print("RRrdata:{}".format(rdata)) rc, status_code, err_string, resp =3D root.sessionService.patch_re= source(rdata) if rc =3D=3D 0: - return "", status_code + return resp, status_code else: return err_string, status_code =20 @@ -215,7 +276,7 @@ def rfApi_SimpleServer(root, versions, host=3D"127.0.0.= 1", port=3D5000): @app.route("/redfish/v1/SessionService/Sessions", methods=3D['POST']) def rf_login(): print("login") - rdata =3D request.get_json(cache=3DTrue) + rdata =3D json.loads(request.data,object_pairs_hook=3DOrderedDict) print("rdata:{}".format(rdata)) if rdata["UserName"] =3D=3D "root" and rdata["Password"] =3D=3D "p= assword123456": x =3D {"Id": "SESSION123456"} @@ -233,17 +294,17 @@ def rfApi_SimpleServer(root, versions, host=3D"127.0.= 0.1", port=3D5000): @auth.rfAuthRequired def rf_session_logout(session_id): print("session logout %s" % session_id) - # rdata=3Drequest.get_json(cache=3DTrue) + # rdata =3D json.loads(request.data,object_pairs_hook=3DOrderedDic= t) # print("rdata:{}".format(rdata)) return "", 204 =20 @app.route("/redfish/v1/AccountService", methods=3D['PATCH']) @auth.rfAuthRequired def rf_patch_account_service(): - rdata =3D request.get_json(cache=3DTrue) + rdata =3D json.loads(request.data,object_pairs_hook=3DOrderedDict) rc, status_code, err_string, resp =3D root.accountService.patch_re= source(rdata) if rc =3D=3D 0: - return "", status_code + return resp, status_code else: return err_string, status_code =20 @@ -293,12 +354,14 @@ def rfApi_SimpleServer(root, versions, host=3D"127.0.= 0.1", port=3D5000): ''' =20 # END file redfishURIs - # start Flask REST engine running - app.run(host=3Dhost, port=3Dport) =20 - # never returns + if key !=3D "" and cert !=3D "": + app.run(host=3Dhost, port=3Dport, ssl_context=3D(cert, key)) + else: + app.run(host=3Dhost, port=3Dport) =20 + # never returns =20 ''' reference source links: diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/registr= y.py b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/registry.py new file mode 100644 index 0000000000..9cfbb30cde --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/registry.py @@ -0,0 +1,14 @@ +# +# Copyright (c) 2019, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# + +from .resource import RfResource, RfCollection + +class RfRegistryCollection(RfCollection): + def element_type(self): + return RfRegistry + +#subclass Bios +class RfRegistry(RfResource): + pass diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/resourc= e.py b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/resource.py index 6fee348064..ca7541f172 100644 --- a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/resource.py +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/resource.py @@ -1,6 +1,13 @@ +# +# Copyright Notice: +# +# Copyright (c) 2019, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# # Copyright Notice: # Copyright 2016 Distributed Management Task Force, Inc. All rights reserv= ed. # License: BSD 3-Clause License. For full text see link: https://github.co= m/DMTF/Redfish-Profile-Simulator/blob/master/LICENSE.md +# =20 import json import os @@ -23,7 +30,7 @@ class RfResource: if os.path.exists(indx_file_path): res_file =3D open(indx_file_path, "r") res_rawdata =3D res_file.read() - self.res_data =3D json.loads(res_rawdata) + self.res_data =3D json.loads(res_rawdata,object_pairs_hook=3DO= rderedDict) self.create_sub_objects(base_path, rel_path) self.final_init_processing(base_path, rel_path) else: @@ -36,7 +43,15 @@ class RfResource: pass =20 def get_resource(self): - return flask.jsonify(self.res_data) + self.response=3Djson.dumps(self.res_data,indent=3D4) + try: + # SHA1 should generate well-behaved etags + response =3D flask.make_response(self.response) + etag =3D hashlib.sha1(self.response.encode('utf-8')).hexdigest= () + response.set_etag(etag) + return response + except KeyError: + flask.abort(404) =20 def get_attribute(self, attribute): return flask.jsonify(self.res_data[attribute]) @@ -54,6 +69,14 @@ class RfResource: else: raise Exception("attribute %s not found" % key) =20 + resp =3D flask.Response(json.dumps(self.res_data,indent=3D4)) + return 0, 200, None, resp + + def post_resource(self, post_data): + pass + + def delete_resource(self): + pass =20 class RfResourceRaw: def __init__(self, base_path, rel_path, parent=3DNone): diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/systems= .py b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/systems.py index b107f035db..b8b3788054 100644 --- a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/systems.py +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/systems.py @@ -1,6 +1,13 @@ +# +# Copyright Notice: +# +# Copyright (c) 2019, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# # Copyright Notice: # Copyright 2016 Distributed Management Task Force, Inc. All rights reserv= ed. # License: BSD 3-Clause License. For full text see link: https://github.co= m/DMTF/Redfish-Profile-Simulator/blob/master/LICENSE.md +# =20 import os =20 @@ -8,7 +15,9 @@ from .common_services import RfLogServiceCollection from .network import RfEthernetCollection, RfNetworkInterfaceCollection from .resource import RfResource, RfCollection from .storage import RfSimpleStorageCollection, RfSmartStorage - +import flask +import json +from collections import OrderedDict =20 class RfSystemsCollection(RfCollection): def element_type(self): @@ -48,15 +57,17 @@ class RfSystemObj(RfResource): self.components[item] =3D RfUSBDeviceCollection(base_path,= os.path.join(rel_path, item), parent=3Dself) elif item =3D=3D "USBPorts": self.components[item] =3D RfUSBPortCollection(base_path, o= s.path.join(rel_path, item), parent=3Dself) + elif item =3D=3D "BootOptions": + self.components[item] =3D RfBootOptionCollection(base_path= , os.path.join(rel_path, item), parent=3Dself) =20 def patch_resource(self, patch_data): # first verify client didn't send us a property we cant patch for key in patch_data.keys(): - if key !=3D "AssetTag" and key !=3D "IndicatorLED" and key != =3D "Boot": + if key !=3D "AssetTag" and key !=3D "IndicatorLED" and key != =3D "Boot" and key !=3D "BiosVersion": return 4, 400, "Invalid Patch Property Sent", "" elif key =3D=3D "Boot": for prop2 in patch_data["Boot"].keys(): - if prop2 !=3D "BootSourceOverrideEnabled" and prop2 != =3D "BootSourceOverrideTarget": + if prop2 !=3D "BootSourceOverrideEnabled" and prop2 != =3D "BootSourceOverrideTarget" and prop2 !=3D "BootNext" and prop2 !=3D "Bo= otOrder": return 4, 400, "Invalid Patch Property Sent", "" # now patch the valid properties sent if "AssetTag" in patch_data: @@ -64,6 +75,8 @@ class RfSystemObj(RfResource): self.res_data['AssetTag'] =3D patch_data['AssetTag'] if "IndicatorLED" in patch_data: self.res_data['IndicatorLED'] =3D patch_data['IndicatorLED'] + if "BiosVersion" in patch_data: + self.res_data['BiosVersion'] =3D patch_data['BiosVersion'] if "Boot" in patch_data: boot_data =3D patch_data["Boot"] if "BootSourceOverrideEnabled" in boot_data: @@ -80,7 +93,13 @@ class RfSystemObj(RfResource): self.res_data['Boot']['BootSourceOverrideTarget'] =3D = value else: return 4, 400, "Invalid_Value_Specified: BootSourceOve= rrideTarget", "" - return 0, 204, None, None + if "BootNext" in boot_data: + self.res_data['Boot']['BootNext'] =3D boot_data['BootNext'] + if "BootOrder" in boot_data: + self.res_data['Boot']['BootOrder'] =3D boot_data['BootOrde= r'] + + resp =3D flask.Response(json.dumps(self.res_data,indent=3D4)) + return 0, 200, None, resp =20 def reset_resource(self, reset_data): if "ResetType" in reset_data: @@ -145,13 +164,17 @@ class RfBiosSettings(RfResource): def patch_resource(self, patch_data): if "Attributes" not in patch_data: return 4, 400, "Invalid Payload. No Attributes found", "" + self.res_data["Attributes"] =3D OrderedDict() for key in patch_data["Attributes"].keys(): + print("Check key in patch_data:{}".format(key)) # verify client didn't send us a property we cant patch - if key not in self.res_data["Attributes"]: + if key not in self.parent.res_data["Attributes"]: + print("Invalid Patch Property Sent") return 4, 400, "Invalid Patch Property Sent", "" else: - self.parent.res_data["Attributes"][key] =3D patch_data["At= tributes"][key] - return 0, 204, None, None + self.res_data["Attributes"][key] =3D patch_data["Attribute= s"][key] + resp =3D flask.Response(json.dumps(self.res_data,indent=3D4)) + return 0, 200, None, resp =20 =20 class RfPCIeDeviceCollection(RfCollection): @@ -196,3 +219,51 @@ class RfUSBPortCollection(RfCollection): =20 class RfUSBPort(RfResource): pass + +class RfBootOptionCollection(RfCollection): + def final_init_processing(self, base_path, rel_path): + self.maxIdx =3D 0 + self.bootOptions =3D {} + + def element_type(self): + return RfBootOption + + def post_resource(self, post_data): + print("Members@odata.count:{}".format(self.res_data["Members@odata= .count"])) + print("Members:{}".format(self.res_data["Members"])) + print("post_data:{}".format(post_data)) + + self.res_data["Members@odata.count"] =3D self.res_data["Members@od= ata.count"] + 1 + self.maxIdx =3D self.maxIdx + 1 + newBootOptIdx =3D self.maxIdx + newBootOptUrl =3D self.res_data["@odata.id"] + "/" + str(newBootOp= tIdx) + self.res_data["Members"].append({"@odata.id":newBootOptUrl}) + + post_data["@odata.id"] =3D newBootOptUrl + self.bootOptions[str(newBootOptIdx)] =3D post_data + + resp =3D flask.Response(json.dumps(post_data,indent=3D4)) + resp.headers["Location"] =3D newBootOptUrl + return 0, 200, None, resp + + def patch_bootOpt(self, Idx, patch_data): + self.bootOptions[str(Idx)] =3D {**self.bootOptions[str(Idx)], **pa= tch_data} + resp =3D flask.Response(json.dumps(self.bootOptions[str(Idx)],inde= nt=3D4)) + return 0, 200, None, resp + + def get_bootOpt(self, Idx): + return json.dumps(self.bootOptions[Idx],indent=3D4) + + def delete_bootOpt(self, Idx): + print("in delete_bootOpt") + + resp =3D flask.Response(json.dumps(self.bootOptions[Idx],indent=3D= 4)) + + self.bootOptions.pop(Idx) + self.res_data["Members@odata.count"] =3D self.res_data["Members@od= ata.count"] - 1 + + bootOptUrl =3D self.res_data["@odata.id"] + "/" + str(Idx) + self.res_data["Members"].remove({"@odata.id":bootOptUrl}) + return 0, 200, None, resp + +class RfBootOption(RfResource): --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#78064): https://edk2.groups.io/g/devel/message/78064 Mute This Topic: https://groups.io/mt/84374362/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun May 5 11:18:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+78065+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78065+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1626937416; cv=none; d=zohomail.com; s=zohoarc; b=LSZAhljdwFABiXK/x5pZvw8BNZubr9UoqWoDm+vRZC2kc9CCoXIS1gkP44AHAI3eIoKCP2TjmXWKdtU0w3qdu/RlBDlOFdVbnN9WzozdQe9RXHZZZi+K65VeizgiR/ycVQhkr+CtHfEwgY0/4kg9DE3G1USjKJ4RsdPKq7eF4IM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626937416; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=udEZvYlGH15BdNIQlOua5ArViJYULYLLiJSujm0sTmY=; b=m8IkLWOQK9PXc/0Q9uCWqJ370fn9HntNwriMxhtSpKc4sDFExxEQVb/a/Z3IezD6vjMHO9NYvRGAxmyGxLxhgjI+Xn84BmxdwraXjoBOcSRKgTvubup59EfwbUo6+A2ZITHKEvYJgZWpty6Y5WoMzQyHog0AkIdP/InNQ7pzH3g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78065+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1626937416515198.50605187946258; Thu, 22 Jul 2021 00:03:36 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id n1J1YY1788612x54duXduiNt; Thu, 22 Jul 2021 00:03:36 -0700 X-Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web12.4649.1626937414190099448 for ; Thu, 22 Jul 2021 00:03:34 -0700 X-Received: from pps.filterd (m0148664.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16M6vie8006483; Thu, 22 Jul 2021 07:03:28 GMT X-Received: from g4t3427.houston.hpe.com (g4t3427.houston.hpe.com [15.241.140.73]) by mx0b-002e3701.pphosted.com with ESMTP id 39xysjsmpd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Jul 2021 07:03:28 +0000 X-Received: from g9t2301.houston.hpecorp.net (g9t2301.houston.hpecorp.net [16.220.97.129]) by g4t3427.houston.hpe.com (Postfix) with ESMTP id F09DF6F; Thu, 22 Jul 2021 07:03:27 +0000 (UTC) X-Received: from abner-virtual-machine.asiapacific.hpqcorp.net (abner-virtual-machine.asiapacific.hpqcorp.net [15.119.210.153]) by g9t2301.houston.hpecorp.net (Postfix) with ESMTP id 0D5A467; Thu, 22 Jul 2021 07:03:26 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: Nickle Wang , Liming Gao Subject: [edk2-devel] [staging/edk2-redfish-client Tools PATCH 4/6] RedfishClientPkg/Redfish-Profile-Simulator: HTTP methods on Memory Collection Date: Thu, 22 Jul 2021 14:08:15 +0800 Message-Id: <20210722060817.18564-5-abner.chang@hpe.com> In-Reply-To: <20210722060817.18564-1-abner.chang@hpe.com> References: <20210722060817.18564-1-abner.chang@hpe.com> X-Proofpoint-GUID: srBuJ5vRFI38XZB1ViBGcUQ_dnW1_RWH X-Proofpoint-ORIG-GUID: srBuJ5vRFI38XZB1ViBGcUQ_dnW1_RWH X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-HPE-SCL: -1 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,abner.chang@hpe.com X-Gm-Message-State: AftZKJocmXfdARn2yj8v6pTAx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1626937416; bh=83sFnqxXDsi2fQv9Ml1Sh6ehWiBb9CRVfAksrUXZ+C4=; h=Cc:Date:From:Reply-To:Subject:To; b=DEQErr4kOkiSbDhjovNWkySvAlKIsrl0xP+Jbx6XBt8GThAOnGu/8TDSg9hAm4dQBeD L0QaFQdvoMSgBC5f4l0UqKseH6XEgM9SZ4eBmJN8ma7lALONbCcn8EzVYXLWFqvxR03V2 avn0BZnJZylT93WSiwvqfGYpScxSVUe8WEg= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1626937418321100012 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add POST and PATCH methods on Memory collection and resource. Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Liming Gao Reviewed-by: Nickle Wang --- .../v1sim/redfishURIs.py | 25 +++++++++++ .../v1sim/systems.py | 43 +++++++++++++++++++ 2 files changed, 68 insertions(+) diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/redfish= URIs.py b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/redfishURI= s.py index 3c912f7ce1..35d3794cc6 100644 --- a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/redfishURIs.py +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/redfishURIs.py @@ -1,6 +1,7 @@ # # Copyright Notice: # Copyright (c) 2019, Intel Corporation. All rights reserved.
+# (C) Copyright 2021 Hewlett Packard Enterprise Development LP
# SPDX-License-Identifier: BSD-2-Clause-Patent # # Copyright Notice: @@ -308,6 +309,30 @@ def rfApi_SimpleServer(root, versions, host=3D"127.0.0= .1", port=3D5000, cert=3D"", key else: return err_string, status_code =20 + @app.route("/redfish/v1/Systems//Memory", methods=3D= ['POST']) + @auth.rfAuthRequired + def rf_computer_memory_post(system_id): + print ("in POST memory collection") + rdata =3D json.loads(request.data,object_pairs_hook=3DOrderedDict) + print("rdata:{}".format(rdata)) + rc, status_code, err_string, resp =3D root.components['Systems'].g= et_element(system_id).components['Memory'].post_resource(rdata) + if rc =3D=3D 0: + return resp, status_code + else: + return err_string, status_code + + @app.route("/redfish/v1/Systems//Memory/", methods=3D['PATCH']) + @auth.rfAuthRequired + def rf_computer_memory_patch(system_id, MemoryIdx): + print ("in PATCH memory[%s] resource" % MemoryIdx) + rdata =3D json.loads(request.data,object_pairs_hook=3DOrderedDict) + print("rdata:{}".format(rdata)) + rc, status_code, err_string, resp =3D root.components['Systems'].g= et_element(system_id).components['Memory'].patch_memory(MemoryIdx, rdata) + if rc =3D=3D 0: + return resp, status_code + else: + return err_string, status_code + def resolve_path(service, path): parts =3D path.split('/') result =3D service diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/systems= .py b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/systems.py index b8b3788054..690101fb10 100644 --- a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/systems.py +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/systems.py @@ -2,6 +2,7 @@ # Copyright Notice: # # Copyright (c) 2019, Intel Corporation. All rights reserved.
+# (C) Copyright 2021 Hewlett Packard Enterprise Development LP
# SPDX-License-Identifier: BSD-2-Clause-Patent # # Copyright Notice: @@ -123,9 +124,50 @@ class RfSystemObj(RfResource): =20 # subclass Logs Collection class RfMemoryCollection(RfCollection): + def final_init_processing(self, base_path, rel_path): + self.maxIdx =3D self.res_data["Members@odata.count"] + def element_type(self): return RfMemory =20 + def post_resource(self, post_data): + print("Members@odata.count:{}".format(self.res_data["Members@odata= .count"])) + print("Members:{}".format(self.res_data["Members"])) + print("post_data:{}".format(post_data)) + + self.res_data["Members@odata.count"] =3D self.res_data["Members@od= ata.count"] + 1 + self.maxIdx =3D self.maxIdx + 1 + newMemoryIdx =3D self.maxIdx + newMemoryUrl =3D self.res_data["@odata.id"] + "/" + str(newMemoryI= dx) + self.res_data["Members"].append({"@odata.id":newMemoryUrl}) + + post_data["@odata.id"] =3D newMemoryUrl + self.elements[str(newMemoryIdx)] =3D post_data + + resp =3D flask.Response(json.dumps(post_data,indent=3D4)) + resp.headers["Location"] =3D newMemoryUrl + return 0, 200, None, resp + + def patch_memory(self, Idx, patch_data): + self.elements[str(Idx)] =3D {**self.elements[str(Idx)], **patch_da= ta} + resp =3D flask.Response(json.dumps(self.elements[str(Idx)],indent= =3D4)) + return 0, 200, None, resp + + def get_memory(self, Idx): + return json.dumps(self.elements[Idx],indent=3D4) + + def delete_memory(self, Idx): + print("in delete_memory") + + resp =3D flask.Response(json.dumps(self.elements[Idx],indent=3D4)) + + self.elements.pop(Idx) + self.res_data["Members@odata.count"] =3D self.res_data["Members@od= ata.count"] - 1 + + newMemoryUrl =3D self.res_data["@odata.id"] + "/" + str(Idx) + self.res_data["Members"].remove({"@odata.id":newMemoryUrl}) + return 0, 200, None, resp + =20 class RfMemory(RfResource): pass @@ -267,3 +309,4 @@ class RfBootOptionCollection(RfCollection): return 0, 200, None, resp =20 class RfBootOption(RfResource): + pass --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#78065): https://edk2.groups.io/g/devel/message/78065 Mute This Topic: https://groups.io/mt/84374363/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun May 5 11:18:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+78068+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78068+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1626937421; cv=none; d=zohomail.com; s=zohoarc; b=M63QiX0fr5NmqhpTu4y1CHu/pudgcxWMno4y9XbDdsgiPQkYH5nLR8vGAn4n10/WXDuMOp3buMk0A/CoT+YBw3U4aTaMJipUZNrNbbUH2/s1IPXYZNJWoQQJ6WoIeLoK4PEuaeaLYol7VyEN/KT5VxLO0cuybDYIEgmyvzbjYAM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626937421; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=nyN5LtPJutJ4Z9n7tbpHfouvqWRTqMjpNya8lT63ty8=; b=OfNCMtrBhxx5uqYmtVceXzwEc/u39iWsLY2FU4QfRiVR+9HS6CIPFrX2hnbP5quZOkDxCaj8lhcq+35dX0+jpq3D+WIP52fDi+DMdvAgT9hvS3rJ4O5xFJFVnwSy2LgV0bGe513INmdho5E7BC4poyCytw8dIvTI3qLJzTGmq9w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78068+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1626937421450861.4741333465416; Thu, 22 Jul 2021 00:03:41 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id ADcbYY1788612xevNgGlzd4X; Thu, 22 Jul 2021 00:03:41 -0700 X-Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web08.4638.1626937420443933563 for ; Thu, 22 Jul 2021 00:03:40 -0700 X-Received: from pps.filterd (m0150244.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16M73bC2025251; Thu, 22 Jul 2021 07:03:37 GMT X-Received: from g4t3427.houston.hpe.com (g4t3427.houston.hpe.com [15.241.140.73]) by mx0b-002e3701.pphosted.com with ESMTP id 39y3rjg3h9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Jul 2021 07:03:37 +0000 X-Received: from g9t2301.houston.hpecorp.net (g9t2301.houston.hpecorp.net [16.220.97.129]) by g4t3427.houston.hpe.com (Postfix) with ESMTP id 2F0F057; Thu, 22 Jul 2021 07:03:29 +0000 (UTC) X-Received: from abner-virtual-machine.asiapacific.hpqcorp.net (abner-virtual-machine.asiapacific.hpqcorp.net [15.119.210.153]) by g9t2301.houston.hpecorp.net (Postfix) with ESMTP id 4C5734D; Thu, 22 Jul 2021 07:03:28 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: Nickle Wang , Liming Gao Subject: [edk2-devel] [staging/edk2-redfish-client Tools PATCH 5/6] RedfishClientPkg/Redfish-Profile-Simulator: Add ETAG on memory resource Date: Thu, 22 Jul 2021 14:08:16 +0800 Message-Id: <20210722060817.18564-6-abner.chang@hpe.com> In-Reply-To: <20210722060817.18564-1-abner.chang@hpe.com> References: <20210722060817.18564-1-abner.chang@hpe.com> X-Proofpoint-ORIG-GUID: ywu1_Xm2bfMjGzDdxpWI291ZP1ScUeZq X-Proofpoint-GUID: ywu1_Xm2bfMjGzDdxpWI291ZP1ScUeZq X-HPE-SCL: -1 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,abner.chang@hpe.com X-Gm-Message-State: bw6BYcF65YXfzvmMny2zvHk2x1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1626937421; bh=zGrZaxps3FkUZPbbVhW8MsJu/ZY+mRTwrw9ollQfO7g=; h=Cc:Date:From:Reply-To:Subject:To; b=hYjw+nY8/x35no00rswVtQQ365UFF7etQuV1OZOWFQmucwVjgQ9Dvqbu90PWSz+OeXX c+aTJl2pl3/esZUzOw2gEdQ4Wg/0TeRHPiJi0k6hn0KImsWj0oeb16LKTDvFeFCHdvsTY rDs4uC5zE5ODZbBat+VJAFcnPQNB6tqJkPs= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1626938325439100002 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add ETAG support on Memory resource. Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Liming Gao Reviewed-by: Nickle Wang --- .../Redfish-Profile-Simulator/v1sim/systems.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/systems= .py b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/systems.py index 690101fb10..de4b839aeb 100644 --- a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/systems.py +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/systems.py @@ -18,6 +18,7 @@ from .resource import RfResource, RfCollection from .storage import RfSimpleStorageCollection, RfSmartStorage import flask import json +import hashlib from collections import OrderedDict =20 class RfSystemsCollection(RfCollection): @@ -142,13 +143,25 @@ class RfMemoryCollection(RfCollection): self.res_data["Members"].append({"@odata.id":newMemoryUrl}) =20 post_data["@odata.id"] =3D newMemoryUrl + + md5 =3D hashlib.md5() + md5.update(json.dumps(post_data).encode("utf-8")) + etag_str =3D 'W/"' + md5.hexdigest() + '"' + post_data["@odata.etag"] =3D etag_str self.elements[str(newMemoryIdx)] =3D post_data =20 resp =3D flask.Response(json.dumps(post_data,indent=3D4)) resp.headers["Location"] =3D newMemoryUrl + resp.headers["ETag"] =3D etag_str + return 0, 200, None, resp =20 def patch_memory(self, Idx, patch_data): + md5 =3D hashlib.md5() + md5.update(json.dumps(patch_data).encode("utf-8")) + etag_str =3D 'W/"' + md5.hexdigest() + '"' + patch_data["@odata.etag"] =3D etag_str + self.elements[str(Idx)] =3D {**self.elements[str(Idx)], **patch_da= ta} resp =3D flask.Response(json.dumps(self.elements[str(Idx)],indent= =3D4)) return 0, 200, None, resp --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#78068): https://edk2.groups.io/g/devel/message/78068 Mute This Topic: https://groups.io/mt/84374368/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun May 5 11:18:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+78067+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78067+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1626937421; cv=none; d=zohomail.com; s=zohoarc; b=nD2Us7GwxiSvyOJrrnMRvnx9QVzQCBFe6EluPZanLvkgR67URjt6dtl8bShn0xGyPKZZuoY6a145fmJD4zgYv4U4lhvbXQo2TmV91/1g3/DfEh/UpquOsLu5Zuk/GLBhF0Rgxkq+5HaSULSnDiQUWex3oyNWsq3sbOkuG9UTtvU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626937421; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=ZtIBbWdgoMpJvNCcWYWviPhEAv6EF4WmHHCJFfJ5sbk=; b=V45cCZ1DObfVwfizEBcEus8d00dyldenVsQbxocFzJiW90kYAM+xjZJld7g+F67ZWBRCym+Q09+HPP3A709Bb06g8yCMLAkci1V/H1wTgJ4fk6KUwaTizzAIHnlg72kbEeWWrjoqZBIozA56G6U89euuvRqdRF0I4wIwv++huDI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78067+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1626937421046753.1916225357859; Thu, 22 Jul 2021 00:03:41 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id XYE4YY1788612xqE5AGzBQeG; Thu, 22 Jul 2021 00:03:40 -0700 X-Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web10.4666.1626937420173397889 for ; Thu, 22 Jul 2021 00:03:40 -0700 X-Received: from pps.filterd (m0150244.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16M73bxM025306; Thu, 22 Jul 2021 07:03:37 GMT X-Received: from g4t3425.houston.hpe.com (g4t3425.houston.hpe.com [15.241.140.78]) by mx0b-002e3701.pphosted.com with ESMTP id 39y3rjg3he-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Jul 2021 07:03:37 +0000 X-Received: from g9t2301.houston.hpecorp.net (g9t2301.houston.hpecorp.net [16.220.97.129]) by g4t3425.houston.hpe.com (Postfix) with ESMTP id 6E915B4; Thu, 22 Jul 2021 07:03:30 +0000 (UTC) X-Received: from abner-virtual-machine.asiapacific.hpqcorp.net (abner-virtual-machine.asiapacific.hpqcorp.net [15.119.210.153]) by g9t2301.houston.hpecorp.net (Postfix) with ESMTP id 8053148; Thu, 22 Jul 2021 07:03:29 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: Nickle Wang , Liming Gao Subject: [edk2-devel] [staging/edk2-redfish-client Tools PATCH 6/6] RedfishClientPkg/Redfish-Profile-Simulator: Add requirements Date: Thu, 22 Jul 2021 14:08:17 +0800 Message-Id: <20210722060817.18564-7-abner.chang@hpe.com> In-Reply-To: <20210722060817.18564-1-abner.chang@hpe.com> References: <20210722060817.18564-1-abner.chang@hpe.com> X-Proofpoint-ORIG-GUID: 2AFmEkTHnQ6MXRVetkDp7Y8B8hVD27sK X-Proofpoint-GUID: 2AFmEkTHnQ6MXRVetkDp7Y8B8hVD27sK X-HPE-SCL: -1 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,abner.chang@hpe.com X-Gm-Message-State: 9qmpCWiVn72miVTHsy0bUIWrx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1626937420; bh=1RkN/a6OqLgMaMGx8yu8NxWj1weGoV7M7SqB6gQmqsk=; h=Cc:Date:From:Reply-To:Subject:To; b=r+MwJ8fn9GRpTmtB2N6zvhyho074o6Yp7pDQadjRKI3YhDuiu/nLWQVkSAfvdIuyW3t th7R19YGJXmEz+3eImlsfnLHrdhUrTf41qlZKOIWhbcCXoxWAl9VvAyrrXm2G5xfwyLfv Zj8D6MIWzRpPWE0JVieffZW98eexdB09aL0= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1626937422962100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" add requirements.txt for the required python module Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Liming Gao Reviewed-by: Nickle Wang --- .../Tools/Redfish-Profile-Simulator/requirements.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 RedfishClientPkg/Tools/Redfish-Profile-Simulator/requir= ements.txt diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/requirements.= txt b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/requirements.txt new file mode 100644 index 0000000000..88807d87c2 --- /dev/null +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/requirements.txt @@ -0,0 +1,2 @@ +flask=3D=3D1.1.1 +pyOpenSSL --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#78067): https://edk2.groups.io/g/devel/message/78067 Mute This Topic: https://groups.io/mt/84374367/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-