Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple WF to start/stop existing instance on AWS #168

Merged
merged 7 commits into from
Jan 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<metadata>
<map>
<entry>
<key>DISPLAYNAME</key>
<value>Process_delete_service</value>
</entry>
<entry>
<key>DATE_MODIFICATION</key>
<value>1611137625684</value>
</entry>
<entry>
<key>REPOSITORY</key>
<value>Process</value>
</entry>
<entry>
<key>DATE_CREATION</key>
<value>1611137625679</value>
</entry>
<entry>
<key>TAG</key>
</entry>
<entry>
<key>TYPE</key>
<value>DIRECTORY</value>
</entry>
<entry>
<key>COMMENT</key>
</entry>
</map>
</metadata>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<metadata>
<map>
<entry>
<key>DISPLAYNAME</key>
<value>Process_onboard_instance</value>
</entry>
<entry>
<key>DATE_MODIFICATION</key>
<value>1611137408554</value>
</entry>
<entry>
<key>REPOSITORY</key>
<value>Process</value>
</entry>
<entry>
<key>DATE_CREATION</key>
<value>1611137408549</value>
</entry>
<entry>
<key>TAG</key>
</entry>
<entry>
<key>TYPE</key>
<value>DIRECTORY</value>
</entry>
<entry>
<key>COMMENT</key>
</entry>
</map>
</metadata>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<metadata>
<map>
<entry>
<key>DISPLAYNAME</key>
<value>Process_start_instance</value>
</entry>
<entry>
<key>DATE_MODIFICATION</key>
<value>1611137603614</value>
</entry>
<entry>
<key>REPOSITORY</key>
<value>Process</value>
</entry>
<entry>
<key>DATE_CREATION</key>
<value>1611137603607</value>
</entry>
<entry>
<key>TAG</key>
</entry>
<entry>
<key>TYPE</key>
<value>DIRECTORY</value>
</entry>
<entry>
<key>COMMENT</key>
</entry>
</map>
</metadata>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<metadata>
<map>
<entry>
<key>DISPLAYNAME</key>
<value>Process_stop_instance</value>
</entry>
<entry>
<key>DATE_MODIFICATION</key>
<value>1611137612427</value>
</entry>
<entry>
<key>REPOSITORY</key>
<value>Process</value>
</entry>
<entry>
<key>DATE_CREATION</key>
<value>1611137612422</value>
</entry>
<entry>
<key>TAG</key>
</entry>
<entry>
<key>TYPE</key>
<value>DIRECTORY</value>
</entry>
<entry>
<key>COMMENT</key>
</entry>
</map>
</metadata>
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<metadata>
<map>
<entry>
<key>DISPLAYNAME</key>
<value>simple_instance_management.xml</value>
</entry>
<entry>
<key>DATE_MODIFICATION</key>
<value>1611147160570</value>
</entry>
<entry>
<key>REPOSITORY</key>
<value>Process</value>
</entry>
<entry>
<key>DATE_CREATION</key>
<value>1611147160560</value>
</entry>
<entry>
<key>MODEL</key>
<value>0</value>
</entry>
<entry>
<key>TAG</key>
</entry>
<entry>
<key>FILE_TYPE</key>
<value>text</value>
</entry>
<entry>
<key>MANUFACTURER</key>
<value>0</value>
</entry>
<entry>
<key>TYPE</key>
<value>FILE</value>
</entry>
<entry>
<key>COMMENT</key>
</entry>
</map>
</metadata>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<metadata>
<map>
<entry>
<key>DISPLAYNAME</key>
<value>Tasks</value>
</entry>
<entry>
<key>DATE_MODIFICATION</key>
<value>1611137625718</value>
</entry>
<entry>
<key>REPOSITORY</key>
<value>Process</value>
</entry>
<entry>
<key>DATE_CREATION</key>
<value>1611137625713</value>
</entry>
<entry>
<key>TAG</key>
</entry>
<entry>
<key>TYPE</key>
<value>DIRECTORY</value>
</entry>
<entry>
<key>COMMENT</key>
</entry>
</map>
</metadata>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<metadata>
<map>
<entry>
<key>DISPLAYNAME</key>
<value>Tasks</value>
</entry>
<entry>
<key>DATE_MODIFICATION</key>
<value>1611137408620</value>
</entry>
<entry>
<key>REPOSITORY</key>
<value>Process</value>
</entry>
<entry>
<key>DATE_CREATION</key>
<value>1611137408615</value>
</entry>
<entry>
<key>TAG</key>
</entry>
<entry>
<key>TYPE</key>
<value>DIRECTORY</value>
</entry>
<entry>
<key>COMMENT</key>
</entry>
</map>
</metadata>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<metadata>
<map>
<entry>
<key>DISPLAYNAME</key>
<value>Task_onboard_instance.php</value>
</entry>
<entry>
<key>DATE_MODIFICATION</key>
<value>1611147052800</value>
</entry>
<entry>
<key>REPOSITORY</key>
<value>Process</value>
</entry>
<entry>
<key>DATE_CREATION</key>
<value>1611147052795</value>
</entry>
<entry>
<key>TAG</key>
</entry>
<entry>
<key>FILE_TYPE</key>
<value>text</value>
</entry>
<entry>
<key>TYPE</key>
<value>UPLOAD</value>
</entry>
<entry>
<key>COMMENT</key>
</entry>
</map>
</metadata>
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php

