-
Notifications
You must be signed in to change notification settings - Fork 37
Conversation
debugapi does not show up in help as it's for test/debug Signed-off-by: Nathaniel Clark <nclark@whamcloud.com>
|
Signed-off-by: Nathaniel Clark <nclark@whamcloud.com>
How is it better than curl? :)
|
API may be setup as read-only and certain verbs ( |
Signed-off-by: Nathaniel Clark <nclark@whamcloud.com>
Signed-off-by: Nathaniel Clark <nclark@whamcloud.com>
Signed-off-by: Nathaniel Clark <nclark@whamcloud.com>
POST tested and works |
Signed-off-by: Nathaniel Clark <nclark@whamcloud.com>
Signed-off-by: Nathaniel Clark <nclark@whamcloud.com>
Signed-off-by: Nathaniel Clark <nclark@whamcloud.com>
This rounds out the methods that reqwest supports normally. Signed-off-by: Nathaniel Clark <nclark@whamcloud.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.
Any HTTP request could technically carry a body. In addition, a non-GET response could also have a body (and I think some of our API does this).
It's probably best to separate the body addition and response parsing out of each individual Verb, and add the request body / attempt at response body parsing after the match.
For response body, we can check both the content-type header on the return and the content length to decide whether we should decode to JSON.
ApiMethod::Delete => client.delete(uri), | ||
ApiMethod::Get => client.get(uri), | ||
ApiMethod::Head => client.head(uri), | ||
ApiMethod::Patch => client.patch(uri), | ||
ApiMethod::Post => client.post(uri), | ||
ApiMethod::Put => client.put(uri), |
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.
Headers and bodies are not supported, is it intentional?
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.
Bodies are supported here: https://github.com/whamcloud/integrated-manager-for-lustre/pull/2132/files#diff-f33d40dcab0b4085abfc004fe3408e29R50-R54
Headers generally aren't needed (currently) when using the ```iml_manager_client``
debugapi
does not show up in help as it's for test/debugRelated #1832
Signed-off-by: Nathaniel Clark nclark@whamcloud.com
This change is