diff options
author | Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com> | 2020-01-21 12:41:56 +0100 |
---|---|---|
committer | Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com> | 2020-01-27 09:53:14 +0000 |
commit | d04ba325f3ef4e60eb4fd8e7477af78d1be0d79d (patch) | |
tree | c26bd2ee2f6c6b45c850088bc6b60f23741a1b33 | |
parent | e13c27606f49f70910eca01f0ee496e7e9a6b330 (diff) | |
download | bmcweb-d04ba325f3ef4e60eb4fd8e7477af78d1be0d79d.tar.gz bmcweb-d04ba325f3ef4e60eb4fd8e7477af78d1be0d79d.zip |
Add OemVirtualMedia schema
OEM Schema for VirtualMedia added.
Also OpenBMC level has been added to OEM field in the code to
conform to schema standard.
Tested:
Manually using full stack of VirtualMedia.
* Inserting/ejecting media in both legacy and proxy mode
* Redfish Service Validator 1.3.2 ran
Change-Id: Iaa87dd767a4bf2062bd4e74dd790a2496aca96de
Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
-rw-r--r-- | redfish-core/lib/virtual_media.hpp | 11 | ||||
-rw-r--r-- | static/redfish/v1/$metadata/index.xml | 4 | ||||
-rw-r--r-- | static/redfish/v1/JsonSchemas/OemVirtualMedia/index.json | 61 | ||||
-rw-r--r-- | static/redfish/v1/schema/OemVirtualMedia_v1.xml | 46 |
4 files changed, 118 insertions, 4 deletions
diff --git a/redfish-core/lib/virtual_media.hpp b/redfish-core/lib/virtual_media.hpp index 457b0b2..f95e91d 100644 --- a/redfish-core/lib/virtual_media.hpp +++ b/redfish-core/lib/virtual_media.hpp @@ -75,7 +75,8 @@ static void vmParseInterfaceObject(const DbusInterfaceType &interface, if (!endpointIdValue->empty()) { // Proxy mode - aResp->res.jsonValue["Oem"]["WebSocketEndpoint"] = *endpointIdValue; + aResp->res.jsonValue["Oem"]["OpenBMC"]["WebSocketEndpoint"] = + *endpointIdValue; aResp->res.jsonValue["TransferProtocolType"] = "OEM"; aResp->res.jsonValue["Inserted"] = *activeValue; if (*activeValue == true) @@ -115,7 +116,7 @@ static nlohmann::json vmItemTemplate(const std::string &name, nlohmann::json item; item["@odata.id"] = "/redfish/v1/Managers/" + name + "/VirtualMedia/" + resName; - item["@odata.type"] = "#VirtualMedia.v1_1_0.VirtualMedia"; + item["@odata.type"] = "#VirtualMedia.v1_3_0.VirtualMedia"; item["@odata.context"] = "/redfish/v1/$metadata#VirtualMedia.VirtualMedia"; item["Name"] = "Virtual Removable Media"; item["Id"] = resName; @@ -127,7 +128,9 @@ static nlohmann::json vmItemTemplate(const std::string &name, item["MediaTypes"] = {"CD", "USBStick"}; item["TransferMethod"] = "Stream"; item["TransferProtocolType"] = nullptr; - item["Oem"]["WebSocketEndpoint"] = nullptr; + item["Oem"]["OpenBmc"]["WebSocketEndpoint"] = nullptr; + item["Oem"]["OpenBMC"]["@odata.type"] = + "#OemVirtualMedia.v1_0_0.VirtualMedia"; return item; } @@ -232,7 +235,7 @@ static void getVmData(std::shared_ptr<AsyncResp> aResp, } messages::resourceNotFound( - aResp->res, "#VirtualMedia.v1_1_0.VirtualMedia", resName); + aResp->res, "#VirtualMedia.v1_3_0.VirtualMedia", resName); }, service, "/xyz/openbmc_project/VirtualMedia", "org.freedesktop.DBus.ObjectManager", "GetManagedObjects"); diff --git a/static/redfish/v1/$metadata/index.xml b/static/redfish/v1/$metadata/index.xml index c6b04e0..c6da3e6 100644 --- a/static/redfish/v1/$metadata/index.xml +++ b/static/redfish/v1/$metadata/index.xml @@ -1808,6 +1808,10 @@ <edmx:Reference Uri="/redfish/v1/schema/VirtualMediaCollection_v1.xml"> <edmx:Include Namespace="VirtualMediaCollection"/> </edmx:Reference> + <edmx:Reference Uri="/redfish/v1/schema/OemVirtualMedia_v1.xml"> + <edmx:Include Namespace="OemVirtualMedia"/> + <edmx:Include Namespace="OemVirtualMedia.v1_0_0"/> + </edmx:Reference> <edmx:Reference Uri="/redfish/v1/schema/VLanNetworkInterface_v1.xml"> <edmx:Include Namespace="VLanNetworkInterface"/> <edmx:Include Namespace="VLanNetworkInterface.v1_0_0"/> diff --git a/static/redfish/v1/JsonSchemas/OemVirtualMedia/index.json b/static/redfish/v1/JsonSchemas/OemVirtualMedia/index.json new file mode 100644 index 0000000..78bd8b7 --- /dev/null +++ b/static/redfish/v1/JsonSchemas/OemVirtualMedia/index.json @@ -0,0 +1,61 @@ +{ + "$id": "http://redfish.dmtf.org/schemas/v1/OemVirtualMedia.v1_0_0.json", + "$schema": "http://redfish.dmtf.org/schemas/v1/redfish-schema-v1.json", + "copyright": "Copyright 2014-2019 DMTF. For the full DMTF copyright policy, see http://www.dmtf.org/about/policies/copyright", + "definitions": { + "OpenBmc": { + "additionalProperties": true, + "description": "Oem properties for OpenBmc.", + "patternProperties": { + "^([a-zA-Z_][a-zA-Z0-9_]*)?@(odata|Redfish|Message)\\.[a-zA-Z_][a-zA-Z0-9_]*$": { + "description": "This property shall specify a valid odata or Redfish property.", + "type": [ + "array", + "boolean", + "integer", + "number", + "null", + "object", + "string" + ] + } + }, + "properties": { + "WebSocketEndpoint": { + "description": "Indicates endpoint socket name and location.", + "longDescription": "The value of this property shall be a structure ring indicating location and name of the socket used to communicate with nbd server.", + "readonly": true, + "type": [ + "string", + "null" + ] + } + }, + "type": "object" + }, + "VirtualMedia": { + "additionalProperties": false, + "description": "OEM Extension for VirtualMedia", + "longDescription": "OEM Extension for VirtualMedia to support Proxy mode.", + "patternProperties": { + "^([a-zA-Z_][a-zA-Z0-9_]*)?@(odata|Redfish|Message)\\.[a-zA-Z_][a-zA-Z0-9_]*$": { + "description": "This property shall specify a valid odata or Redfish property.", + "type": [ + "array", + "boolean", + "integer", + "number", + "null", + "object", + "string" + ] + } + }, + "properties": {}, + "type": "object" + } + }, + "owningEntity": "OpenBMC", + "release": "1.0", + "title": "#OemVirtualMedia.v1_0_0" +}
\ No newline at end of file diff --git a/static/redfish/v1/schema/OemVirtualMedia_v1.xml b/static/redfish/v1/schema/OemVirtualMedia_v1.xml new file mode 100644 index 0000000..2b03a67 --- /dev/null +++ b/static/redfish/v1/schema/OemVirtualMedia_v1.xml @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8"?> +<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0"> + + <edmx:Reference Uri="http://docs.oasis-open.org/odata/odata/v4.0/errata03/csd01/complete/vocabularies/Org.OData.Core.V1.xml"> + <edmx:Include Namespace="Org.OData.Core.V1" Alias="OData"/> + </edmx:Reference> + <edmx:Reference Uri="http://docs.oasis-open.org/odata/odata/v4.0/errata03/csd01/complete/vocabularies/Org.OData.Measures.V1.xml"> + <edmx:Include Namespace="Org.OData.Measures.V1" Alias="Measures"/> + </edmx:Reference> + <edmx:Reference Uri="http://redfish.dmtf.org/schemas/v1/RedfishExtensions_v1.xml"> + <edmx:Include Namespace="RedfishExtensions.v1_0_0" Alias="Redfish"/> + </edmx:Reference> + <edmx:Reference Uri="http://redfish.dmtf.org/schemas/v1/Resource_v1.xml"> + <edmx:Include Namespace="Resource"/> + <edmx:Include Namespace="Resource.v1_0_0"/> + </edmx:Reference> + + <edmx:DataServices> + + <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="OemVirtualMedia"> + <Annotation Term="Redfish.OwningEntity" String="OpenBMC"/> + </Schema> + + <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="OemVirtualMedia.v1_0_0"> + <Annotation Term="Redfish.OwningEntity" String="OpenBMC"/> + <Annotation Term="Redfish.Release" String="1.0"/> + + <ComplexType Name="OpenBmc" BaseType="Resource.OemObject"> + <Annotation Term="OData.AdditionalProperties" Bool="true"/> + <Annotation Term="OData.Description" String="Oem properties for OpenBmc." /> + + <Property Name="WebSocketEndpoint" Type="Edm.String"> + <Annotation Term="OData.Permissions" EnumMember="OData.Permission/Read"/> + <Annotation Term="OData.Description" String="Indicates endpoint socket name and location."/> + <Annotation Term="OData.LongDescription" String="The value of this property shall be a structure ring indicating location and name of the socket used to communicate with nbd server."/> + </Property> + </ComplexType> + + <EntityType Name="VirtualMedia" BaseType="Resource.OemObject" Abstract="true"> + <Annotation Term="OData.Description" String="OEM Extension for VirtualMedia"/> + <Annotation Term="OData.LongDescription" String="OEM Extension for VirtualMedia to support Proxy mode."/> + </EntityType> + </Schema> + + </edmx:DataServices> +</edmx:Edmx> |