/**
* This file is necessary to include to use all the in-built libraries of /opt/fmc_repository/Reference/Common
*/
require_once '/opt/fmc_repository/Process/Reference/Common/common.php';

/**
* List all the parameters required by the task
*/
function list_args()
{
create_var_def('aws_device_id', 'Device');
create_var_def('instance_id', 'String');
}

check_mandatory_param('instance_id');
check_mandatory_param('aws_device_id');

$PROCESSINSTANCEID = $context['PROCESSINSTANCEID'];
$EXECNUMBER = $context['EXECNUMBER'];
$TASKID = $context['TASKID'];
$process_params = array('PROCESSINSTANCEID' => $PROCESSINSTANCEID,
'EXECNUMBER' => $EXECNUMBER,
'TASKID' => $TASKID);
$context['id_for_display'] = $context['SERVICEINSTANCEID']." - ".$context['instance_id'];

$device_id = substr($context['aws_device_id'], 3);

$response = synchronize_objects_and_verify_response($device_id);

$response = _device_read_by_id($device_id);
$response = json_decode($response, true);
if ($response['wo_status'] !== ENDED) {
$response = json_encode($response);
echo $response;
exit;
}
$key = $response['wo_newparams']['login'];
$context["key"] = $key;
$secret = $response['wo_newparams']['password'];
$context["secret"] = $secret;


$response = _device_get_hostname_by_id($device_id);
$response = json_decode($response, true);
if ($response['wo_status'] !== ENDED) {
$response = json_encode($response);
echo $response;
exit;
}

$region = $response['wo_newparams']['hostname'];
$context["region"] = $region;

$instance_id = $context['instance_id'];
task_success("$instance_id onboarded");
?>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<metadata>
<map>
<entry>
<key>DISPLAYNAME</key>
<value>Tasks</value>
</entry>
<entry>
<key>DATE_MODIFICATION</key>
<value>1611137603642</value>
</entry>
<entry>
<key>REPOSITORY</key>
<value>Process</value>
</entry>
<entry>
<key>DATE_CREATION</key>
<value>1611137603637</value>
</entry>
<entry>
<key>TAG</key>
</entry>
<entry>
<key>TYPE</key>
<value>DIRECTORY</value>
</entry>
<entry>
<key>COMMENT</key>
</entry>
</map>
</metadata>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<metadata>
<map>
<entry>
<key>DISPLAYNAME</key>
<value>Task_start_instance.php</value>
</entry>
<entry>
<key>DATE_MODIFICATION</key>
<value>1611138164970</value>
</entry>
<entry>
<key>REPOSITORY</key>
<value>Process</value>
</entry>
<entry>
<key>DATE_CREATION</key>
<value>1611137646127</value>
</entry>
<entry>
<key>TAG</key>
</entry>
<entry>
<key>FILE_TYPE</key>
<value>text</value>
</entry>
<entry>
<key>TYPE</key>
<value>UPLOAD</value>
</entry>
<entry>
<key>COMMENT</key>
</entry>
</map>
</metadata>
Loading