Hp Logiciel HP Matrix Operating Environment Instrukcja Użytkownika Strona 232

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 240
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 231
$pVO : PolicyExecutionVO( );
$resLst : List();
/* --------------- CUSTOM LOGIC ------------------ */
// Get service entity and resource objects.
$logicalSubnet : LogicalSubnet();
$subnet : Subnet() from $resLst;
// call new user defined function with required arguments
// function has to return true in case of success or false
// in case of failure.
eval(customRule1($logicalSubnet, $subnet, $pVO));
/* --------------- CUSTOM LOGIC ------------------ */
then
/* --------------- CUSTOM LOGIC ------------------ */
// Since this is a custom rule/criteria construct HPIO message
// using ALLOCATION_CRITERIA_CUSTOM bundle key and providing
// allocation failure message (string) to be displayed. In case
// this rule fails. NOTE same information should be used while
// calling doesNotMatch in the custom function below.
$pVO.match($subnet, HPIOMessage.get(HPIOBundleKey.ALLOCATION_CRITERIA_CUSTOM, Failure message));
/* --------------- CUSTOM LOGIC ------------------ */
end
/*
* The function is responsible to do criteria check and return
* true/false based on the requested resource and the available
* resources.
* Initialize result map with doesNotMatch to start with, if this
* function returns success (true) then rule result map will be
* changed to match.
*
*/
function boolean customRule1(
LogicalSubnet logicalSubnet,
Subnet subnet,
PolicyExecutionVO pVO) {
// Custom message.
pVO.doesNotMatch(subnet, HPIOMessage.get(HPIOBundleKey.ALLOCATION_CRITERIA_CUSTOM, Failure message));
boolean match=true;
/* -------------- CUSTOM LOGIC ----------------------*/
/* -------------- CUSTOM LOGIC ----------------------*/
return match;
}
Déploiement de règles
1. Assurez-vous que le fichier de règles est valide (en utilisant l’outil iopolicyassist).
2. Copiez le fichier de règles validé dans le répertoire ..\Program Files\HP\Matrix
infrastructure orchestration\conf\policy.
3. Le cas échéant, mettez à jour les informations du point d’entrée <policy-rule-file> dans
le fichier policy.xml en modifiant ou en ajoutant le fichier de règles tout juste défini.
<policy enabled="false" name="SubnetPolicyCheck.applyFitting">
<policy-rule-file>
SubnetCheck.drl,
newrulefile.drl
</policy-rule-file>
<policy-class-name>policy-class-name</policy-class-name>
</policy>
4. Effectuez l’une des actions suivantes :
Pour activer une politique, modifiez l’indicateur enabled correspondant à la valeur true
dans le fichier de politiques.
Pour désactiver une politique, modifiez l’indicateur enabled correspondant à la valeur
false dans le fichier de politiques.
5. Redémarrez le service Windows de Infrastructure Orchestration pour que les modifications
soient prises en compte.
232 Processus d’allocation personnalisable
Przeglądanie stron 231

Komentarze do niniejszej Instrukcji

Brak uwag