Groovy API reference

Report

4 minute readReference

createReport

Create a new report.

Arguments

Argument NameTypeDescription

projectName

String

The name for the project that must be unique among all projects. (Required)

reportName

String

The name of the report. (Required)

definition

String

The Elasticsearch query definition to use for retrieving report data.

description

String

Comment text describing this object that is not interpreted at all by CloudBees CD/RO.

parameters

String

Input parameters in JSON format accepted by the report definition.

reportObjectTypeForSourceType

String

The report object type name to use to determine the source type for the report. Set this if the sourceType of the report’s reportObjectType is different from the actual source of the report data.

reportObjectTypeName

String

Report object type name

reportQuery

String

The report query in JSON format. It will be translated to the Elasticsearch query definition when retrieving report data.

title

String

The title of report.

uri

String

An advanced mode option for identifying the Elasticsearch URI to use for retrieving report data. By default, the reportObjectTypeName argument will be used to construct the URI based on the Elasticsearch index for the report object, e.g., 'ef-deployment-*/_search?pretty'.

Usage

import com.electriccloud.client.groovy.ElectricFlow
import com.electriccloud.client.groovy.models.*


ElectricFlow ef = new ElectricFlow()

def result = ef.createReport(
                projectName: 'test-projectName',
                reportName: 'test-reportName'
                /* optional arguments */)

deleteReport

Delete a report.

Arguments

Argument NameTypeDescription

projectName

String

The name for the project that must be unique among all projects. (Required)

reportName

String

The name of the report. (Required)

Usage

import com.electriccloud.client.groovy.ElectricFlow
import com.electriccloud.client.groovy.models.*


ElectricFlow ef = new ElectricFlow()

def result = ef.deleteReport(
                projectName: 'test-projectName',
                reportName: 'test-reportName')

getReport

Retrieve a report by name.

Arguments

Argument NameTypeDescription

projectName

String

The name for the project that must be unique among all projects. (Required)

reportName

String

The name of the report. (Required)

Usage

import com.electriccloud.client.groovy.ElectricFlow
import com.electriccloud.client.groovy.models.*


ElectricFlow ef = new ElectricFlow()

def result = ef.getReport(
                projectName: 'test-projectName',
                reportName: 'test-reportName')

getReports

Retrieve all reports in a project.

Arguments

Argument NameTypeDescription

projectName

String

The name for the project that must be unique among all projects. (Required)

Usage

import com.electriccloud.client.groovy.ElectricFlow
import com.electriccloud.client.groovy.models.*


ElectricFlow ef = new ElectricFlow()

def result = ef.getReports(
                projectName: 'test-projectName')

modifyReport

Modify a report.

Arguments

Argument NameTypeDescription

projectName

String

The name for the project that must be unique among all projects. (Required)

reportName

String

The name of the report. (Required)

definition

String

The Elasticsearch query definition to use for retrieving report data.

description

String

Comment text describing this object that is not interpreted at all by CloudBees CD/RO.

newName

String

New name for an existing object that is being renamed.

parameters

String

Input parameters in JSON format accepted by the report definition.

reportObjectTypeForSourceType

String

The report object type name to use to determine the source type for the report. Set this if the sourceType of the report’s reportObjectType is different from the actual source of the report data.

reportObjectTypeName

String

Report object type name

reportQuery

String

The report query in JSON format. It will be translated to the Elasticsearch query definition when retrieving report data.

title

String

The title of report.

uri

String

An advanced mode option for identifying the Elasticsearch URI to use for retrieving report data. By default, the reportObjectTypeName argument will be used to construct the URI based on the Elasticsearch index for the report object, e.g., 'ef-deployment-*/_search?pretty'.

Usage

import com.electriccloud.client.groovy.ElectricFlow
import com.electriccloud.client.groovy.models.*


ElectricFlow ef = new ElectricFlow()

def result = ef.modifyReport(
                projectName: 'test-projectName',
                reportName: 'test-reportName'
                /* optional arguments */)

runLicenseReport

Run licenseReport to get license usage analytics data.

Arguments

Argument NameTypeDescription

instances

String array

Instance identifiers.

Usage

import com.electriccloud.client.groovy.ElectricFlow
import com.electriccloud.client.groovy.models.*


ElectricFlow ef = new ElectricFlow()

def result = ef.runLicenseReport(
                /* optional arguments */)

runReport

Retrieve data for the requested report from the reporting system.

Arguments

Argument NameTypeDescription

projectName

String

The name for the project that must be unique among all projects. (Required)

reportName

String

The name of the report. (Required)

actualParameters

Parameters passed as arguments to the report.

dashboardName

String

The name of the dashboard that the widget using the report belongs to.

dashboardProjectName

String

Set if the dashboard is in a different project than the report.

definition

String

The Elasticsearch query definition to use for retrieving report data.

filters

Filter array

Filters

previewMode

Boolean

Whether the report should be run in preview mode returning a small result sample.

reportObjectTypeName

String

Report object type name

reportQuery

String

The report query in JSON format. It will be translated to the Elasticsearch query definition when retrieving report data.

uri

String

An advanced mode option for identifying the Elasticsearch URI to use for retrieving report data. By default, the reportObjectTypeName argument will be used to construct the URI based on the Elasticsearch index for the report object, e.g., 'ef-deployment-*/_search?pretty'.

widgetName

String

The name of the widget using the report.

Usage

import com.electriccloud.client.groovy.ElectricFlow
import com.electriccloud.client.groovy.models.*


ElectricFlow ef = new ElectricFlow()

def result = ef.runReport(
                projectName: 'test-projectName',
                reportName: 'test-reportName'
                /* optional arguments */)

runUserReport

Run userReport to retrieve users activity data.

Arguments

Argument NameTypeDescription

actualParameters

Parameters passed as arguments to the report.

beginDate

String

Start date

endDate

String

End date

filters

Filter array

Filters

format

String

Response format.

instances

String array

Instance identifiers.

status

String

User verification status

tool

String

Tool type.

Usage

import com.electriccloud.client.groovy.ElectricFlow
import com.electriccloud.client.groovy.models.*


ElectricFlow ef = new ElectricFlow()

def result = ef.runUserReport(
                /* optional arguments */)

sendReportingData

Send data to the DevOps Insight server.

Arguments

Argument NameTypeDescription

payload

String

The payload with the attribute values for the report object in JSON text format. (Required)

reportObjectTypeName

String

The name of the report object for which the data(payload) is being sent to the DevOps Insight server. (Required)

validate

Boolean

Whether to validate the fields in the payload based on the attributes defined for the report object type.

Usage

import com.electriccloud.client.groovy.ElectricFlow
import com.electriccloud.client.groovy.models.*


ElectricFlow ef = new ElectricFlow()

def result = ef.sendReportingData(
                payload: 'test-payload',
                reportObjectTypeName: 'test-reportObjectTypeName'
                /* optional arguments */)