RESOURCES
RESOURCES
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.
getInsightDataStoreExtracts(string $insightID, string $dataStoreID, array $queryOptions, string $extractID = '') : \CloudMunch\helper\json
Get all extracts under provided resource and datastore.
| string | $insightID | |
| string | $dataStoreID | |
| array | $queryOptions | associative array with key as query key and query value as value |
| string | $extractID |
object of extract details
getInsightDataStores(string $insightID, array $queryOptions, string $dataStoreID = '') : \CloudMunch\helper\json
Get all datastores under provided resource.
| string | $insightID | |
| array | $queryOptions | associative array with key as query key and query value as value |
| string | $dataStoreID |
object of datastore details
getInsightReportCards(string $insightID, string $reportID, array $queryOptions, string $cardID = '') : \CloudMunch\helper\json
Get all report cards under provided resource and report.
| string | $insightID | |
| string | $reportID | |
| array | $queryOptions | associative array with key as query key and query value as value |
| string | $cardID |
object of report card details
getInsightReports(string $insightID, array $queryOptions, string $reportID = '') : \CloudMunch\helper\json
Get all reports under provided resource.
| string | $insightID | |
| array | $queryOptions | associative array with key as query key and query value as value |
| string | $reportID |
object of report details
updateInsightDataStoreExtract(string $insightID, string $dataStoreID, string $extractID, string $data) : \CloudMunch\helper\json
Update an extract with provided data.
| string | $insightID | |
| string | $dataStoreID | |
| string | $extractID | |
| string | $data |
object of extract details
updateInsightReportCard(string $insightID, string $reportID, string $cardID, string $data) : \CloudMunch\helper\json
Update a report card with provided data.
| string | $insightID | |
| string | $reportID | |
| string | $cardID | |
| string | $data |
object of extract details
createInsightDataStoreExtract(string $insightID, string $dataStoreID, string $extractName, array $data = array()) : string
Create an extract if it does not exist.
| string | $insightID | |
| string | $dataStoreID | |
| string | $extractName | |
| array | $data |
extract id
identifyDatesForDurationUnit(String $projectionUnit, $projectionCount, $curr_date = null, $newStructure = true) : array
Return the dates range based on the projection unit and count.
*
| String | $projectionUnit | : Projection Unit in Days, Months or Weeks |
| $projectionCount | ||
| $curr_date | ||
| $newStructure |
of dates
getExtractData(string $resourceID, array $dataStoreName, array $filterFields = "name,result", string $projectionUnit = "day", string $timeArray = null) : array
Pull data from cloudmunch data base
| 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 |
data data recieved from data base
createLineGraph( $resourceID, $dataFromCMDB, $reportName, $cardTitle, $source, $description, $group, $graphLegendsList = null, $xAxisLabel = "Date", $yAxisLabel = "%", $tolerance = null, $url = "#")
Create report of type lintrend or kanban.
| $resourceID | ||
| $dataFromCMDB | ||
| $reportName | ||
| $cardTitle | ||
| $source | ||
| $description | ||
| $group | ||
| $graphLegendsList | ||
| $xAxisLabel | ||
| $yAxisLabel | ||
| $tolerance | ||
| $url |
linegraph_constructViewcardMeta( $cardTitle, $source, $description, $group, $xAxisLabel = "Date", $yAxisLabel = "%", $tolerance = null, $url = "#") : array
Construct view card meta data.
| $cardTitle | ||
| $source | ||
| $description | ||
| $group | ||
| $xAxisLabel | ||
| $yAxisLabel | ||
| $tolerance | ||
| $url |
with Card meta data
addKeyMetric( $resourceID, $reportID, $metricId, $name, $value, $valueType = null, $source = null, $sourceURL = null, $subtext = '', $color = "#009900")
Adds key metrics data to report
| $resourceID | ||
| $reportID | ||
| $metricId | ||
| $name | ||
| $value | ||
| $valueType | ||
| $source | ||
| $sourceURL | ||
| $subtext | ||
| $color |
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
| $data | ||
| $upperLimit | ||
| $lowerLimit | ||
| $resourceName | ||
| $cardLabel | ||
| $source |
tolerance : toleranceState (success, failure, warning, critical) : toleranceDescription : toleranceHit