[GitHub] [skywalking-cli] kezhenxu94 commented on issue #6: [Feature] Set GraphQL client and add service ls command
kezhenxu94 commented on issue #6: [Feature] Set GraphQL client and add service ls command URL: https://github.com/apache/skywalking-cli/pull/6#issuecomment-551035397 @heyanlong I did some refactoring, please review, thanks This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [skywalking-cli] kezhenxu94 commented on issue #6: [Feature] Set GraphQL client and add service ls command
kezhenxu94 commented on issue #6: [Feature] Set GraphQL client and add service ls command URL: https://github.com/apache/skywalking-cli/pull/6#issuecomment-551044006 work like this ```shell skywalking-cli $ ./bin/swctl --config=/Users/kezhenxu/settings.yml service ls [{"id":"4","name":"projectA"},{"id":"2","name":"projectB"},{"id":"5","name":"projectD"},{"id":"3","name":"projectC"}] skywalking-cli $ ./bin/swctl --config=/Users/kezhenxu/settings.yml --debug service ls DEBU[2019-11-07 19:38:43] Debug mode is enabled DEBU[2019-11-07 19:38:43] Using configuration file: /Users/kezhenxu/settings.yml DEBU[2019-11-07 19:38:43] Configurations: {"Global":{"BaseUrl":"http://122.112.182.72:8080/graphql"}} DEBU[2019-11-07 19:38:43] Missing --end, defaults to 2019-11-07 1938 DEBU[2019-11-07 19:38:43] Missing --start, defaults to 2019-11-07 1923 DEBU[2019-11-07 19:38:43] >> variables: map[duration:{2019-11-07 1923 2019-11-07 1938 MINUTE}] DEBU[2019-11-07 19:38:43] >> query: query ($duration: Duration!) { services: getAllServices(duration: $duration) { id name } } DEBU[2019-11-07 19:38:43] >> headers: map[Accept:[application/json; charset=utf-8] Content-Type:[application/json; charset=utf-8]] DEBU[2019-11-07 19:38:43] << {"data":{"services":[{"id":"2","name":"projectB"},{"id":"4","name":"projectA"},{"id":"5","name":"projectD"},{"id":"3","name":"projectC"}]}} [{"id":"2","name":"projectB"},{"id":"4","name":"projectA"},{"id":"5","name":"projectD"},{"id":"3","name":"projectC"}] skywalking-cli $ ./bin/swctl --config=/Users/kezhenxu/settings.yml --debug service ls --start=2019-10-01 --step=MONTH DEBU[2019-11-07 19:39:06] Debug mode is enabled DEBU[2019-11-07 19:39:06] Using configuration file: /Users/kezhenxu/settings.yml DEBU[2019-11-07 19:39:06] Configurations: {"Global":{"BaseUrl":"http://122.112.182.72:8080/graphql"}} DEBU[2019-11-07 19:39:06] Missing --end, defaults to 2019-11-07 DEBU[2019-11-07 19:39:06] >> variables: map[duration:{2019-10-01 2019-11-07 MONTH}] DEBU[2019-11-07 19:39:06] >> query: query ($duration: Duration!) { services: getAllServices(duration: $duration) { id name } } DEBU[2019-11-07 19:39:06] >> headers: map[Accept:[application/json; charset=utf-8] Content-Type:[application/json; charset=utf-8]] DEBU[2019-11-07 19:39:06] << {"data":{"services":[{"id":"4","name":"projectA"},{"id":"2","name":"projectB"},{"id":"5","name":"projectD"},{"id":"3","name":"projectC"}]}} [{"id":"4","name":"projectA"},{"id":"2","name":"projectB"},{"id":"5","name":"projectD"},{"id":"3","name":"projectC"}] ``` This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [skywalking-cli] kezhenxu94 commented on issue #6: [Feature] Set GraphQL client and add service ls command
kezhenxu94 commented on issue #6: [Feature] Set GraphQL client and add service ls command URL: https://github.com/apache/skywalking-cli/pull/6#issuecomment-551082650 > Hi, maybe it would be better to present the data in tables? > > ![image](https://user-images.githubusercontent.com/26432832/68392439-c46d8e80-01a4-11ea-8f44-087e017fc33c.png) CLI is usually chained with pipe, like `swctl service ls | jq`, presenting the data in a table maybe another option, but that's another story This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [skywalking-cli] kezhenxu94 commented on issue #6: [Feature] Set GraphQL client and add service ls command
kezhenxu94 commented on issue #6: [Feature] Set GraphQL client and add service ls command URL: https://github.com/apache/skywalking-cli/pull/6#issuecomment-552094691 Tackling the time seems much more complicated than I thought, to clarify(which I think should be included in the command manual): - when `start` and `end` are both absent, `start = now - 30min` and `end = now`, namely past 30 minutes - when `start` and `end` are both present, they are aligned to same precision by truncating the more precise one, e.g. if `start = 2019-01-01 1234, end = 2019-01-01 18`, then `start = 2019-01-01 12, end = 2019-01-01 18` - when `start` is absent and `end` is present, will determine the precision of `end` and then use the precision to calculate `start`(by minus 30 units), e.g. `end = 2019-11-09 1234`, the precision is `MINUTE`, so `start = end - 30MIN = 2019-11-09 1204`; and if `end = 2019-11-09 12`, the precision is `HOUR`, so `start = end - 30HOUR = 2019-11-08 06` - when `start` is present and `end` is absent, will determine the precision of `start` and then use the precision to calculate `end`(by plus 30 units), e.g. `start = 2019-11-09 1204`, the precision is `MINUTE`, so `end = end + 30MIN = 2019-11-09 1234`; and if `start = 2019-11-08 06`, the precision is `HOUR`, so `start = end + 30HOUR = 2019-11-09 12` @wu-sheng can you confirm? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [skywalking-cli] kezhenxu94 commented on issue #6: [Feature] Set GraphQL client and add service ls command
kezhenxu94 commented on issue #6: [Feature] Set GraphQL client and add service ls command URL: https://github.com/apache/skywalking-cli/pull/6#issuecomment-552095573 > @kezhenxu94 Yes, confirmed. We should begin a new pull request and write a document from now. I'll began to write command user manual and develop documentations This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services