blob: cbf4f007f42e3753b91f15cd11be920759441a5c [file] [log] [blame]
James Feiste5d50062020-05-11 17:29:00 -07001/*
2// Copyright (c) 2020 Intel Corporation
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15*/
16
17namespace redfish
18{
19
20namespace messages
21{
22
Ed Tanous23a21a12020-07-25 04:45:05 +000023inline nlohmann::json taskAborted(const std::string& arg1)
James Feiste5d50062020-05-11 17:29:00 -070024{
25 return nlohmann::json{
26 {"@odata.type", "#Message.v1_0_0.Message"},
27 {"MessageId", "TaskEvent.1.0.1.TaskAborted"},
28 {"Message", "The task with id " + arg1 + " has been aborted."},
29 {"MessageArgs", {arg1}},
30 {"Severity", "Critical"},
31 {"Resolution", "None."}};
32}
33
Ed Tanous23a21a12020-07-25 04:45:05 +000034inline nlohmann::json taskCancelled(const std::string& arg1)
James Feiste5d50062020-05-11 17:29:00 -070035{
36 return nlohmann::json{
37 {"@odata.type", "#Message.v1_0_0.Message"},
38 {"MessageId", "TaskEvent.1.0.1.TaskCancelled"},
39 {"Message", "The task with id " + arg1 + " has been cancelled."},
40 {"MessageArgs", {arg1}},
41 {"Severity", "Warning"},
42 {"Resolution", "None."}};
43}
44
Ed Tanous23a21a12020-07-25 04:45:05 +000045inline nlohmann::json taskCompletedOK(const std::string& arg1)
James Feiste5d50062020-05-11 17:29:00 -070046{
47 return nlohmann::json{
48 {"@odata.type", "#Message.v1_0_0.Message"},
49 {"MessageId", "TaskEvent.1.0.1.TaskCompletedOK"},
50 {"Message", "The task with id " + arg1 + " has Completed."},
51 {"MessageArgs", {arg1}},
52 {"Severity", "OK"},
53 {"Resolution", "None."}};
54}
55
Ed Tanous23a21a12020-07-25 04:45:05 +000056inline nlohmann::json taskCompletedWarning(const std::string& arg1)
James Feiste5d50062020-05-11 17:29:00 -070057{
58 return nlohmann::json{{"@odata.type", "#Message.v1_0_0.Message"},
59 {"MessageId", "TaskEvent.1.0.1.TaskCompletedWarning"},
60 {"Message", "The task with id " + arg1 +
61 " has completed with warnings."},
62 {"MessageArgs", {arg1}},
63 {"Severity", "Warning"},
64 {"Resolution", "None."}};
65}
66
Ed Tanous23a21a12020-07-25 04:45:05 +000067inline nlohmann::json taskPaused(const std::string& arg1)
James Feiste5d50062020-05-11 17:29:00 -070068{
69 return nlohmann::json{
70 {"@odata.type", "#Message.v1_0_0.Message"},
71 {"MessageId", "TaskEvent.1.0.1.TaskPaused"},
72 {"Message", "The task with id " + arg1 + " has been paused."},
73 {"MessageArgs", {arg1}},
74 {"Severity", "Warning"},
75 {"Resolution", "None."}};
76}
77
Ed Tanous23a21a12020-07-25 04:45:05 +000078inline nlohmann::json taskProgressChanged(const std::string& arg1,
79 const size_t arg2)
James Feiste5d50062020-05-11 17:29:00 -070080{
81 return nlohmann::json{
82 {"@odata.type", "#Message.v1_0_0.Message"},
83 {"MessageId", "TaskEvent.1.0.1.TaskProgressChanged"},
84 {"Message", "The task with id " + arg1 + " has changed to progress " +
85 std::to_string(arg2) + " percent complete."},
George Liu1149cbf2021-01-02 14:25:06 +080086 {"MessageArgs", {arg1, std::to_string(arg2)}},
James Feiste5d50062020-05-11 17:29:00 -070087 {"Severity", "OK"},
88 {"Resolution", "None."}};
89}
90
Ed Tanous23a21a12020-07-25 04:45:05 +000091inline nlohmann::json taskRemoved(const std::string& arg1)
James Feiste5d50062020-05-11 17:29:00 -070092{
93 return nlohmann::json{
94 {"@odata.type", "#Message.v1_0_0.Message"},
95 {"MessageId", "TaskEvent.1.0.1.TaskRemoved"},
96 {"Message", "The task with id " + arg1 + " has been removed."},
97 {"MessageArgs", {arg1}},
98 {"Severity", "Warning"},
99 {"Resolution", "None."}};
100}
101
Ed Tanous23a21a12020-07-25 04:45:05 +0000102inline nlohmann::json taskResumed(const std::string& arg1)
James Feiste5d50062020-05-11 17:29:00 -0700103{
104 return nlohmann::json{
105 {"@odata.type", "#Message.v1_0_0.Message"},
106 {"MessageId", "TaskEvent.1.0.1.TaskResumed"},
107 {"Message", "The task with id " + arg1 + " has been resumed."},
108 {"MessageArgs", {arg1}},
109 {"Severity", "OK"},
110 {"Resolution", "None."}};
111}
112
Ed Tanous23a21a12020-07-25 04:45:05 +0000113inline nlohmann::json taskStarted(const std::string& arg1)
James Feiste5d50062020-05-11 17:29:00 -0700114{
115 return nlohmann::json{
116 {"@odata.type", "#Message.v1_0_0.Message"},
117 {"MessageId", "TaskEvent.1.0.1.TaskStarted"},
118 {"Message", "The task with id " + arg1 + " has started."},
119 {"MessageArgs", {arg1}},
120 {"Severity", "OK"},
121 {"Resolution", "None."}};
122}
123
124} // namespace messages
125
126} // namespace redfish