arugal opened a new pull request #10: [Feature] Support instance  list command
URL: https://github.com/apache/skywalking-cli/pull/10
 
 
   works like this:
   ```bash
   ./swctl --debug --base-url=http://122.112.182.72:8080/graphql --display=yaml 
instance ls --service-id=4 --start=2019-11-09 --step=MONTH
   DEBUG Debug mode is enabled                        
   DEBUG Using configurations:
    global:
      base-url: http://122.112.182.72:8080/graphql 
   DEBUG Start time: 2019-11-09 end time:             
   DEBUG >> variables: map[duration:{2019-11-09 2019-12-09 DAY} serviceId:4] 
   DEBUG >> query: 
                   query ($serviceId: ID!, $duration: Duration!) {
                   instances: getServiceInstances(duration: $duration, 
serviceId: $serviceId) {
                           id
                           name
                           language
                                   instanceUUID
                           attributes {
                                   name
                                   value
                           }
                           }
                   }
            
   DEBUG >> headers: map[Accept:[application/json; charset=utf-8] 
Content-Type:[application/json; charset=utf-8]] 
   DEBUG << 
{"data":{"instances":[{"id":"4","name":"projectA-pid:4771@skywalking-server-0001","language":"JAVA","instanceUUID":"d54c4f5b5094419c9f0d12b8445730c0","attributes":[{"name":"os_name","value":"Linux"},{"name":"host_name","value":"skywalking-server-0001"},{"name":"process_no","value":"4771"},{"name":"ipv4s","value":"192.168.252.12"}]}]}}
 
   - id: "4"
     name: projectA-pid:4771@skywalking-server-0001
     attributes:
     - name: os_name
       value: Linux
     - name: host_name
       value: skywalking-server-0001
     - name: process_no
       value: "4771"
     - name: ipv4s
       value: 192.168.252.12
     language: JAVA
     instanceuuid: d54c4f5b5094419c9f0d12b8445730c0
   
   ================================================
   
   ./swctl --debug --base-url=http://122.112.182.72:8080/graphql --display=yaml 
instance ls --service-name=projectB --start=2019-11-09 --step=MONTH
   
   DEBUG Debug mode is enabled                        
   DEBUG Using configurations:
    global:
      base-url: http://122.112.182.72:8080/graphql 
   DEBUG Start time: 2019-11-09 end time:             
   DEBUG >> variables: map[serviceCode:projectB]      
   DEBUG >> query: 
                   query searchService($serviceCode: String!) {
                   service: searchService(serviceCode: $serviceCode) {
                                   id name
                           }
                   }
            
   DEBUG >> headers: map[Accept:[application/json; charset=utf-8] 
Content-Type:[application/json; charset=utf-8]] 
   DEBUG << {"data":{"service":{"id":"2","name":"projectB"}}} 
   DEBUG >> variables: map[duration:{2019-11-09 2019-12-09 DAY} serviceId:2] 
   DEBUG >> query: 
                   query ($serviceId: ID!, $duration: Duration!) {
                   instances: getServiceInstances(duration: $duration, 
serviceId: $serviceId) {
                           id
                           name
                           language
                                   instanceUUID
                           attributes {
                                   name
                                   value
                           }
                           }
                   }
            
   DEBUG >> headers: map[Accept:[application/json; charset=utf-8] 
Content-Type:[application/json; charset=utf-8]] 
   DEBUG << 
{"data":{"instances":[{"id":"2","name":"projectB-pid:4713@skywalking-server-0001","language":"JAVA","instanceUUID":"55a7a0af57f64c1da0b7c44063ddc8c0","attributes":[{"name":"os_name","value":"Linux"},{"name":"host_name","value":"skywalking-server-0001"},{"name":"process_no","value":"4713"},{"name":"ipv4s","value":"192.168.252.12"}]}]}}
 
   - id: "2"
     name: projectB-pid:4713@skywalking-server-0001
     attributes:
     - name: os_name
       value: Linux
     - name: host_name
       value: skywalking-server-0001
     - name: process_no
       value: "4713"
     - name: ipv4s
       value: 192.168.252.12
     language: JAVA
     instanceuuid: 55a7a0af57f64c1da0b7c44063ddc8c0
   ================================================================
   ./swctl --debug --base-url=http://122.112.182.72:8080/graphql --display=yaml 
instance ls --service-name=projectB --service-id=4 --start=2019-11-09 
--step=MONTH
   
   DEBUG Debug mode is enabled                        
   DEBUG Using configurations:
    global:
      base-url: http://122.112.182.72:8080/graphql 
   DEBUG Start time: 2019-11-09 end time:             
   DEBUG >> variables: map[duration:{2019-11-09 2019-12-09 DAY} serviceId:4] 
   DEBUG >> query: 
                   query ($serviceId: ID!, $duration: Duration!) {
                   instances: getServiceInstances(duration: $duration, 
serviceId: $serviceId) {
                           id
                           name
                           language
                                   instanceUUID
                           attributes {
                                   name
                                   value
                           }
                           }
                   }
            
   DEBUG >> headers: map[Accept:[application/json; charset=utf-8] 
Content-Type:[application/json; charset=utf-8]] 
   DEBUG << 
{"data":{"instances":[{"id":"4","name":"projectA-pid:4771@skywalking-server-0001","language":"JAVA","instanceUUID":"d54c4f5b5094419c9f0d12b8445730c0","attributes":[{"name":"os_name","value":"Linux"},{"name":"host_name","value":"skywalking-server-0001"},{"name":"process_no","value":"4771"},{"name":"ipv4s","value":"192.168.252.12"}]}]}}
 
   - id: "4"
     name: projectA-pid:4771@skywalking-server-0001
     attributes:
     - name: os_name
       value: Linux
     - name: host_name
       value: skywalking-server-0001
     - name: process_no
       value: "4771"
     - name: ipv4s
       value: 192.168.252.12
     language: JAVA
     instanceuuid: d54c4f5b5094419c9f0d12b8445730c0
   ```
   *Set both ```--service-id``` and ```--service-name```,  ```--service-name``` 
is ignored*

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to