Skip to content

Commit

Permalink
Basic Working driver now
Browse files Browse the repository at this point in the history
All the commands are returning Mock output. But the driver is now tested
with CloudShell 7.1 build.
  • Loading branch information
gabhijit-izel committed Jul 10, 2016
1 parent 3edede9 commit 29e2646
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@

from cloudshell.api.cloudshell_api import InputName
from cloudshell.shell.core.resource_driver_interface import ResourceDriverInterface

from cloudshell.api.cloudshell_api import CloudShellAPISession
import jsonpickle

class DeployOSNovaImageInstance(ResourceDriverInterface):

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
<Command Description="" DisplayName="Deploy" Name="Deploy" Tags="allow_shared" />
</Category>
</Layout>
</Driver>
</Driver>
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
cloudshell-shell-core>=2.0.0,<2.1.0
jsonpickle
2 changes: 1 addition & 1 deletion drivers/install.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
python -m pip install qpm --no-cache-dir --upgrade
python -m qpm install --package_name aws_shell
python -m qpm install --package_name openstack_shell
14 changes: 12 additions & 2 deletions drivers/openstack_shell/src/driver.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from cloudshell.shell.core.resource_driver_interface import ResourceDriverInterface
import jsonpickle


class OpenStackShellDriver(ResourceDriverInterface):
Expand All @@ -19,8 +20,17 @@ def deploy_from_image(self, context, request):
"cloud_provider_resource_name" : "openstack"},
unpicklable=False))

def power_on(self, context, ports):
def PowerOn(self, context, ports):
return str(jsonpickle.encode(True, unpicklable=False))

def power_off(self, context, ports):
def PowerOff(self, context, ports):
return str(jsonpickle.encode(True, unpicklable=False))

def PowerCycle(self, context, ports, delay):
pass

def destroy_vm_only(self, context, ports):
return str(jsonpickle.encode(True, unpicklable=False))

def remote_refresh_ip(self, context, ports, cancellation_context):
pass
13 changes: 10 additions & 3 deletions drivers/openstack_shell/src/drivermetadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@
<Category Name="Deployment">
<Command Description="" DisplayName="Deploy From Image" Name="deploy_from_image" Tags="allow_unreserved" />
</Category>
<Category Name="Connectivity">
<Command Description="" DisplayName="Refresh IP" EnableCancellation="true" Name="remote_refresh_ip" Tags="remote_connectivity,allow_shared" />
</Category>
<Category Name="Hidden Commands">
<Command Description="" DisplayName="Power Cycle" Name="PowerCycle" Tags="power" />
<Command Description="" DisplayName="Delete VM Only" Name="destroy_vm_only" Tags="remote_app_management,allow_shared" />
</Category>
<Category Name="Power">
<Command Description="" DisplayName="Power On" Name="power_on" Tags="power" />
<Command Description="" DisplayName="Power Off" Name="power_on" Tags="power" />
<Command Description="" DisplayName="Power On" Name="PowerOn" Tags="power" />
<Command Description="" DisplayName="Power Off" Name="PowerOff" Tags="power" />
</Category>
</Layout>
</Driver>
</Driver>
1 change: 1 addition & 0 deletions drivers/openstack_shell/src/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
cloudshell-shell-core>=2.0.0,<2.1.0
jsonpickle
6 changes: 6 additions & 0 deletions drivers/openstack_shell_specs/aws_shell.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[Packaging]
is_driver: True
driver_folder: openstack_shell\src
include_dirs:
target_name: OpenStack Shell Driver
target_dir: Resource Drivers - Python
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[Packaging]
is_driver: True
driver_folder: deployment_drivers\openstack_nova_image_instance
include_dirs:
target_name: Deploy OpenStack Nova Image Instance
target_dir: Resource Drivers - Python
2 changes: 1 addition & 1 deletion drivers/pack.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@echo off
python -m pip install qpm --no-cache-dir --upgrade
python -m qpm pack --package_name aws_shell
python -m qpm pack --package_name openstack_shell

0 comments on commit 29e2646

Please sign in to comment.