forked from ManageIQ/manageiq-providers-vmware
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ManageIQ#244 from bzwei/v2v_init
Automation for transformation plan
- Loading branch information
Showing
25 changed files
with
421 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
...ageIQ/System/CommonMethods/StateMachineMethods.class/transformation_plan_vm_finished.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
object_type: instance | ||
version: 1.0 | ||
object: | ||
attributes: | ||
display_name: | ||
name: transformation_plan_vm_finished | ||
inherits: | ||
description: | ||
fields: | ||
- execute: | ||
value: task_finished(object => 'service_template_transformation_plan_task', | ||
message => 'VM Migrated Successfully' ) |
16 changes: 16 additions & 0 deletions
16
content/automate/ManageIQ/System/Notification/Email.class/transformationplancomplete.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
object_type: instance | ||
version: 1.0 | ||
object: | ||
attributes: | ||
display_name: | ||
name: TransformationPlanComplete | ||
inherits: | ||
description: | ||
fields: | ||
- owner: | ||
value: "${/#miq_request.requester}" | ||
- to: | ||
value: "${/#miq_request.get_option(:owner_email)} || ${/#miq_request.requester.email}" | ||
- sendmail: | ||
value: "#stop_email" |
22 changes: 22 additions & 0 deletions
22
...e/ManageIQ/System/Notification/Email.class/transformationplanrequestapproverapproved.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
object_type: instance | ||
version: 1.0 | ||
object: | ||
attributes: | ||
display_name: | ||
name: TransformationPlanRequestApproverApproved | ||
inherits: | ||
description: | ||
fields: | ||
- owner: | ||
value: "${/#miq_request.requester}" | ||
- to: | ||
value: "${/#miq_request.get_option(:owner_email)} || ${/#miq_request.requester.email}" | ||
- subject: | ||
value: Request ID ${/#miq_request.id} - Transformation Plan Request received | ||
from ${/#miq_request.requester.email} was Approved. | ||
- body: | ||
value: 'Approver,<br><br>Transformation Plan Request received from ${/#miq_request.requester.email} | ||
was Approved.<br><br>Approvers reason: ${/#miq_request.reason}<br><br>To view | ||
this Request go to: <a href=''http://${/#miq_server.ipaddress}:3000/miq_request/show/${/#miq_request.id}''>http://${/#miq_server.ipaddress}:3000/miq_request/show/${/#miq_request.id}</a><br><br> | ||
Thank you,<br> ${#signature}' |
22 changes: 22 additions & 0 deletions
22
...ate/ManageIQ/System/Notification/Email.class/transformationplanrequestapproverdenied.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
object_type: instance | ||
version: 1.0 | ||
object: | ||
attributes: | ||
display_name: | ||
name: TransformationPlanRequestApproverDenied | ||
inherits: | ||
description: | ||
fields: | ||
- owner: | ||
value: "${/#miq_request.requester}" | ||
- to: | ||
value: "${/#miq_request.get_option(:owner_email)} || ${/#miq_request.requester.email}" | ||
- subject: | ||
value: Request ID ${/#miq_request.id} - Transformation Plan Request from <${/#miq_request.requester.email}> | ||
was Denied. | ||
- body: | ||
value: 'Approver,<br><br>A Transformation Plan Request received from ${/#miq_request.requester.email} | ||
was Denied.<br><br>Approvers notes: ${/#miq_request.reason}<br><br>For more | ||
information you can go to: <a href=''http://${/#miq_server.ipaddress}:3000/miq_request/show/${/#miq_request.id}''>http://${/#miq_server.ipaddress}:3000/miq_request/show/${/#miq_request.id}</a><br><br> | ||
Thank you<br> ${#signature}' |
21 changes: 21 additions & 0 deletions
21
...te/ManageIQ/System/Notification/Email.class/transformationplanrequestapproverpending.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
object_type: instance | ||
version: 1.0 | ||
object: | ||
attributes: | ||
display_name: | ||
name: TransformationPlanRequestApproverPending | ||
inherits: | ||
description: | ||
fields: | ||
- owner: | ||
value: "${/#miq_request.requester}" | ||
- to: | ||
value: "${/#miq_request.get_option(:owner_email)} || ${/#miq_request.requester.email}" | ||
- subject: | ||
value: Request ID ${/#miq_request.id} - Transformation Plan Request from <${/#miq_request.requester.email}> | ||
is Pending Approval. | ||
- body: | ||
value: 'Approver,<br><br>A Transformation Plan Request received from ${/#miq_request.requester.email} | ||
is Pending.<br><br>For more information you can go to: <a href=''http://${/#miq_server.ipaddress}:3000/miq_request/show/${/#miq_request.id}''>http://${/#miq_server.ipaddress}:3000/miq_request/show/${/#miq_request.id}</a><br><br> | ||
Thank you<br> ${#signature}' |
24 changes: 24 additions & 0 deletions
24
.../ManageIQ/System/Notification/Email.class/transformationplanrequestrequesterapproved.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
object_type: instance | ||
version: 1.0 | ||
object: | ||
attributes: | ||
display_name: | ||
name: TransformationPlanRequestRequesterApproved | ||
inherits: | ||
description: | ||
fields: | ||
- owner: | ||
value: "${/#miq_request.requester}" | ||
- to: | ||
value: "${/#miq_request.get_option(:owner_email)} || ${/#miq_request.requester.email} | ||
\ " | ||
- subject: | ||
value: Request ID ${/#miq_request.id} - Your Transformation Plan Request was | ||
Approved, pending Quota Validation. | ||
- body: | ||
value: 'Hello,<br><br>Your Transformation Plan Request was Approved. If Service | ||
provisioning is successful you will be notified via email when the Service | ||
is available.<br><br>Approvers notes: ${/#miq_request.reason}<br><br>To view | ||
this Request go to: <a href=''https://${/#miq_server.ipaddress}:3000/miq_request/show/${/#miq_request.id}''>https://${/#miq_server.ipaddress}:3000/miq_request/show/${/#miq_request.id}</a><br><br> | ||
Thank you,<br> ${#signature}' |
22 changes: 22 additions & 0 deletions
22
...te/ManageIQ/System/Notification/Email.class/transformationplanrequestrequesterdenied.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
object_type: instance | ||
version: 1.0 | ||
object: | ||
attributes: | ||
display_name: | ||
name: TransformationPlanRequestRequesterDenied | ||
inherits: | ||
description: | ||
fields: | ||
- owner: | ||
value: "${/#miq_request.requester}" | ||
- to: | ||
value: "${/#miq_request.get_option(:owner_email)} || ${/#miq_request.requester.email} " | ||
- subject: | ||
value: Request ID ${/#miq_request.id} - Your Transformation Plan Request was | ||
Denied. | ||
- body: | ||
value: 'Hello,<br><br>Your Transformation Plan Request was Denied.<br><br>Approvers | ||
notes: ${/#miq_request.reason}<br><br>For more information you can go to: | ||
<a href=''http://${/#miq_server.ipaddress}:3000/miq_request/show/${/#miq_request.id}''>http://${/#miq_server.ipaddress}:3000/miq_request/show/${/#miq_request.id}</a><br><br> | ||
Thank you<br> ${#signature}' |
22 changes: 22 additions & 0 deletions
22
...e/ManageIQ/System/Notification/Email.class/transformationplanrequestrequesterpending.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
object_type: instance | ||
version: 1.0 | ||
object: | ||
attributes: | ||
display_name: | ||
name: TransformationPlanRequestRequesterPending | ||
inherits: | ||
description: | ||
fields: | ||
- owner: | ||
value: "${/#miq_request.requester}" | ||
- to: | ||
value: "${/#miq_request.get_option(:owner_email)} || ${/#miq_request.requester.email} " | ||
- subject: | ||
value: Request ID ${/#miq_request.id} - Your Transformation Plan Request is | ||
Pending Approval. | ||
- body: | ||
value: 'Hello,<br><br>Please review your Transformation Plan Request and wait | ||
for approval from an Administrator.<br><br>To view this Request go to: <a | ||
href=''http://${/#miq_server.ipaddress}:3000/miq_request/show/${/#miq_request.id}''>http://${/#miq_server.ipaddress}:3000/miq_request/show/${/#miq_request.id}</a><br><br> | ||
Thank you<br> ${#signature}' |
14 changes: 14 additions & 0 deletions
14
...omate/ManageIQ/System/Policy.class/servicetemplatetransformationplanrequest_approved.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
object_type: instance | ||
version: 1.0 | ||
object: | ||
attributes: | ||
display_name: | ||
name: ServiceTemplateTransformationPlanRequest_approved | ||
inherits: | ||
description: | ||
fields: | ||
- rel5: | ||
value: "/System/Notification/Email/TransformationPlanRequestRequesterApproved " | ||
- rel6: | ||
value: "/System/Notification/Email/TransformationPlanRequestApproverApproved " |
14 changes: 14 additions & 0 deletions
14
...tomate/ManageIQ/System/Policy.class/servicetemplatetransformationplanrequest_created.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
object_type: instance | ||
version: 1.0 | ||
object: | ||
attributes: | ||
display_name: | ||
name: ServiceTemplateTransformationPlanRequest_created | ||
inherits: | ||
description: | ||
fields: | ||
- guard: | ||
value: "${/#miq_request.process}" | ||
- rel6: | ||
value: "/Transformation/StateMachines/TransformationPlanRequestApproval/Default" |
14 changes: 14 additions & 0 deletions
14
...utomate/ManageIQ/System/Policy.class/servicetemplatetransformationplanrequest_denied.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
object_type: instance | ||
version: 1.0 | ||
object: | ||
attributes: | ||
display_name: | ||
name: ServiceTemplateTransformationPlanRequest_denied | ||
inherits: | ||
description: | ||
fields: | ||
- rel5: | ||
value: "/System/Notification/Email/TransformationPlanRequestRequesterDenied" | ||
- rel6: | ||
value: "/System/Notification/Email/TransformationPlanRequestApproverDenied" |
14 changes: 14 additions & 0 deletions
14
...tomate/ManageIQ/System/Policy.class/servicetemplatetransformationplanrequest_pending.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
object_type: instance | ||
version: 1.0 | ||
object: | ||
attributes: | ||
display_name: | ||
name: ServiceTemplateTransformationPlanRequest_pending | ||
inherits: | ||
description: | ||
fields: | ||
- rel5: | ||
value: "/System/Notification/Email/TransformationPlanRequestRequesterPending" | ||
- rel6: | ||
value: "/System/Notification/Email/TransformationPlanRequestApproverPending" |
10 changes: 10 additions & 0 deletions
10
...omate/ManageIQ/System/Policy.class/servicetemplatetransformationplanrequest_starting.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
object_type: instance | ||
version: 1.0 | ||
object: | ||
attributes: | ||
display_name: | ||
name: ServiceTemplateTransformationPlanRequest_starting | ||
inherits: | ||
description: | ||
fields: [] |
73 changes: 73 additions & 0 deletions
73
...ageIQ/Transformation/StateMachines/TransformationPlanRequestApproval.class/__class__.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
--- | ||
object_type: class | ||
version: 1.0 | ||
object: | ||
attributes: | ||
description: | ||
display_name: | ||
name: TransformationPlanRequestApproval | ||
type: | ||
inherits: | ||
visibility: | ||
owner: | ||
schema: | ||
- field: | ||
aetype: attribute | ||
name: approval_type | ||
display_name: | ||
datatype: string | ||
priority: 1 | ||
owner: | ||
default_value: auto | ||
substitute: true | ||
message: create | ||
visibility: | ||
collect: | ||
scope: | ||
description: | ||
condition: | ||
on_entry: | ||
on_exit: | ||
on_error: | ||
max_retries: | ||
max_time: | ||
- field: | ||
aetype: state | ||
name: ValidateRequest | ||
display_name: | ||
datatype: string | ||
priority: 2 | ||
owner: | ||
default_value: | ||
substitute: true | ||
message: create | ||
visibility: | ||
collect: | ||
scope: | ||
description: | ||
condition: | ||
on_entry: validate_request | ||
on_exit: | ||
on_error: pending_request | ||
max_retries: '100' | ||
max_time: | ||
- field: | ||
aetype: state | ||
name: ApproveRequest | ||
display_name: | ||
datatype: string | ||
priority: 3 | ||
owner: | ||
default_value: | ||
substitute: true | ||
message: create | ||
visibility: | ||
collect: | ||
scope: | ||
description: | ||
condition: | ||
on_entry: approve_request | ||
on_exit: | ||
on_error: pending_request | ||
max_retries: '100' | ||
max_time: |
14 changes: 14 additions & 0 deletions
14
...tion/StateMachines/TransformationPlanRequestApproval.class/__methods__/approve_request.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# | ||
# Description: This method is executed when the provisioning request is auto-approved | ||
# | ||
|
||
# Auto-Approve request | ||
$evm.log("info", "Checking for auto_approval") | ||
approval_type = $evm.object['approval_type'].downcase | ||
if approval_type == 'auto' | ||
$evm.log("info", "AUTO-APPROVING") | ||
$evm.root["miq_request"].approve("admin", "Auto-Approved") | ||
else | ||
$evm.log("info", "Not Auto-Approved") | ||
exit MIQ_ABORT | ||
end |
13 changes: 13 additions & 0 deletions
13
...on/StateMachines/TransformationPlanRequestApproval.class/__methods__/approve_request.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
object_type: method | ||
version: 1.0 | ||
object: | ||
attributes: | ||
name: approve_request | ||
display_name: | ||
description: | ||
scope: instance | ||
language: ruby | ||
location: inline | ||
options: {} | ||
inputs: [] |
10 changes: 10 additions & 0 deletions
10
...tion/StateMachines/TransformationPlanRequestApproval.class/__methods__/pending_request.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# | ||
# Description: This method is executed when the provisioning request is NOT auto-approved | ||
# | ||
|
||
# Get objects | ||
msg = $evm.object['reason'] | ||
$evm.log('info', msg.to_s) | ||
|
||
# Raise automation event: request_pending | ||
$evm.root["miq_request"].pending |
13 changes: 13 additions & 0 deletions
13
...on/StateMachines/TransformationPlanRequestApproval.class/__methods__/pending_request.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
object_type: method | ||
version: 1.0 | ||
object: | ||
attributes: | ||
name: pending_request | ||
display_name: | ||
description: | ||
scope: instance | ||
language: ruby | ||
location: inline | ||
options: {} | ||
inputs: [] |
5 changes: 5 additions & 0 deletions
5
...ion/StateMachines/TransformationPlanRequestApproval.class/__methods__/validate_request.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# | ||
# Description: Placeholder for service request validation | ||
# | ||
prov = $evm.root['miq_request'] | ||
prov.source_vms.each { |vm| prov.approve_vm(vm) if prov.validate_vm(vm) } |
13 changes: 13 additions & 0 deletions
13
...n/StateMachines/TransformationPlanRequestApproval.class/__methods__/validate_request.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
object_type: method | ||
version: 1.0 | ||
object: | ||
attributes: | ||
name: validate_request | ||
display_name: | ||
description: | ||
scope: instance | ||
language: ruby | ||
location: inline | ||
options: {} | ||
inputs: [] |
Oops, something went wrong.