# Railway Cloud Resource Management as a Service
## 4 Performance Management of Railway Cloud Resources
### Formal Verification of the CRPM API  
In order to verify the proposed service-based approach to the design of railway cloud resource performance management, the models representing a PM job status supported by a CM application and the CRPM service are developed. Transitions in models are triggered by applying HTTP methods on the resources representing a cloud resource PM. Figure 14: Flow of suspending a PM job. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Resource Name** & **Resource URI** & **HTTP Method** & **Meaning** \\ \hline All PM jobs & /pmJobs & POST & Creates a PM job \\ \cline{3-4}  & & GET & Retrieves the list of PM jobs \\ \hline Individual PM job & /pmJobs/\{pmJobID\} & GET & Queries an individual PM job \\ \cline{3-4}  & & PUT & Updates a PM job \\ \cline{3-4}  & & PATCH & Suspends or resumes a PM job \\ \cline{3-4}  & & DELETE & Deletes a PM job \\ \hline PM subscriptions & /pmSubscriptions & POST & Creates a PM subscription \\  & & GET & Retrieves the list of PM \\  & & GET & subscriptions \\ \hline Individual PM & /pmSubscriptions/ & GET & Reads a PM subscription \\ Subscription & \{pmSubscriptionID\} & DELETE & Deletes a PM subscription \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Overview of the resources and methods of the Cloud Resource Performance Management API. Figure 13: Flow of PM job creation. Figure 15 shows the UML state diagram of a simplified PM job status model supported by a CM application. In the _App.Null_ state, the PM job is not created yet. In this state, default PM jobs may be started (_DefaultPMjobsStatus_ event), or the cloud operator may request additional PM jobs (_AddPMjob_ event), and the CM application requests from the CRPM service to create a PM job (_PMjobCreateReq_ action). In the _App.Active_ state, the CM application may receive the response of the PM job creation request (_PMjobCreateRes_ event) and notify the cloud operator of the result (_PMjobAdd_ action). The PM job is active. In the case of a successful PM job creation, the cloud operator may decide to suspend the PM job (_SuspendPMjob_ event), and the CM application requests from the CRPM service to suspend the PM job (_PMjobSuspendReq_ action). In the _Suspending_ state, the CM application waits for the PM job retention. In this state, the CM application may receive the response of its request for PM job retention (_PMjobSuspendRes_ event) and, if so, it informs the cloud operator for the result of operation (_PMjobSuspended_ action). In the _App.Suspended_ state, the PM job is suspended. In this state, the cloud operator may request to resume the PM job (_ResumePMjob_ event), and the CM application requests from the CRPM service to resume the suspended PM job (_PMjobResumeReq_ action). In the _App.Suspended_ state, the cloud operator may terminate the PM job (_terminatePMjob_ event), and the CM application requests from the CRPM service to terminate the suspended PM job (_PMjobTerminateReq_ action). In the _Resuming_ state, the CM application may receive the response of its request to resume the suspended PM job (_PMjobResumeRes_ event), and it notifies the cloud operator of the result of operation (_PMjobResumed_ action). In the _Terminating_ state, the CM application may receive the response of its request to terminate the PM job (_PMjobTerminateRes_ event), and it notifies the cloud operator of the result of operation (_PMjobTerminated_ action). In the _App.Terminated_ state, the PM job is terminated. Figure 16 shows the UML state diagram of a simplified PM job status model supported by the CRPM service. Figure 16: A simplified model of the PM job status maintained by the CRPM service. Figure 15: A simplified model of the PM job status maintained by a CM application. In the _Null_ state, the PM job is not created.