diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..6fc93d8 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,13 @@ +[run] +omit = + *__init__* + */profiler/* + */tests/* + */remap_child_resources_constants.py + +[report] +omit = + *__init__* + */profiler/* + */tests/* + */remap_child_resources_constants.py diff --git a/Documentation/cloudshell-orch-sandbox deployment guide.docx b/Documentation/cloudshell-orch-sandbox deployment guide.docx new file mode 100644 index 0000000..25ff83d Binary files /dev/null and b/Documentation/cloudshell-orch-sandbox deployment guide.docx differ diff --git a/Documentation/get_version_example.py b/Documentation/get_version_example.py new file mode 100644 index 0000000..17cc232 --- /dev/null +++ b/Documentation/get_version_example.py @@ -0,0 +1,24 @@ +# This file demonstrates implementation of get_version for Ericsson's IPOS/SEOS devices. + +from cloudshell.helpers.scripts import cloudshell_scripts_helpers as helpers +from cloudshell.api.cloudshell_api import * +import re + + +def main(): + api_session = helpers.get_api_session() + resource_details = helpers.get_resource_context_details() + reservation_id = helpers.get_reservation_context_details().id + # Run custom command on the device requesting the version + command_inputs = [InputNameValue('custom_command', str('show version'))] + cmd_out = api_session.ExecuteCommand(reservation_id, resource_details.name, 'Resource', 'run_custom_command', + commandInputs=command_inputs).Output + # Clean unwanted text, leaving only the version itself + match = re.search('(Ericsson IPOS Version|SmartEdge OS Version).+',cmd_out) + version=match.group(0) + version = version.replace('Ericsson IPOS Version ','') + version = version.replace('SmartEdge OS Version ','') + print str(version) + + +main() \ No newline at end of file diff --git a/Documentation/gitlabrepo-import.xml b/Documentation/gitlabrepo-import.xml new file mode 100644 index 0000000..6d785bb --- /dev/null +++ b/Documentation/gitlabrepo-import.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Documentation/orch-sandboxDataModel.xml b/Documentation/orch-sandboxDataModel.xml new file mode 100644 index 0000000..3a936c3 --- /dev/null +++ b/Documentation/orch-sandboxDataModel.xml @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index f2b274a..09fdd07 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,37 @@ Package for sandbox orchestration script functions +## Overview +The orchestration package should bring an out-of-the-box solution for our customer’s common use cases: +- Setting up the sandbox upon reservation +- Tearing down a sandbox +- Save a snapshot of a sandbox + +### Setup +During the setup process the script will iterate over the resources and prepare them for the reservation. +- For each networking device: + - Perform health check (if exists) + - Load firmware (optional) + - Load configuration (optional) + - Re-run health check (if exists) +- VMs (when represented by Apps Deployment) + - Deploy apps + - Power on VM +- Activate all routes and connectors + +### Teardown +During the teardown process the script will wipe the configuration from the networking devices and delete VMs bringing them back into “ready for use” state. +- For each networking device: + - Perform health check (if exists) + - Load firmware (optional) + - Load configuration (optiona) + - Re-run health check (if exists) +- VMs + - Delete/Power off VM +- Disconnect routes and connectors + +### Snapshot +The user can save a snapshot of the sandbox. In the background, the script will save the sandbox as a new blueprint, and the current configuration of the devices and VMs will be saved for future use (reserving this saved blueprint will restore the configuration on the resources and the VM snapshots). +- Save the sandbox as a blueprint +- Save all the configuration files of the devices on the storage server (e.g. FTP server)