-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add connection view implementation #10916
base: master
Are you sure you want to change the base?
Conversation
0a6a104
to
5be7b95
Compare
5be7b95
to
0810f62
Compare
if id != "" { | ||
connectionId, err := uuid.FromString(q.Get("id")) | ||
|
||
if err != nil { | ||
h.log.Error(ErrInvalidUUID(err)) | ||
http.Error(w, ErrGetConnections(err).Error(), http.StatusBadRequest) | ||
return | ||
} | ||
|
||
h.log.Debug("connection id : ", id) | ||
token, _ := req.Context().Value(models.TokenCtxKey).(string) | ||
connection, statusCode, err := provider.GetConnectionByID(token, connectionId) | ||
|
||
if err != nil { | ||
h.log.Error(ErrGetConnections(err)) | ||
http.Error(w, ErrGetConnections(err).Error(), statusCode) | ||
return | ||
} | ||
|
||
if err := json.NewEncoder(w).Encode(connection); err != nil { | ||
h.log.Error(models.ErrEncoding(err, "connection")) | ||
http.Error(w, models.ErrEncoding(err, "connection").Error(), http.StatusInternalServerError) | ||
return | ||
} | ||
|
||
} |
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.
Do we show error if user haven't provided connecction id, if yes what error we show?
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.
@Yashsharma1911 , I believe the arg length checks in list.do, delete.go and view.go are taking care of this already.
@lekaf974, pls confirm.
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.
@Yashsharma1911, sorry for delay so error is displayed on mesheryctl side only
On server side I just added id support but it is not required. If not provided it will display he list of available connections which is current behavior
There is a thread in slack related to this
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.
Please include the Meshery Docs update that accompanies this mesheryctl
change. See the contributing to Meshery CLI guide for specific details on Docs changes relevant to mesheryctl
specifically.
0810f62
to
3506d9f
Compare
@hexxdump look good? |
yes, looks good, just had some typos, pointed it out. |
40f1704
to
8a8248d
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #10916 +/- ##
==========================================
+ Coverage 9.00% 9.13% +0.12%
==========================================
Files 146 146
Lines 19274 19279 +5
==========================================
+ Hits 1736 1761 +25
+ Misses 17236 17216 -20
Partials 302 302
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Thank you, @hexxdump 👏 |
@Jougan-0 do you mind giving this a once-over? |
@MUzairS15 you were going to do changes in connection_handler replace |
Yes I will be and your PR is complete already from your side |
8a8248d
to
344ae54
Compare
Signed-off-by: mevrin <matthieu.evrin@gmail.com>
Signed-off-by: mevrin <matthieu.evrin@gmail.com>
Signed-off-by: mevrin <matthieu.evrin@gmail.com>
Signed-off-by: mevrin <matthieu.evrin@gmail.com>
Signed-off-by: mevrin <matthieu.evrin@gmail.com>
344ae54
to
91b8500
Compare
Notes for Reviewers
This PR fixes (#10582) replaced by #10965
Signed commits