Skip to content

Commit

Permalink
Merge pull request #3 from chrlesur/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
chrlesur authored Oct 5, 2024
2 parents 726b68d + 240afe0 commit bd7228c
Show file tree
Hide file tree
Showing 22 changed files with 977 additions and 1,036 deletions.
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Fichiers générés par Go
*.exe~
*.dll
*.so
*.dylib

# Fichiers de test
*.test
/tests/

# Fichiers de couverture de code
*.out

# Dépendances
/vendor/

# Fichiers IDE
.idea/
.vscode/

# Fichiers système
.DS_Store
Thumbs.db
41 changes: 26 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ RTMS CLI is a command-line interface for interacting with the RTMS (Real-Time Mo

## Version

- 20240914 - 1.0.0 Beta Release
- 20240913 - 1.0.0 Beta Release
- 20240914 - 1.1.0 Beta Release - Enhanced catalogs and appliances management - Enhanced markdown output.
- 20241005 - 1.2.0 Beta Release - Support for more than 100 returns in a call; add --limit option to manage number of return. Support text, html, json and markdown as output format. Ajout d'un mode debug.

## Features

Expand Down Expand Up @@ -37,7 +38,7 @@ Before installing RTMS CLI, you need to have Go installed on your system. Here's
#### macOS

1. Use Homebrew (recommended):
```
```sh
brew install go
```
Or download the macOS installer from [the official Go website](https://golang.org/dl/).
Expand All @@ -47,22 +48,22 @@ Before installing RTMS CLI, you need to have Go installed on your system. Here's
#### Linux

1. Use your distribution's package manager:
For Ubuntu/Debian:
```
```sh
sudo apt-get update
sudo apt-get install golang
```
For Fedora:
```
```sh
sudo dnf install golang
```
Or download the tar.gz archive from [the official Go website](https://golang.org/dl/) and install it manually.
2. Configure your `GOPATH` by adding these lines to your `.bashrc` or `.zshrc` file:
```
```sh
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
```
Expand All @@ -72,17 +73,17 @@ Before installing RTMS CLI, you need to have Go installed on your system. Here's
Once Go is installed, you can install RTMS CLI by following these steps:
1. Clone the repository:
```
```sh
git clone https://github.com/chrlesur/rtmscli.git
```
2. Navigate to the project directory:
```
```sh
cd rtmscli
```
3. Compile and install the CLI:
```
```sh
go build
```
Expand All @@ -91,21 +92,21 @@ Once Go is installed, you can install RTMS CLI by following these steps:
Before using RTMS CLI, you need to configure your RTMS API key. Set the `RTMS_API_KEY` environment variable:
#### Windows
```
```sh
setx RTMS_API_KEY "your_api_key_here"
```
note : reload your shell after
#### macOS and Linux
```
```sh
echo 'export RTMS_API_KEY="your_api_key_here"' >> ~/.bashrc
source ~/.bashrc
```
## Important Note
The Cloud Temple ID (`-c` or `--cloud-temple-id`) is a required parameter for most commands. Make sure to include it in your commands, like this:
```
```sh
rtmscli [command] -c cloud_temple_id [other options]
```
Expand All @@ -115,7 +116,7 @@ This ID is specific to your Cloud Temple environment and is necessary for the CL
Here are some basic usage examples of RTMS CLI:
```
```sh
# Display version
rtmscli version
Expand All @@ -130,7 +131,7 @@ rtmscli -c cloud_temple_id -f html users list
```
For more information on available commands, use:
```
```sh
rtmscli --help
```
Expand All @@ -143,3 +144,13 @@ Contributions to this project are welcome. Please follow these steps to contribu
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request
## Licence
Ce projet est sous licence GNU General Public License v3.0.
## Auteur
Si vous avez des questions ou des suggestions, n'hésitez pas à ouvrir une issue sur GitHub ou à me contacter directement à [christophe.lesur@cloud-temple.com].

[https://github.com/chrlesur/rtmscli](https://github.com/chrlesur/rtmscli)
Binary file not shown.
21 changes: 14 additions & 7 deletions cmd/appliances.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ var getAppliancesCmd = &cobra.Command{
if err != nil {
return err
}
formattedOutput, err := formatOutput(response)
format, _ := cmd.Flags().GetString("format")
formattedOutput, err := formatOutput(response, format)
if err != nil {
return err
}
Expand All @@ -52,7 +53,8 @@ var getApplianceDetailsCmd = &cobra.Command{
if err != nil {
return err
}
formattedOutput, err := formatOutput(response)
format, _ := cmd.Flags().GetString("format")
formattedOutput, err := formatOutput(response, format)
if err != nil {
return err
}
Expand All @@ -70,7 +72,8 @@ var getApplianceServicesCmd = &cobra.Command{
if err != nil {
return err
}
formattedOutput, err := formatOutput(response)
format, _ := cmd.Flags().GetString("format")
formattedOutput, err := formatOutput(response, format)
if err != nil {
return err
}
Expand All @@ -88,7 +91,8 @@ var synchronizeApplianceCmd = &cobra.Command{
if err != nil {
return err
}
formattedOutput, err := formatOutput(response)
format, _ := cmd.Flags().GetString("format")
formattedOutput, err := formatOutput(response, format)
if err != nil {
return err
}
Expand All @@ -108,7 +112,8 @@ var getApplianceConfigurationCmd = &cobra.Command{
if err != nil {
return err
}
formattedOutput, err := formatOutput(response)
format, _ := cmd.Flags().GetString("format")
formattedOutput, err := formatOutput(response, format)
if err != nil {
return err
}
Expand All @@ -126,7 +131,8 @@ var getApplianceHealthCheckCmd = &cobra.Command{
if err != nil {
return err
}
formattedOutput, err := formatOutput(response)
format, _ := cmd.Flags().GetString("format")
formattedOutput, err := formatOutput(response, format)
if err != nil {
return err
}
Expand Down Expand Up @@ -154,7 +160,8 @@ var postApplianceHealthCheckCmd = &cobra.Command{
if err != nil {
return err
}
formattedOutput, err := formatOutput(response)
format, _ := cmd.Flags().GetString("format")
formattedOutput, err := formatOutput(response, format)
if err != nil {
return err
}
Expand Down
Loading

0 comments on commit bd7228c

Please sign in to comment.