\CloudMunch\helperAssetHelper

Class AssetHelper This is a helper class for assets.

User can manage assets in cloudmunch using this helper.

Summary

Methods
Properties
Constants
__construct()
getAsset()
addAsset()
updateAsset()
deleteAsset()
updateStatus()
checkIfAssetExists()
No public properties found
APPLICATIONS
ASSETS
No protected methods found
No protected properties found
N/A
No private methods found
$appContext
$cmDataManager
$logHelper
N/A

Constants

APPLICATIONS

APPLICATIONS

ASSETS

ASSETS

Properties

$appContext

$appContext : \CloudMunch\helper\CloudMunch\AppContext

Type

\CloudMunch\helper\CloudMunch\AppContext — Reference to AppContext object.

$cmDataManager

$cmDataManager : \CloudMunch\helper\CloudMunch\datamanager\CMDataManager

Type

\CloudMunch\helper\CloudMunch\datamanager\CMDataManager — Reference to CMDataManager object.

$logHelper

$logHelper : \CloudMunch\helper\CloudMunch\loghandling\LogHandler

Type

\CloudMunch\helper\CloudMunch\loghandling\LogHandler — Reference to LogHandler object.

Methods

__construct()

__construct(\CloudMunch\helper\CloudMunch\AppContext  $appContext, \CloudMunch\helper\CloudMunch\loghandling\LogHandler  $logHandler) 

Constructor to initialise Application Context and LogHandler.

Parameters

\CloudMunch\helper\CloudMunch\AppContext $appContext
\CloudMunch\helper\CloudMunch\loghandling\LogHandler $logHandler

getAsset()

getAsset(String  $assetID,   $filerdata) : \CloudMunch\helper\json

This method retrieves Asset details.

Parameters

String $assetID
$filerdata

Returns

\CloudMunch\helper\json —

object assetdetails

addAsset()

addAsset(string  $assetname, string  $assettype, string  $assetStatus, string  $assetExternalRef, array  $assetData) : \CloudMunch\helper\json

Helper method to add an asset to CloudMunch service.

Parameters

string $assetname

Name of the asset

string $assettype

Type of asset

string $assetStatus

Asset status ,valid values are STATUS_RUNNING,STATUS_STOPPED,STATUS_NIL

string $assetExternalRef

ID of any referenced asset.

array $assetData

Array of asset properties

Returns

\CloudMunch\helper\json —

object data {"id":"contextid","name":"contextname"}

updateAsset()

updateAsset(  $assetID,   $assetData) 

Updates the given asset.

Parameters

$assetID
$assetData

deleteAsset()

deleteAsset(  $assetID) 

Deletes the given asset.

Parameters

$assetID

updateStatus()

updateStatus(  $assetID,   $status) 

Update status of given asset.

Parameters

$assetID
$status

checkIfAssetExists()

checkIfAssetExists(string  $assetID) : boolean

Checks if Asset exists in cloudmunch.

Parameters

string $assetID

Returns

boolean