rockaut / dynatrace-config

Currently it's just an idea and a place to chat it out
Apache License 2.0
2 stars 0 forks source link

WIP: implement some standards #19

Closed rockaut closed 4 years ago

rockaut commented 4 years ago

fixes #9 fixes #12

rockaut commented 4 years ago

Have to write doc/readme - basic changes:

With Cobra/Viper we have global and local cli flags. Global are for the main program and local for the defined commands like get. Sub-Commands might derive args/flags from parent-commands.

Example:

dynatrace-config -t APITOKEN -u APIURL get -f file/to/json

Also we have now config and environment variables support:

DC_APIURL="https://url.todynatrace.dev/e/xx-xx-xx/api"
DC_APITOKEN="asdf"

Where the DC_ prefix can be changed through an config file. Currently this file is loaded from

The filename has to be .dynatrace-config.yaml

apiurl: "https://url.todynatrace.dev/e/xx-xx-xx/api"
apitoken: "lksajdf"
envVarsPrefix: "WHATEVER_"
rockaut commented 4 years ago

Conflict is on adding config/ to uri. If you agree with that issue #18 we can overwrite and change the other files too. If not I will reverse the conflict.

rockaut commented 4 years ago

After merge I have already some subsequent issues prepared but I think we should first merge that to get the base started.