From 8b23fad27261fc22092c860329c8efbaf85b392c Mon Sep 17 00:00:00 2001 From: ayeleta Date: Tue, 1 Mar 2016 16:46:56 -0800 Subject: [PATCH] aaadssadsad --- src/sampleShelldriver.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/sampleShelldriver.py b/src/sampleShelldriver.py index 63fbb21..55ecef3 100644 --- a/src/sampleShelldriver.py +++ b/src/sampleShelldriver.py @@ -41,3 +41,26 @@ def example_command_with_cancellation(self, context, cancellation_token, user_pa # private functions are always hidden def _helper_method(self,title): return "---====%s====---" % title + + def get_inventory(self, context): + """ + :type context: cloudshell.shell.core.driver_context.AutoLoadCommandContext + """ + # example autoload return results + resources = [AutoLoadResource('Generic Chassis', 'Chassis 1', '1'), + AutoLoadResource('Generic Module', 'Module 1', '1/1'), + AutoLoadResource('Generic Port', 'Port 1', '1/1/1')] + + attributes = [ + AutoLoadAttribute('', 'Location', 'Santa Clara Lab'), + AutoLoadAttribute('', 'Model', 'Catalyst 3850'), + AutoLoadAttribute('', 'Vendor', 'Cisco'), + AutoLoadAttribute('1', 'Serial Number', 'JAE053002JD'), + AutoLoadAttribute('1', 'Model', 'WS-X4232-GB-RJ'), + AutoLoadAttribute('1/1', 'Model', 'WS-X4233-GB-EJ'), + AutoLoadAttribute('1/1', 'Serial Number', 'RVE056702UD'), + AutoLoadAttribute('1/1/1', 'IPv4 Address', '192.168.10.7') + ] + + result = AutoLoadDetails(resources, attributes) + return result