Cumulocity CLI 2.41.0
What's Changed
New commands
Cloud Remote Access commands - #368
Add support for creating remote access configurations and connecting to passthrough connections via a local proxy.
This means go-c8y-cli is capable of replacing c8ylp as it provides the proxy functionality with zero dependencies on python!
A new Remote Access page has been added to go through all of the details on how to use the feature.
Below are some quick examples of some of the things you can now do with go-c8y-cli. See the new examples page for the full details.
Example: Connect to device via ssh client
See the examples for more details, but below shows a sample
# Create the passthrough configuration
c8y remoteaccess configurations create-passthrough --device device01 --name native-ssh --port 22
# Connect to the device (the configuration will be automatically selected)
c8y remoteaccess connect ssh --device device01 --user root
# Connect to the device and referencing the configuration via name (if the automatic selection does not work for some reason)
c8y remoteaccess connect ssh --device device01 --configuration native-ssh --user root
Example: Connect to web server on a device and open the page in your browser
# Create the passthrough configuration
c8y remoteaccess configurations create-passthrough --device device01 --name local-webapp1 --port 8080
# Start a local proxy and open up the endpoint in your web browser
c8y remoteaccess server --device device01 --configuration local-webapp1 --browser
🙏 The remote access docs may be a bit rough around the edges, so if you notice any mistakes please feel free to create a PR to address them, or at least raise a ticket so I can fix them. I could of waited for further review, however I didn't want the docs delaying the launch of this great new feature!
New features
Table view uses human friendly number format for very small/large numbers - #373
By default, the table view users a new number formatting mode, called metric
, to help display very small or very large numbers in a more human readable format. This makes numbers (e.g. floats and integers) more readable, and it makes more efficient usage of the table column width.
In addition to the new number format mode, numbers are now aligned to the right of the column (rather than left). This should also make the numbers more readable (at least via western conventions).
Example
Given the input data set:
file: large-num.jsonl
{"value":0.000000000001,"storageSize":0.000000000001}
{"value":0.000000001,"storageSize":0.000000001}
{"value":0.000001,"storageSize":0.000001}
{"value":10,"storageSize":10}
{"value":110,"storageSize":110}
{"value":3000,"storageSize":3000}
{"value":10000,"storageSize":10000}
{"value":50000,"storageSize":50000}
{"value":9999999,"storageSize":9999999}
{"value":123456789,"storageSize":123456789}
{"value":1234567.501202,"storageSize":1234567.501202}
{"value":2038373478888889,"storageSize":2038373478888889}
{"value":203837347888,"storageSize":203837347888}
When using the metric number mode in the table view, the above numbers will be displayed as follows:
% cat large-num.jsonl | c8y util show --select value
| value |
|------------|
| 1 p |
| 1 n |
| 1 µ |
| 10 |
| 110 |
| 3000 |
| 10000 |
| 50000 |
| 9.99 M |
| 123.45 M |
| 1.23 M |
| 2.03 P |
| 203.83 G |
Controlling the number format
You can turn off the default metric
number format mode by using the following setting:
# Use old number mode (e.g. no number formatting)
c8y settings update views.numberFormat none
# Use metric number mode
c8y settings update views.numberFormat metric
The metric mode can be controlled by the following settings:
# Change number of decimal places to use
c8y settings update views.metric.precision 3
# Change min-max range
# When a number is inside the range, the metric prefix will not be added
c8y settings update views.metric.rangeMin 0.00000001
c8y settings update views.metric.rangeMax 1000000
Minor features
-
feat(set-session): ignore extensions folder when scanning for available sessions by @reubenmiller in #366
-
feat(outputTemplate): support outputTemplate flags for non-request based commands by @reubenmiller in #369
-
feat(views): print file path to the matching view when using --debug by @reubenmiller in #370
Fixes
- fix(outputTemplate): unescape string output by @reubenmiller in #371
- fix(data): show error when --data mixes data types by @reubenmiller in #372
Full Changelog: v2.40.0...v2.41.0