Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Commit

Permalink
Merge pull request #34 from arbulu89/feature/environments-view
Browse files Browse the repository at this point in the history
New environments view
  • Loading branch information
stefanotorresi authored Apr 29, 2021
2 parents bf199ce + baf0133 commit 389ca17
Show file tree
Hide file tree
Showing 24 changed files with 934 additions and 71 deletions.
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,16 +193,17 @@ Notice that a new entry must exists for every node.
- `config-dir`: Consul agent configuration files directory. It must be the same used by the consul agent. The `trento` agent creates a new folder with the node name where the trento meta-data configuration file is stored (e.g. `consul.d/node1/trento-config.json`).
- `consul-template`: Template used to populate the trento meta-data configuration file (by default [meta-data file][./examples/trento-config.json] is used).

### Filtering the nodes in the wep app
### Grouping and filtering the nodes in the wep app

The web app provides the option to filter the systems using the previously commented reserved tags. To achieve this, the tags must be stored in the KV storage.
The app provides the option to see the environment composed by the nodes and filter the systems using the previously commented reserved tags. To achieve this, the tags must be stored in the KV storage.
Use the next path:
- `trento/filters/sap-environments`
- `trento/filters/sap-landscapes`
- `trento/filters/sap-systems`
- `trento/environments/$yourenv/`
- `trento/environments/$yourenv/landscapes/$yourland/`
- `trento/environments/$yourenv/landscapes/$yourland/sapsystems/$yoursapsy`

Each of them must have a json list format. As example: `["land1", "land2"]`.
These entries will be available in the filters on the `/environments` page.
Keep in mind that the created environments, landscapes and sap systems are directories themselves, and there can be multiple of them.
The possibility to have multiple landscapes with the same name in different environments (and the same for SAP systems) is possible.
Be aware that the nodes meta-data tags are not strictly linked to these names, they are soft relations (this means that only the string matches, there is no any real relationship between them).

# Development

Expand Down
1 change: 1 addition & 0 deletions internal/consul/consul.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type Catalog interface {
type KV interface {
Get(key string, q *consulApi.QueryOptions) (*consulApi.KVPair, *consulApi.QueryMeta, error)
List(prefix string, q *consulApi.QueryOptions) (consulApi.KVPairs, *consulApi.QueryMeta, error)
Keys(prefix, separator string, q *consulApi.QueryOptions) ([]string, *consulApi.QueryMeta, error)
}

type Health interface {
Expand Down
32 changes: 32 additions & 0 deletions internal/consul/mocks/KV.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions web/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ func NewAppWithDeps(host string, port int, deps Dependencies) (*App, error) {
engine.GET("/hosts/:name/checks/:checkid", NewCheckHandler(deps.consul))
engine.GET("/clusters", NewClustersListHandler(deps.consul))
engine.GET("/clusters/:name", NewClusterHandler(deps.consul))
engine.GET("/environments", NewEnvironmentsListHandler(deps.consul))
engine.GET("/environments/:env", NewEnvironmentListHandler(deps.consul))
engine.GET("/landscapes", NewLandscapesListHandler(deps.consul))
engine.GET("/landscapes/:land", NewLandscapeListHandler(deps.consul))
engine.GET("/sapsystems", NewSAPSystemsListHandler(deps.consul))
engine.GET("/sapsystems/:sys", NewSAPSystemHostsListHandler(deps.consul))

apiGroup := engine.Group("/api")
{
Expand Down
Loading

0 comments on commit 389ca17

Please sign in to comment.