\CloudMunch\helperInsightHelper

This is a helper class for Insight plugins.Several helper methods to interact with CloudMunch Data Stores and Resources are provided here.

Helper methods to extract sprint details, create key metrics are available.

Summary

Methods
Properties
Constants
__construct()
getResources()
getInsightDataStoreExtracts()
getInsightDataStores()
getInsightReportCards()
getInsightReports()
getInsightDataStoreExtractID()
getInsightDataStoreID()
getInsightReportCardID()
getInsightReportID()
updateInsightDataStoreExtract()
updateInsightDataStore()
updateInsightReportCard()
updateInsightReport()
updateResource()
createInsightDataStoreExtract()
createInsightDataStore()
createInsightReportCard()
createInsightReport()
createResource()
sprint_getDateRangeForAllSprints()
sprint_getSprintsWithDates()
sprint_giveAFilterStringForASprint()
sprint_giveADateRangeOfASprint()
sprint_getSprintDetailsFromJiraCMDB()
sprint_getJiraSprintsData()
sprint_getJiraProjectNameFromResource()
identifyDatesForDurationUnit()
getExtractData()
createLineGraph()
createKanbanGraph()
linegraph_constructViewcardVisualizationMeta()
linegraph_constructViewcardMeta()
kanban_constructViewcardMeta()
kanban_constructViewcardVisualizationMeta()
updateExtract()
createDoughnutGraph()
addKeyMetric()
checkToleranceForTrend()
No public properties found
RESOURCES
FIELDS
FILTER
DEBUG
ERROR
EXTRACTS
DATASTORES
INSIGHT_REPORTS
INSIGHT_CARDS
DATE_VALUE
SPRINT
LABEL
TOLERANCE_STATE
TOLERANCE_DESCRIPTION
TOLERANCE_HIT
KANBAN
No protected methods found
No protected properties found
N/A
No private methods found
$appContext
$cmDataManager
$logHelper
$cmService
N/A

Constants

RESOURCES

RESOURCES

FIELDS

FIELDS

FILTER

FILTER

DEBUG

DEBUG

ERROR

ERROR

EXTRACTS

EXTRACTS

DATASTORES

DATASTORES

INSIGHT_REPORTS

INSIGHT_REPORTS

INSIGHT_CARDS

INSIGHT_CARDS

DATE_VALUE

DATE_VALUE

SPRINT

SPRINT

LABEL

LABEL

TOLERANCE_STATE

TOLERANCE_STATE

TOLERANCE_DESCRIPTION

TOLERANCE_DESCRIPTION

TOLERANCE_HIT

TOLERANCE_HIT

KANBAN

KANBAN

Properties

$appContext

$appContext : \CloudMunch\helper\CloudMunch\AppContext

Type

\CloudMunch\helper\CloudMunch\AppContext — Reference to application context

$cmDataManager

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

Type

\CloudMunch\helper\CloudMunch\datamanager\CMDataManager — Reference to CloudMunch data manager.

$logHelper

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

Type

\CloudMunch\helper\CloudMunch\loghandling\LogHandler — Reference to log handler.

$cmService

$cmService : \CloudMunch\helper\CloudMunch\CloudmunchService

Type

\CloudMunch\helper\CloudMunch\CloudmunchService — Reference to CloudMunch service.

Methods

__construct()

__construct(  $appContext,   $logHandler) 

Initialize appcontext and loghandler.

Parameters

$appContext
$logHandler

getResources()

getResources(string  $type, array  $filter = null) : array

Get all the resource from CMDB with given type.

Parameters

string $type

type of resource.

array $filter

List of filter data.

Returns

array —

resources available with given type

getInsightDataStoreExtracts()

getInsightDataStoreExtracts(string  $insightID, string  $dataStoreID, array  $queryOptions, string  $extractID = '') : \CloudMunch\helper\json

Get all extracts under provided resource and datastore.

Parameters

string $insightID
string $dataStoreID
array $queryOptions

associative array with key as query key and query value as value

string $extractID

Returns

\CloudMunch\helper\json —

object of extract details

getInsightDataStores()

getInsightDataStores(string  $insightID, array  $queryOptions, string  $dataStoreID = '') : \CloudMunch\helper\json

Get all datastores under provided resource.

Parameters

string $insightID
array $queryOptions

associative array with key as query key and query value as value

string $dataStoreID

Returns

\CloudMunch\helper\json —

object of datastore details

getInsightReportCards()

getInsightReportCards(string  $insightID, string  $reportID, array  $queryOptions, string  $cardID = '') : \CloudMunch\helper\json

Get all report cards under provided resource and report.

Parameters

string $insightID
string $reportID
array $queryOptions

associative array with key as query key and query value as value

string $cardID

Returns

\CloudMunch\helper\json —

object of report card details

getInsightReports()

getInsightReports(string  $insightID, array  $queryOptions, string  $reportID = '') : \CloudMunch\helper\json

Get all reports under provided resource.

Parameters

