\CloudMunch\helperEnvironmentHelper

Class EnvironmentHelper This is a helper class for environments.

User can manage environments in cloudmunch using this helper.

Summary

Methods
Properties
Constants
__construct()
getExistingEnvironments()
getEnvironment()
addEnvironment()
setStage()
getStage()
updateEnvironment()
updateEnvironmentURL()
updateEnvironmentBuildVersion()
updateAsset()
updateVariables()
updateStatus()
checkIfEnvironmentExists()
getAssets()
deleteAsset()
No public properties found
APPLICATIONS
DATAERROR
ENVIRONMENTS
STAGE
No protected methods found
No protected properties found
N/A
No private methods found
$appContext
$cmDataManager
$logHelper
$roleHelper
$defaultRole
$defaultStage
$assetHelper
N/A

Constants

APPLICATIONS

APPLICATIONS

DATAERROR

DATAERROR

ENVIRONMENTS

ENVIRONMENTS

STAGE

STAGE

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.

$roleHelper

$roleHelper : \CloudMunch\helper\CloudMunch\helper\RoleHelper

Type

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

$defaultRole

$defaultRole : string

Type

string — Default role.

$defaultStage

$defaultStage : string

Type

string — Default stage.

$assetHelper

$assetHelper : \CloudMunch\helper\CloudMunch\helper\AssetHelper

Type

\CloudMunch\helper\CloudMunch\helper\AssetHelper — Reference to AssetHelper 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

getExistingEnvironments()

getExistingEnvironments(  $filterdata = null) : \CloudMunch\helper\json

Get existing environment based on the filter.

Parameters

$filterdata

Returns

\CloudMunch\helper\json —

object environmentdetails

getEnvironment()

getEnvironment(String  $environmentID,   $filterdata) : \CloudMunch\helper\json

Get the given environment details.

Parameters

String $environmentID
$filterdata

Returns

\CloudMunch\helper\json —

object environment details

addEnvironment()

addEnvironment(string  $environmentName, string  $environmentStatus, array  $environmentData) : array

Add the given environment to cloudmunch.

Parameters

string $environmentName

Name of the environment

string $environmentStatus

Environment status ,valid values are success,failed,in-progress

array $environmentData

Array of environment properties

Returns

array —

Details of environment which got added.

setStage()

setStage(array  $data) : array

This method to check and retreive stage details in the given array.

Parameters

array $data

Returns

array —

stage details

getStage()

getStage(  $key,   $invalue) : array

This method to check and retreive stage details in the given array.

Parameters

$key
$invalue

Returns

array —

stage details

updateEnvironment()

updateEnvironment(string  $environmentID, \CloudMunch\helper\JsonObject  $environmentData, string  $comment = null) 

This method updates the given environment with given data.

Parameters

string $environmentID

Environment ID

\CloudMunch\helper\JsonObject $environmentData

Environment Data

string $comment

comment for updation

updateEnvironmentURL()

updateEnvironmentURL(string  $environmentID, string  $environmentURL) 

This method updates the environment url of the given environment.

Parameters

string $environmentID

Environment ID

string $environmentURL

URL Environment Data

updateEnvironmentBuildVersion()

updateEnvironmentBuildVersion(string  $environmentID, string  $buildNumber) 

This method updates the build version of the given environment.

Parameters

string $environmentID

Environment ID

string $buildNumber

build number

updateAsset()

updateAsset(string  $environmentID, array  $assetArray, string  $roleID = null) 

This method adds given array of assets to an environment.

Parameters

string $environmentID

Environment ID

array $assetArray

AssetArray

string $roleID

Role Id

updateVariables()

updateVariables(string  $environmentID, array  $variables) 

This method updates some variables to an environment.

Parameters

string $environmentID

environmentID

array $variables

key value pairs to be updated to environment details

updateStatus()

updateStatus(string  $environmentID, string  $status) 

This method updates status of an environment.

Parameters

string $environmentID

Environment ID

string $status

Environment status

checkIfEnvironmentExists()

checkIfEnvironmentExists(string  $environmentID) : boolean

Checks if Environment exists in cloudmunch.

Parameters

string $environmentID

Environment ID

Returns

boolean —

True if environment exists.

getAssets()

getAssets(string  $environmentID) : array

This method returns the details of assets belonging to the given environment.

Parameters

string $environmentID

Environment ID

Returns

array —

Asset details

deleteAsset()

deleteAsset(string  $environmentID, string  $assetID) 

This method deletes the given asset from an environment.

Parameters

string $environmentID

Environment ID

string $assetID

AssetID