macfly/yii2-hpoo

此包已被弃用且不再维护。未建议替换包。

组件,用于启用对HPOO REST API的访问。

安装数: 2,359

依赖项: 0

建议者: 0

安全性: 0

星标: 0

关注者: 2

分支: 0

类型:yii2-extension

1.0.1 2018-10-24 08:54 UTC

This package is auto-updated.

Last update: 2023-04-13 03:41:03 UTC


README

此扩展允许在 HP-OO v10.x 上运行、获取状态和获取流程的输出。HP-OO代表操作编排,是由 HPE 开发的一款IT流程自动化和运行手册软件。在软件中开发的流程可以通过REST API触发。此扩展旨在帮助使用它。

要求

  • Hp-OO: >= 10.60
  • php: >=5.4
  • yii2: >=2.0.1
  • yiisoft/yii2-httpclient: >= 2.0.1

安装

只需下载即可

$ composer require macfly/yii2-hpoo "*"

或将

"macfly/yii2-hpoo: "*"

添加到composer.json文件的require部分。

配置应用程序

在扩展安装后,您需要设置应用程序组件

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.
		],
	]
	// ...
];

使用

在控制器或模型中访问hpoo

// 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']));