Application environment inventory

2 minute readReference

The application environment inventory fetches details for all applications and their inventory across all mapped environments.

It returns a list of environment details based on the application. It starts with the data from the environment inventory items, and then based on the application and artifact information, combines all the environment details for the application. Filtering may be by applicationName, applicationProjectName, applicationType, environmentName, projectName from the environment, microserviceName, and componentName.

getApplicationEnvironmentInventory

Arguments Descriptions

filters

(Optional) A list of zero or more filter criteria definitions used to define objects to find.

Each element of the filter list is a hash reference containing one filter criterion. You can specify several filter criteria, in which case an object must meet all filter criteria to be included in the result. Refer to the code example below for instructions on forming the list and passing it to the CloudBees CD/RO Perl API.

The two types of filters are:

  • Property filters: Used to select objects based on the value of the object’s intrinsic or custom property.

  • Boolean filters ("and", "or", "not"): Used to combine one or more filters using Boolean logic.

Each property filter consists of a property name to test and an operator to use for comparison. The property can be either an intrinsic property defined by CloudBees CD/RO or a custom property added by the user. Each operator takes zero, one, or two operands to compare against the desired property.

Property filter operators are:

between (2 operands) contains (1)equals (1)greaterOrEqual (1)greaterThan (1)in (1)lessOrEqual (1)lessThan (1)like (1)notEqual (1)notLike (1)isNotNull (0)isNull (0)

A Boolean filter is a Boolean operator and an array of one or more filters that are operands. Each operand can be either a property filter or a Boolean filter.

Boolean operators are:

not (1 operand) and (2 or more operands) or (2 or more operands)

Argument type: Collection

firstResult

(Optional) The first result to be retrieved, starting from 0 (zero).

Argument type: Integer

numObjects

(Optional) <full object count> Specifies the number of full objects, and not only the IDs, returned from the findObjects request. This option allows selecting a limited number of full objects to be returned in the initial request. The returned "full objects" correspond to the objects from the beginning of the list of object IDs. If numObjects is not specified, all full objects in the list of object IDs are returned. Any and all objects can be retrieved using the getObjects command.

Argument type: Integer

Positional arguments

None.

Response

Returns a list of applications, its artifacts, and the environments where they are installed.

ec-perl

syntax: $cmdr→getApplicationEnvironmentInventory ({<optionals>});

Example

my @filterList; push (@filterList, {"propertyName" => "applicationName", "operator" => "equals", "operand1" => "Demo Application"}); push (@filterList, {"propertyName" => "projectName", "operator" => "equals", "operand1" => "Default"}); my $result = $cmdr->getApplicationEnvironmentInventory ( {filter => [ { operator => 'and', filter => @filterList, } ]} ); print "result = " . $result->findnodes_as_string("/"). "\n";

ectool

syntax examples: ectool getApplicationEnvironmentInventory [optionals]

Example

ectool getApplicationEnvironmentInventory