1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
From 49dc25100ab8a4220f81bc8f9b54808850fe1267 Mon Sep 17 00:00:00 2001
From: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
Date: Wed, 8 Jul 2020 15:17:31 +0200
Subject: [PATCH] VirtualMedia fixes for Redfish Service Validator
Removes all warnings and errors for VirtualMedia
- rework for OemVirtualMedia
- minor adjustments for jsons
Tested:
Redfish Service Validator ran with no errors and/or warnings
Change-Id: Ic027166153a807a8bd3a6c04f042969f16e0dc6a
Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
---
redfish-core/lib/virtual_media.hpp | 4 +--
.../v1/JsonSchemas/OemVirtualMedia/index.json | 28 +++----------------
.../redfish/v1/schema/OemVirtualMedia_v1.xml | 12 ++++----
3 files changed, 12 insertions(+), 32 deletions(-)
diff --git a/redfish-core/lib/virtual_media.hpp b/redfish-core/lib/virtual_media.hpp
index 552e255..183abbe 100644
--- a/redfish-core/lib/virtual_media.hpp
+++ b/redfish-core/lib/virtual_media.hpp
@@ -129,7 +129,7 @@ static nlohmann::json vmItemTemplate(const std::string& name,
item["MediaTypes"] = {"CD", "USBStick"};
item["TransferMethod"] = "Stream";
item["TransferProtocolType"] = nullptr;
- item["Oem"]["OpenBmc"]["WebSocketEndpoint"] = nullptr;
+ item["Oem"]["OpenBMC"]["WebSocketEndpoint"] = nullptr;
item["Oem"]["OpenBMC"]["@odata.type"] =
"#OemVirtualMedia.v1_0_0.VirtualMedia";
@@ -1039,7 +1039,7 @@ class VirtualMediaCollection : public Node
"#VirtualMediaCollection.VirtualMediaCollection";
res.jsonValue["Name"] = "Virtual Media Services";
res.jsonValue["@odata.id"] =
- "/redfish/v1/Managers/" + name + "/VirtualMedia/";
+ "/redfish/v1/Managers/" + name + "/VirtualMedia";
crow::connections::systemBus->async_method_call(
[asyncResp, name](const boost::system::error_code ec,
diff --git a/static/redfish/v1/JsonSchemas/OemVirtualMedia/index.json b/static/redfish/v1/JsonSchemas/OemVirtualMedia/index.json
index 78bd8b7..9ae641a 100644
--- a/static/redfish/v1/JsonSchemas/OemVirtualMedia/index.json
+++ b/static/redfish/v1/JsonSchemas/OemVirtualMedia/index.json
@@ -3,9 +3,10 @@
"$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.",
+ "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.",
@@ -32,27 +33,6 @@
}
},
"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",
diff --git a/static/redfish/v1/schema/OemVirtualMedia_v1.xml b/static/redfish/v1/schema/OemVirtualMedia_v1.xml
index 2b03a67..84afe73 100644
--- a/static/redfish/v1/schema/OemVirtualMedia_v1.xml
+++ b/static/redfish/v1/schema/OemVirtualMedia_v1.xml
@@ -25,20 +25,20 @@
<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">
+ <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."/>
+ <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>
</EntityType>
</Schema>
--
2.25.0
|