string $insightID
array $queryOptions

associative array with key as query key and query value as value

string $reportID

Returns

\CloudMunch\helper\json —

object of report details

getInsightDataStoreExtractID()

getInsightDataStoreExtractID(string  $insightID, string  $dataStoreID, string  $extractName) : string

Get extractID for provided extract name.

Parameters

string $insightID
string $dataStoreID
string $extractName

Returns

string —

extract id

getInsightDataStoreID()

getInsightDataStoreID(string  $insightID, string  $dataStoreName) : string

Get dataStoreID for provided datastore name.

Parameters

string $insightID
string $dataStoreName

Returns

string —

datastore id

getInsightReportCardID()

getInsightReportCardID(string  $insightID, string  $reportID, string  $cardName) : string

Get reportcardID for provided card name.

Parameters

string $insightID
string $reportID
string $cardName

Returns

string —

card id

getInsightReportID()

getInsightReportID(string  $insightID, string  $reportName) : string

Get reportID for provided report name.

Parameters

string $insightID
string $reportName

Returns

string —

report id

updateInsightDataStoreExtract()

updateInsightDataStoreExtract(string  $insightID, string  $dataStoreID, string  $extractID, string  $data) : \CloudMunch\helper\json

Update an extract with provided data.

Parameters

string $insightID
string $dataStoreID
string $extractID
string $data

Returns

\CloudMunch\helper\json —

object of extract details

updateInsightDataStore()

updateInsightDataStore(string  $insightID, string  $dataStoreID, string  $data) : \CloudMunch\helper\json

Update a report with provided data.

Parameters

string $insightID
string $dataStoreID
string $data

Returns

\CloudMunch\helper\json —

object of datastore details

updateInsightReportCard()

updateInsightReportCard(string  $insightID, string  $reportID, string  $cardID, string  $data) : \CloudMunch\helper\json

Update a report card with provided data.

Parameters

string $insightID
string $reportID
string $cardID
string $data

Returns

\CloudMunch\helper\json —

object of extract details

updateInsightReport()

updateInsightReport(string  $insightID, string  $reportID, string  $data) : \CloudMunch\helper\json

Update a report with provided data.

Parameters

string $insightID
string $reportID
string $data

Returns

\CloudMunch\helper\json —

object of report details

updateResource()

updateResource(string  $insightID, string  $data) : \CloudMunch\helper\json

Update a resource with provided data.

Parameters

string $insightID
string $data

Returns

\CloudMunch\helper\json —

object of resource details

createInsightDataStoreExtract()

createInsightDataStoreExtract(string  $insightID, string  $dataStoreID, string  $extractName, array  $data = array()) : string

Create an extract if it does not exist.

Parameters

string $insightID
string $dataStoreID
string $extractName
array $data

Returns

string —

extract id

createInsightDataStore()

createInsightDataStore(string  $insightID, string  $dataStoretName) : string

Create a datastore if it does not exist.

Parameters

string $insightID
string $dataStoretName

Returns

string —

dataStore id

createInsightReportCard()

createInsightReportCard(string  $insightID, string  $reportID, string  $cardName) : string

Create a report card if it does not exist.

Parameters

string $insightID
string $reportID
string $cardName

Returns

string —

report card id

createInsightReport()

createInsightReport(string  $insightID, string  $reportName) : string

Create a report if it does not exist.

Parameters

string $insightID
string $reportName

Returns

string —

report id

createResource()

createResource(string  $resourceName, string  $type, array  $data = null) : boolean

Create a resource.

Parameters

string $resourceName
string $type
array $data

Returns

boolean

sprint_getDateRangeForAllSprints()

sprint_getDateRangeForAllSprints() : \CloudMunch\helper\dateRangeForSprints

Get range of sprints available from jira resource.

Returns

\CloudMunch\helper\dateRangeForSprints —

range of sprint dates

sprint_getSprintsWithDates()

sprint_getSprintsWithDates(  $sprintDetailsArray) : \CloudMunch\helper\dateRangeForSprints

Construct an array for sprints with dates.

Parameters

$sprintDetailsArray

Returns

\CloudMunch\helper\dateRangeForSprints —

range of sprint dates

sprint_giveAFilterStringForASprint()

sprint_giveAFilterStringForASprint(  $sprintHash,   $sprintID) : String

Get filter string with list of dates for a sprint.

Parameters

$sprintHash
$sprintID

Returns

String —

range of sprint dates

sprint_giveADateRangeOfASprint()

sprint_giveADateRangeOfASprint(  $sprintHash,   $sprintID) : Array

Get range of dates for a sprint.

Parameters

$sprintHash
$sprintID

Returns

Array —

range of sprint dates

sprint_getSprintDetailsFromJiraCMDB()

sprint_getSprintDetailsFromJiraCMDB() : \CloudMunch\helper\raw

Get sprint details from jira sotred in CMDB.

Returns

\CloudMunch\helper\raw —

data from jira extracts

