From a91b13e83234997b59ec62f88dd24be7fc2a1a65 Mon Sep 17 00:00:00 2001 From: Clay Date: Thu, 21 Jan 2021 14:08:41 -0500 Subject: [PATCH] S-74367 Add cli for getpluginschema --- bin/ctm-get-plugin-schema | 6 ++++++ ctmcommands/flow/getpluginschema.py | 25 +++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 bin/ctm-get-plugin-schema create mode 100644 ctmcommands/flow/getpluginschema.py diff --git a/bin/ctm-get-plugin-schema b/bin/ctm-get-plugin-schema new file mode 100644 index 0000000..cc303d7 --- /dev/null +++ b/bin/ctm-get-plugin-schema @@ -0,0 +1,6 @@ +#!/usr/bin/env python +import ctmcommands.flow.getpluginschema + +if __name__ == '__main__': + cmd = ctmcommands.flow.getpluginschema.GetPluginSchema() + cmd.main() diff --git a/ctmcommands/flow/getpluginschema.py b/ctmcommands/flow/getpluginschema.py new file mode 100644 index 0000000..f061d4c --- /dev/null +++ b/ctmcommands/flow/getpluginschema.py @@ -0,0 +1,25 @@ +######################################################################### +# +# Copyright 2021 Digital.Ai +# All Rights Reserved. +# https://www.digital.ai +# +######################################################################### +import ctmcommands.cmd +from ctmcommands.param import Param + + +class GetPluginSchema(ctmcommands.cmd.CSKCommand): + + Description = """Given a valid Plugin name, this API returns the Schema fpr that plugin.""" + API = 'get_plugin_schema' + Examples = ''' + ctm-get-plugin-schema -p "GitHub" +''' + Options = [Param(name='plugin_name', short_name='p', long_name='plugin_name', + optional=False, ptype='string', + doc='Name of the plugin to be returned'),] + + def main(self): + results = self.call_api(self.API, ['plugin_name']) + print(results)