adobe / aio-cli-plugin-runtime

Adobe I/O Runtime plugin for the Adobe I/O CLI
https://www.adobe.io
Apache License 2.0
15 stars 31 forks source link

Added log forwarding management commands #246

Closed buskamuza closed 2 years ago

buskamuza commented 3 years ago

Description

Added runtime:namespace:log-forwarding commands for managing log forwarding settings for the namespace.

Related Issue

Motivation and Context

I/O Runtime is working on configurable Log Forwarding, which will allow a namespace to be configured to custom logs destination. Currently supported: Splunk, Azure Log Analytics. This PR allows logging configuration to be managed via aio CLI.

How Has This Been Tested?

Auto tests are included. Also, validated manually on existing I/O Runtime environment with my namespaces.

Screenshots (if appropriate):

N/A

Types of changes

Checklist:

meryllblanchet commented 3 years ago

@Himavanth could you please review @buskamuza's PR ?

codecov[bot] commented 2 years ago

Codecov Report

Merging #246 (ccd0dfe) into master (b6cf531) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #246   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           58        64    +6     
  Lines         1568      1648   +80     
  Branches       311       312    +1     
=========================================
+ Hits          1568      1648   +80     
Impacted Files Coverage Δ
...c/commands/runtime/namespace/log-forwarding/get.js 100.00% <100.00%> (ø)
...commands/runtime/namespace/log-forwarding/index.js 100.00% <100.00%> (ø)
...c/commands/runtime/namespace/log-forwarding/set.js 100.00% <100.00%> (ø)
...e/namespace/log-forwarding/set/adobe-io-runtime.js 100.00% <100.00%> (ø)
...amespace/log-forwarding/set/azure-log-analytics.js 100.00% <100.00%> (ø)
...runtime/namespace/log-forwarding/set/splunk-hec.js 100.00% <100.00%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b6cf531...ccd0dfe. Read the comment docs.

buskamuza commented 2 years ago

Currently aio rt namespace log-forwarding --help do not display the proper help with the relevant options (get and set). We can add index.js file under log-forwarding folder to get the proper help.

Updated

buskamuza commented 2 years ago

The api does not work with _ in place of namespace in the URL. We might need to handle this and throw an error before calling the API.

Need to confirm whether the API should support _ and will update the CLI accordingly.

buskamuza commented 2 years ago

Agreed to prohibit usage of _ namespace in CLI.

rabbah commented 2 years ago

Neat 👍

Himavanth commented 2 years ago

Thanks for this contribution @buskamuza . Merging.