sprint_getJiraSprintsData()

sprint_getJiraSprintsData(  $insightOrResourceID,   $dataStoreName,   $extractName) : array

Get extracts from provided resource.

Parameters

$insightOrResourceID
$dataStoreName
$extractName

Returns

array —

extracts from jira

sprint_getJiraProjectNameFromResource()

sprint_getJiraProjectNameFromResource(  $jiraResourceType) : array

Get extracts from provided resource.

Parameters

$jiraResourceType

Returns

array —

extract details from jira

identifyDatesForDurationUnit()

identifyDatesForDurationUnit(String  $projectionUnit,   $projectionCount,   $curr_date = null,   $newStructure = true) : array

Return the dates range based on the projection unit and count.

*

Parameters

String $projectionUnit

: Projection Unit in Days, Months or Weeks

$projectionCount
$curr_date
$newStructure

Returns

array —

of dates

getExtractData()

getExtractData(string  $resourceID, array  $dataStoreName, array  $filterFields = "name,result", string  $projectionUnit = "day", string  $timeArray = null) : array

Pull data from cloudmunch data base

Parameters

string $resourceID

id of resource

array $dataStoreName

data store name from which data needs to be pulled

array $filterFields

comma seperated string fields to pass as filter in request

string $projectionUnit

one of the following day,week,month,sprint

string $timeArray

range of dates which will passed as filter

Returns

array —

data data recieved from data base

createLineGraph()

createLineGraph(  $resourceID,   $dataFromCMDB,   $reportName,   $cardTitle,   $source,   $description,   $group,   $graphLegendsList = null,   $xAxisLabel = "Date",   $yAxisLabel = "%",   $tolerance = null,   $url = "#") 

Create report of type lintrend or kanban.

Parameters

$resourceID
$dataFromCMDB
$reportName
$cardTitle
$source
$description
$group
$graphLegendsList
$xAxisLabel
$yAxisLabel
$tolerance
$url

createKanbanGraph()

createKanbanGraph(  $resourceID,   $dataFromCMDB,   $reportName,   $cardTitle,   $source,   $description,   $group,   $tolerance = null,   $url = "#") 

Create report of type lintrend or kanban.

Parameters

$resourceID
$dataFromCMDB
$reportName
$cardTitle
$source
$description
$group
$tolerance
$url

linegraph_constructViewcardVisualizationMeta()

linegraph_constructViewcardVisualizationMeta(  $graphLegendsList) : array

Contruct Viewcard visualization meta data.

Parameters

$graphLegendsList

Returns

array —

with visualization map

linegraph_constructViewcardMeta()

linegraph_constructViewcardMeta(  $cardTitle,   $source,   $description,   $group,   $xAxisLabel = "Date",   $yAxisLabel = "%",   $tolerance = null,   $url = "#") : array

Construct view card meta data.

Parameters

$cardTitle
$source
$description
$group
$xAxisLabel
$yAxisLabel
$tolerance
$url

Returns

array —

with Card meta data

kanban_constructViewcardMeta()

kanban_constructViewcardMeta(  $cardTitle,   $source,   $description,   $group,   $tolerance = null,   $url = "#") : array

Construct view card meta data

Parameters

$cardTitle
$source
$description
$group
$tolerance
$url

Returns

array —

with Card meta data

kanban_constructViewcardVisualizationMeta()

kanban_constructViewcardVisualizationMeta() : array

Contruct Viewcard visualization meta data

Returns

array —

with visualization map

updateExtract()

updateExtract(  $resourceID,   $data,   $dataStoreName,   $extractName = null,   $additionInfo = null) 

Store passed data in data store

Parameters

$resourceID
$data
$dataStoreName
$extractName
$additionInfo

createDoughnutGraph()

createDoughnutGraph(  $resourceID,   $data,   $reportName,   $cardLabel,   $sourceName,   $description,   $group,   $sourceURL,   $legendsList) 

Create report of type doughnut.

Parameters

$resourceID
$data
$reportName
$cardLabel
$sourceName
$description
$group
$sourceURL
$legendsList

addKeyMetric()

addKeyMetric(  $resourceID,   $reportID,   $metricId,   $name,   $value,   $valueType = null,   $source = null,   $sourceURL = null,   $subtext = '',   $color = "#009900") 

Adds key metrics data to report

Parameters

$resourceID
$reportID
$metricId
$name
$value
$valueType
$source
$sourceURL
$subtext
$color

checkToleranceForTrend()

checkToleranceForTrend(  $data,   $upperLimit,   $lowerLimit,   $resourceName = null,   $cardLabel = null,   $source = null) : array

Compare and set tolerance status based on percentage change in value of latest element with its previous element against provided upper and lower limit.

Status takes precedence in the following order, Failed > Warning > success

Parameters

$data
$upperLimit
$lowerLimit
$resourceName
$cardLabel
$source

Returns

array —

tolerance : toleranceState (success, failure, warning, critical) : toleranceDescription : toleranceHit