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

Add debugql subcommand to manager #2209

Merged
merged 1 commit into from
Sep 16, 2020
Merged

Add debugql subcommand to manager #2209

merged 1 commit into from
Sep 16, 2020

Conversation

utopiabound
Copy link
Contributor

@utopiabound utopiabound commented Sep 2, 2020

The -r option will result in iml debugapi -r POST graphql DATA
talking to /graphql instead of /api/graphql/

Signed-off-by: Nathaniel Clark nclark@whamcloud.com


This change is Reviewable

@utopiabound utopiabound requested review from jgrund and a team September 2, 2020 18:31
@utopiabound utopiabound self-assigned this Sep 2, 2020
@jgrund
Copy link
Member

jgrund commented Sep 2, 2020

Given graphql is much more restricted in the HTTP verb sense (only GET and POST and we could probably just restrict to POST for this purpose) I wonder if it would instead make sense to expose two separate commands:

debugapi for interfacing with REST API, debuggraphql to interface with graphql.

In lieu of that perhaps change the arg to -n / --no-path-prefix or something similar.

johnsonw
johnsonw previously approved these changes Sep 3, 2020
ip1981
ip1981 previously approved these changes Sep 8, 2020
iml-manager-client/src/lib.rs Show resolved Hide resolved
Signed-off-by: Nathaniel Clark <nclark@whamcloud.com>
@utopiabound utopiabound dismissed stale reviews from ip1981 and johnsonw via 6bd1f87 September 15, 2020 13:27
@utopiabound utopiabound changed the title Add -r for RAW debugapi Add debugql subcommand to manager Sep 15, 2020
@utopiabound
Copy link
Contributor Author

# iml debugql POST '{ getFsClusterHosts(fsName:"fs10") }'|json_reformat 
{
    "data": {
        "getFsClusterHosts": [
            [
                2,
                1
            ],
            [
                4,
                3
            ]
        ]
    }
}

@ip1981
Copy link
Member

ip1981 commented Sep 15, 2020

Maybe you could omit POST at all for GraphQL.

@jgrund jgrund merged commit c394946 into master Sep 16, 2020
@jgrund jgrund deleted the debugapi-raw branch September 16, 2020 15:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants