macfly / yii2-hpoo
Component to enalbe access to HPOO REST API.
Installs: 2 359
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Type:yii2-extension
Requires
- yiisoft/yii2: ~2.0.5
- yiisoft/yii2-httpclient: ~2.0.1
This package is auto-updated.
Last update: 2023-04-13 03:41:03 UTC
README
This extension allows to run, get status and get output of a flow on HP-OO v10.x. HP-OO stand for Operations Orchestration a product develop by HPE, it's an IT process automation and run book software. FLow develop in the soft can be trigger trough a REST API. This extension is here to help in using it.
Requires:
- Hp-OO: >= 10.60
- php: >=5.4
- yii2: >=2.0.1
- yiisoft/yii2-httpclient: >= 2.0.1
Installation
As simple as download it
$ composer require macfly/yii2-hpoo "*"
or add
"macfly/yii2-hpoo: "*"
to the require
section of your composer.json.
Configuring application
After extension is installed you need to setup application component:
return [ 'components' => [ 'hpoo' => [ 'class' => 'macfly\hpoo\components\HpooComponent', 'url' => 'https://127.0.0.1:8443/oo/rest/v2', // HP-OO central url 'login' => 'myaccount' // An account with the right to trigger a flow 'password' => 'mypass' // Password related to the account. 'timeout' => 5, // Conenction timeout (default: 5 seconds) 'sslVerifyPeer' => true, // Check ssl certificate (default: true) 'proxy' => 'tcp://ip:port/' // Proxy to use to access url (optional) // etc. ], ] // ... ];
Usage
Access to hpoo in your controller, or model:
// Flow UUID $uuid = '1793b153-0ada-451e-93cd-143c3509e8a4'; // FLOW input args if needed $args = [ 'input1' => 'myinopout', .... ]; // Running flow Sync (will give you the end when flow is finnished). $rp = Yii::$app->hpoo->flowRunSync($uuid, $args); print_r($rp); // Running flow Async (will return instantly and give you the flow executionid) $rp = Yii::$app->hpoo->flowRunAsync($uuid, $args); // Get a flow status print_r(Yii::$app->hpoo->flowRunAsync($rp['executionId'])); // Get a flow output print_r(Yii::$app->hpoo->flowLog($rp['executionId']));