-
Notifications
You must be signed in to change notification settings - Fork 674
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NOISSUE - Add new endpoint to retrieve configuration to be used as a template. #1242
Conversation
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
eb4fe91
to
8e1fb90
Compare
provision/service.go
Outdated
return "", errors.Wrap(ErrUnauthorized, err) | ||
} | ||
return ps.conf.Bootstrap.Content, nil | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rm this blank line
provision/api/logging.go
Outdated
defer func(begin time.Time) { | ||
message := fmt.Sprintf("Method mapping for token: %s took %s to complete", token, time.Since(begin)) | ||
if err != nil { | ||
lm.logger.Warn(fmt.Sprintf("%s with error: %s.", message, err)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove last .
provision/api/logging.go
Outdated
lm.logger.Warn(fmt.Sprintf("%s with error: %s.", message, err)) | ||
return | ||
} | ||
lm.logger.Info(fmt.Sprintf("%s without errors.", message)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
provision/swagger.yml
Outdated
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this blank lines?
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #1242 +/- ##
==========================================
- Coverage 68.03% 67.82% -0.21%
==========================================
Files 108 108
Lines 7136 7161 +25
==========================================
+ Hits 4855 4857 +2
- Misses 1850 1873 +23
Partials 431 431
Continue to review full report at Codecov.
|
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
provision/service.go
Outdated
@@ -81,6 +84,14 @@ func New(cfg Config, sdk SDK.SDK, logger logger.Logger) Service { | |||
} | |||
} | |||
|
|||
// Mapping retrieves current configuration | |||
func (ps *provisionService) Mapping(token string) (interface{}, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can at least return map[string]interface
instead of interface{}. It's of little use, but better than interface{}
.
Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
…template. (#1242) * add provision service Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix code style Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * fix test for provision Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * extra line Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com> * return map[string]interface instead of interface Signed-off-by: Mirko Teodorovic <mirko.teodorovic@gmail.com>
What does this do?
Adds new endpoint that will retrieve current provision template configuration as JSON.
It can be used in UI to populate configuration in a same way as
provision
service does