\CloudMunchCloudmunchService

Class CloudmunchService This class provides the service methods for the plugins to make various API calls to cloudmunch.

Summary

Methods
Properties
Constants
__construct()
sendNotification()
updateCustomContextData()
callInterfaceAction()
getCustomContextData()
getCloudmunchData()
updateCloudmunchData()
addCloudmunchData()
deleteCloudmunchData()
downloadGCRKeys()
downloadKeys()
deleteKeys()
No public properties found
APPLICATIONS
No protected methods found
No protected properties found
N/A
No private methods found
$appContext
$cmDataManager
$keyArray
$logHelper
N/A

Constants

APPLICATIONS

APPLICATIONS

Properties

$appContext

$appContext : \CloudMunch\Reference

Type

\CloudMunch\Reference — to AppContext

$cmDataManager

$cmDataManager : \CloudMunch\Reference

Type

\CloudMunch\Reference — to CMDataManager

$keyArray

$keyArray : \CloudMunch\List

Type

\CloudMunch\List — of downloaded keys

$logHelper

$logHelper : \CloudMunch\Reference

Type

\CloudMunch\Reference — to LogHelper

Methods

__construct()

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

Constructor to initialise Application Context and LogHandler.

Parameters

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

sendNotification()

sendNotification(string  $message, string  $channel, string  $to, string  $subject = "", string  $attachment = "") 

This method is to send notification on a selected channel.

Parameters

string $message

: Notification message.

string $channel

: Channel to send notification to

string $to

: To addresses to be notified

string $subject
  • optional : Subject of the notification (incase of mail)
string $attachment
  • optional : Attachment of the notification

updateCustomContextData()

updateCustomContextData(array  $contextArray, array  $data = null, string  $method = "PATCH", array  $extraParams = null) : 

This method is used to update data for a particular context.

Parameters

array $contextArray

associative array with key as context and value as its id.

array $data

Data to be updated.

string $method

method for updation, example POST,PATCH.

array $extraParams

Extra parameters

Returns

callInterfaceAction()

callInterfaceAction(  $integrationID,   $action,   $data = array()) : \CloudMunch\json

Executor an interface action and return the response.

Parameters

$integrationID
$action
$data

Returns

\CloudMunch\json —

response from api interface action

getCustomContextData()

getCustomContextData(array  $contextArray, array  $queryParams) : array

Retreive custom context data.

Parameters

array $contextArray

associative array with key as context and its id as value

array $queryParams

query paramters

Returns

array —

data

getCloudmunchData()

getCloudmunchData(string  $context, string  $contextid, array  $filterdata) : array

Method for API calls to CloudMunch service to retreive context data.

Parameters

string $context

Context for which data has to be retrieved.

string $contextid

ID of the context.

array $filterdata

Filter data

Returns

array —

data

updateCloudmunchData()

updateCloudmunchData(string  $context, string  $contextid, array  $data) : array

Method for API calls to CloudMunch service to update context data.

Parameters

string $context

Context for which data has to be updated.

string $contextid

ID of the context.

array $data

Data to be updated

Returns

array —

data

addCloudmunchData()

addCloudmunchData(string  $context, array  $data) : array

Method for API calls to CloudMunch service to add context data.

Parameters

string $context

Context for which data has to be added.

array $data

Data to be updated

Returns

array —

data

deleteCloudmunchData()

deleteCloudmunchData(string  $context, string  $contextid) 

This method deletes the context data of the object with given ID.

Parameters

string $context

Context for which data has to be deleted.

string $contextid

ID of the context.

downloadGCRKeys()

downloadGCRKeys(string  $filekey, string  $context, string  $contextid) : string

This method downloads Google container registry key.

Parameters

string $filekey

name of the key field

string $context

context of the key

string $contextid

id of the context

Returns

string —

location of the downloaded file

downloadKeys()

downloadKeys(string  $filekey, string  $context, string  $contextid) : string

This method downloads key files from cloudmunch.

Parameters

string $filekey

name of the key field

string $context

context of the key

string $contextid

id of the context

Returns

string —

location of the downloaded file

deleteKeys()

deleteKeys() 

This method is invoked on app completion to delete the downloaded keys