diff --git a/src/spaceone/plugin/api/v1/plugin.py b/src/spaceone/plugin/api/v1/plugin.py index 7b3ae90..67f9d5d 100644 --- a/src/spaceone/plugin/api/v1/plugin.py +++ b/src/spaceone/plugin/api/v1/plugin.py @@ -24,6 +24,21 @@ def get_plugin_endpoint(self, request, context): endpoint = plugin_svc.get_plugin_endpoint(params) return self.locator.get_info('PluginEndpoint', endpoint) + def get_plugin_metadata(self, request, context): + """Get Plugin Metadata. + + Returns: + metadata(dict) + + Raises: + ERROR_NOT_FOUND: + """ + params, metadata = self.parse_request(request, context) + + with self.locator.get_service('PluginService', metadata) as plugin_svc: + metadata = plugin_svc.get_plugin_metadata(params) + return self.locator.get_info('PluginMetadata', metadata) + def notify_failure(self, request, context): params, metadata = self.parse_request(request, context) diff --git a/src/spaceone/plugin/info/plugin_info.py b/src/spaceone/plugin/info/plugin_info.py index 4131e38..c054250 100644 --- a/src/spaceone/plugin/info/plugin_info.py +++ b/src/spaceone/plugin/info/plugin_info.py @@ -46,3 +46,7 @@ def PluginsInfo(plugin_vo: InstalledPluginRef, total_count): def PluginEndpoint(endpoint): return plugin_pb2.PluginEndpoint(**endpoint) + + +def PluginMetadata(metadata): + return plugin_pb2.PluginMetadata(**metadata)