Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
Storage: Controller and Model Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergkemper committed May 24, 2017
1 parent b45b2e7 commit c3965f1
Show file tree
Hide file tree
Showing 2 changed files with 142 additions and 2 deletions.
35 changes: 34 additions & 1 deletion module/Storage/src/Storage/Controller/StorageController.php
Expand Up @@ -5,7 +5,7 @@
* bareos-webui - Bareos Web-Frontend
*
* @link https://github.com/bareos/bareos-webui for the canonical source repository
* @copyright Copyright (c) 2013-2016 Bareos GmbH & Co. KG (http://www.bareos.org/)
* @copyright Copyright (c) 2013-2017 Bareos GmbH & Co. KG (http://www.bareos.org/)
* @license GNU Affero General Public License (http://www.gnu.org/licenses/)
*
* This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -34,6 +34,9 @@
class StorageController extends AbstractActionController
{

/**
* Variables
*/
protected $storageModel = null;
protected $poolModel = null;
protected $bsock = null;
Expand All @@ -51,6 +54,11 @@ class StorageController extends AbstractActionController
".pools"
);

/**
* Index Action
*
* @return object
*/
public function indexAction()
{
$this->RequestURIPlugin()->setRequestURI();
Expand All @@ -72,6 +80,11 @@ public function indexAction()
return new ViewModel(array());
}

/**
* Details Action
*
* @return object
*/
public function detailsAction()
{
$this->RequestURIPlugin()->setRequestURI();
Expand Down Expand Up @@ -243,6 +256,11 @@ public function detailsAction()
}
}

/**
* Status Action
*
* @return object
*/
public function statusAction()
{
$this->RequestURIPlugin()->setRequestURI();
Expand Down Expand Up @@ -281,6 +299,11 @@ public function statusAction()
);
}

/**
* Get Data Action
*
* @return object
*/
public function getDataAction()
{
$this->RequestURIPlugin()->setRequestURI();
Expand Down Expand Up @@ -325,6 +348,11 @@ public function getDataAction()
return $response;
}

/**
* Get Storage Model
*
* @return object
*/
public function getStorageModel()
{
if(!$this->storageModel) {
Expand All @@ -334,6 +362,11 @@ public function getStorageModel()
return $this->storageModel;
}

/**
* Get Pool Model
*
* @return object
*/
public function getPoolModel()
{
if(!$this->poolModel) {
Expand Down
109 changes: 108 additions & 1 deletion module/Storage/src/Storage/Model/StorageModel.php
Expand Up @@ -5,7 +5,7 @@
* bareos-webui - Bareos Web-Frontend
*
* @link https://github.com/bareos/bareos-webui for the canonical source repository
* @copyright Copyright (c) 2013-2016 Bareos GmbH & Co. KG (http://www.bareos.org/)
* @copyright Copyright (c) 2013-2017 Bareos GmbH & Co. KG (http://www.bareos.org/)
* @license GNU Affero General Public License (http://www.gnu.org/licenses/)
*
* This program is free software: you can redistribute it and/or modify
Expand All @@ -28,6 +28,13 @@
class StorageModel
{

/**
* Get all Storages
*
* @param $bsock
*
* @return array
*/
public function getStorages(&$bsock=null)
{
if(isset($bsock)) {
Expand All @@ -41,6 +48,14 @@ public function getStorages(&$bsock=null)
}
}

/**
* Get Status Storage Slots
*
* @param $bsock
* @param $storage
*
* @return array
*/
public function getStatusStorageSlots(&$bsock=null, $storage=null)
{
if(isset($bsock, $storage)) {
Expand All @@ -54,6 +69,16 @@ public function getStatusStorageSlots(&$bsock=null, $storage=null)
}
}

/**
* Import Slots
*
* @param $bsock
* @param $storage
* @param $srcslots
* @param $dstslots
*
* @return string
*/
public function importSlots(&$bsock=null, $storage=null, $srcslots=null, $dstslots=null)
{
if(isset($bsock, $storage)) {
Expand Down Expand Up @@ -81,6 +106,15 @@ public function importSlots(&$bsock=null, $storage=null, $srcslots=null, $dstslo
}
}

/**
* Export Slots
*
* @param $bsock
* @param $storage
* @param $slots
*
* @return string
*/
public function exportSlots(&$bsock=null, $storage=null, $slots=null)
{
if(isset($bsock, $storage, $slots)) {
Expand All @@ -93,6 +127,16 @@ public function exportSlots(&$bsock=null, $storage=null, $slots=null)
}
}

/**
* Mound Slots
*
* @param $bsock
* @param $storage
* @param $slot
* @param $drive
*
* @return string
*/
public function mountSlot(&$bsock=null, $storage=null, $slot=null, $drive=null)
{
if(isset($bsock, $storage, $slot, $drive)) {
Expand All @@ -105,6 +149,15 @@ public function mountSlot(&$bsock=null, $storage=null, $slot=null, $drive=null)
}
}

/**
* Unmount Slots
*
* @param $bsock
* @param $storage
* @param $drive
*
* @return string
*/
public function unmountSlot(&$bsock=null, $storage=null, $drive=null)
{
if(isset($bsock, $storage, $drive)) {
Expand All @@ -117,6 +170,15 @@ public function unmountSlot(&$bsock=null, $storage=null, $drive=null)
}
}

/**
* Release Slot
*
* @param $bsock
* @param $storage
* @param $drive
*
* @return string
*/
public function releaseSlot(&$bsock=null, $storage=null, $drive=null)
{
if(isset($bsock, $storage, $drive)) {
Expand All @@ -129,6 +191,14 @@ public function releaseSlot(&$bsock=null, $storage=null, $drive=null)
}
}

/**
* Update Slots
*
* @param $bsock
* @param $storage
*
* @return string
*/
public function updateSlots(&$bsock=null, $storage=null)
{
if(isset($bsock, $storage)) {
Expand All @@ -141,6 +211,16 @@ public function updateSlots(&$bsock=null, $storage=null)
}
}

/**
* Move Slots
*
* @param $bsock
* @param $storage
* @param $srcslots
* @param $dstslots
*
* @return json
*/
public function moveSlots(&$bsock=null, $storage=null, $srcslots=null, $dstslots=null)
{
if(isset($bsock, $storage, $srcslots, $dstslots)) {
Expand All @@ -153,6 +233,17 @@ public function moveSlots(&$bsock=null, $storage=null, $srcslots=null, $dstslots
}
}

/**
* Label
*
* @param $bsock
* @param $storage
* @param $pool
* @param $drive
* @param $slots
*
* @return string
*/
public function label(&$bsock=null, $storage=null, $pool=null, $drive=null, $slots=null)
{
if(isset($bsock, $storage, $pool, $drive)) {
Expand All @@ -165,6 +256,14 @@ public function label(&$bsock=null, $storage=null, $pool=null, $drive=null, $slo
}
}

/**
* Get Slots
*
* @param $bsock
* @param $storage
*
* @return array
*/
public function getSlots(&$bsock=null, $storage=null)
{
if(isset($bsock, $storage)) {
Expand All @@ -178,6 +277,14 @@ public function getSlots(&$bsock=null, $storage=null)
}
}

/**
* Status Storage
*
* @param $bsock
* @param $storage
*
* @return string
*/
public function statusStorage(&$bsock=null, $storage=null)
{
if(isset($bsock, $storage)) {
Expand Down

0 comments on commit c3965f1

Please sign in to comment.