Skip to content
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

Modify few tink hardware cli #150

Closed
parauliya opened this issue Jun 4, 2020 · 0 comments · Fixed by #207
Closed

Modify few tink hardware cli #150

parauliya opened this issue Jun 4, 2020 · 0 comments · Fixed by #207
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@parauliya
Copy link
Contributor

parauliya commented Jun 4, 2020

Therea are following cli/api which needs to be changed as discussed in the RFC #4:

tink hardware mac <MAC address>
tink hardware ip <IP address>

Rename the cli tink hardware all to tink hardware list and it's behaviour.

Please look at the RFC mentioned above for more details.

@parauliya parauliya self-assigned this Jun 4, 2020
@parauliya parauliya added the kind/feature Categorizes issue or PR as related to a new feature. label Jun 4, 2020
parauliya pushed a commit to infracloudio/tink that referenced this issue Jul 6, 2020
…e cli"

Following are the change in this commit
1. `tink hardware mac <mac address>` will provide only relevent information instead of complete hardware json
2. `tink hardware ip <ip address>` will provide only relevent information instead of complete hardware json
3. There will be a flag in both of the above clis (--details) which can be provided to get the complete hardware data
4. `tink hardware all` cli has been renamed to `tink hardware list`
5. The above cli will only list the relevent information (which is 'hardware-id', 'mac address', 'ip address' and 'hostname for now) instead of providing the complete json of all the hardware present in the database.
parauliya pushed a commit to infracloudio/tink that referenced this issue Jul 6, 2020
…e cli"

Following are the change in this commit
1. `tink hardware mac <mac address>` will provide only relevent information instead of complete hardware json
2. `tink hardware ip <ip address>` will provide only relevent information instead of complete hardware json
3. There will be a flag in both of the above clis (--details) which can be provided to get the complete hardware data
4. `tink hardware all` cli has been renamed to `tink hardware list`
5. The above cli will only list the relevent information (which is 'hardware-id', 'mac address', 'ip address' and 'hostname for now) instead of providing the complete json of all the hardware present in the database.
parauliya pushed a commit to infracloudio/tink that referenced this issue Jul 6, 2020
…e cli"

Following are the change in this commit
1. `tink hardware mac <mac address>` will provide only relevent information instead of complete hardware json
2. `tink hardware ip <ip address>` will provide only relevent information instead of complete hardware json
3. There will be a flag in both of the above clis (--details) which can be provided to get the complete hardware data
4. `tink hardware all` cli has been renamed to `tink hardware list`
5. The above cli will only list the relevent information (which is 'hardware-id', 'mac address', 'ip address' and 'hostname for now) instead of providing the complete json of all the hardware present in the database.
parauliya pushed a commit to infracloudio/tink that referenced this issue Jul 7, 2020
…e cli"

Following are the change in this commit
1. `tink hardware mac <mac address>` will provide only relevent information instead of complete hardware json
2. `tink hardware ip <ip address>` will provide only relevent information instead of complete hardware json
3. There will be a flag in both of the above clis (--details) which can be provided to get the complete hardware data
4. `tink hardware all` cli has been renamed to `tink hardware list`
5. The above cli will only list the relevent information (which is 'hardware-id', 'mac address', 'ip address' and 'hostname for now) instead of providing the complete json of all the hardware present in the database.
parauliya pushed a commit to infracloudio/tink that referenced this issue Jul 7, 2020
…e cli"

Following are the change in this commit
1. `tink hardware mac <mac address>` will provide only relevent information instead of complete hardware json
2. `tink hardware ip <ip address>` will provide only relevent information instead of complete hardware json
3. There will be a flag in both of the above clis (--details) which can be provided to get the complete hardware data
4. `tink hardware all` cli has been renamed to `tink hardware list`
5. The above cli will only list the relevent information (which is 'hardware-id', 'mac address', 'ip address' and 'hostname for now) instead of providing the complete json of all the hardware present in the database.
parauliya pushed a commit to infracloudio/tink that referenced this issue Jul 8, 2020
…e cli"

Following are the change in this commit
1. `tink hardware mac <mac address>` will provide only relevent information instead of complete hardware json
2. `tink hardware ip <ip address>` will provide only relevent information instead of complete hardware json
3. There will be a flag in both of the above clis (--details) which can be provided to get the complete hardware data
4. `tink hardware all` cli has been renamed to `tink hardware list`
5. The above cli will only list the relevent information (which is 'hardware-id', 'mac address', 'ip address' and 'hostname for now) instead of providing the complete json of all the hardware present in the database.
parauliya pushed a commit to infracloudio/tink that referenced this issue Jul 9, 2020
…e cli"

Following are the change in this commit
1. `tink hardware mac <mac address>` will provide only relevent information instead of complete hardware json
2. `tink hardware ip <ip address>` will provide only relevent information instead of complete hardware json
3. There will be a flag in both of the above clis (--details) which can be provided to get the complete hardware data
4. `tink hardware all` cli has been renamed to `tink hardware list`
5. The above cli will only list the relevent information (which is 'hardware-id', 'mac address', 'ip address' and 'hostname for now) instead of providing the complete json of all the hardware present in the database.
parauliya pushed a commit to infracloudio/tink that referenced this issue Jul 9, 2020
…e cli"

Following are the change in this commit
1. `tink hardware mac <mac address>` will provide only relevent information instead of complete hardware json
2. `tink hardware ip <ip address>` will provide only relevent information instead of complete hardware json
3. There will be a flag in both of the above clis (--details) which can be provided to get the complete hardware data
4. `tink hardware all` cli has been renamed to `tink hardware list`
5. The above cli will only list the relevent information (which is 'hardware-id', 'mac address', 'ip address' and 'hostname for now) instead of providing the complete json of all the hardware present in the database.
parauliya pushed a commit to infracloudio/tink that referenced this issue Jul 9, 2020
…e cli"

Following are the change in this commit
1. `tink hardware mac <mac address>` will provide only relevent information instead of complete hardware json
2. `tink hardware ip <ip address>` will provide only relevent information instead of complete hardware json
3. There will be a flag in both of the above clis (--details) which can be provided to get the complete hardware data
4. `tink hardware all` cli has been renamed to `tink hardware list`
5. The above cli will only list the relevent information (which is 'hardware-id', 'mac address', 'ip address' and 'hostname for now) instead of providing the complete json of all the hardware present in the database.
@mergify mergify bot closed this as completed in #207 Jul 10, 2020
mergify bot added a commit that referenced this issue Jul 10, 2020
## Description
Following are the change in this commit
1. `tink hardware mac <mac address>` will provide only relevent information instead of complete hardware json
2. `tink hardware ip <ip address>` will provide only relevent information instead of complete hardware json
3. There will be a flag in both of the above clis (--details) or (-d)  which can be provided to get the complete hardware data
4. `tink hardware all` cli has been renamed to `tink hardware list`
5. The above cli will only list the relevent information (which is 'hardware-id', 'mac address', 'ip address' and 'hostname for now) instead of providing the complete json of all the hardware present in the database.

## Why is this needed

Fixes: #150 

## How Has This Been Tested?
I have tested this locally by pushing the hardware data for two different hardware using `tink hardware push` command and then try to run the clis mentioned in the above description.
Following are the output of the commands.
    1. tink hardware list 

```
+--------------------------------------+-------------------+-------------+-----------+
| ID                                   | MAC ADDRESS       | IP ADDRESS  | HOSTNAME  |
+--------------------------------------+-------------------+-------------+-----------+
| f9f56dff-098a-4c5f-a51c-19ad35de85d2 | 98:03:9b:89:d7:da | 192.168.1.4 | localhost |
| f9f56dff-098a-4c5f-a51c-19ad35de85d1 | 98:03:9b:89:d7:ba | 192.168.1.5 | worker_1 |
+--------------------------------------+-------------------+-------------+-----------+

```
With the help of above command you will get the list of hardware present in the database. Now you can run following commands:
 
2.
     a.  tink hardware mac 98:03:9b:89:d7:da

```
+-------------+--------------------------------------+
| FIELD NAME  | VALUE                                |
+-------------+--------------------------------------+
| ID          | f9f56dff-098a-4c5f-a51c-19ad35de85d2 |
| MAC Address | 98:03:9b:89:d7:da                    |
| IP Address  | 192.168.1.4                          |
| Hostname    | localhost                            |
+-------------+--------------------------------------+

```

    b.  tink hardware mac 98:03:9b:89:d7:da  -d ( provide -d flag )

`{"metadata":{"instance":{},"facility":{"facility_code":"onprem"}},"network":{"interfaces":[{"dhcp":{"mac":"98:03:9b:89:d7:da","hostname":"localhost","arch":"x86_64","ip":{"address":"192.168.1.4","netmask":"255.255.255.248","gateway":"192.168.1.1"}},"netboot":{"allow_pxe":true,"allow_workflow":true}}]},"id":"f9f56dff-098a-4c5f-a51c-19ad35de85d2"}`
        
3. Same thing will be applicable for `tink hardware ip`  command:
    a. tink hardware ip 192.168.1.4
```
+-------------+--------------------------------------+
| FIELD NAME  | VALUE                                |
+-------------+--------------------------------------+
| ID          | f9f56dff-098a-4c5f-a51c-19ad35de85d2 |
| MAC Address | 98:03:9b:89:d7:da                    |
| IP Address  | 192.168.1.4                          |
| Hostname    | localhost                            |
+-------------+--------------------------------------+

```

  b. tink hardware ip 192.168.1.4  -d ( provide -d flag )

`{"metadata":{"instance":{},"facility":{"facility_code":"onprem"}},"network":{"interfaces":[{"dhcp":{"mac":"98:03:9b:89:d7:da","hostname":"localhost","arch":"x86_64","ip":{"address":"192.168.1.4","netmask":"255.255.255.248","gateway":"192.168.1.1"}},"netboot":{"allow_pxe":true,"allow_workflow":true}}]},"id":"f9f56dff-098a-4c5f-a51c-19ad35de85d2"} `

4. And at last the output of tink hardware --help is look like as follows:

```
tink hardware client

Usage:
  tink hardware [command]

Examples:
tink hardware [command]

Available Commands:
  delete      delete hardware by id
  id          get hardware by id
  ip          get hardware by any associated ip
  list        list all known hardware
  mac         get hardware by any associated mac
  push        push new hardware to tink
  watch       register to watch an id for any changes

Flags:
  -h, --help   help for hardware

Global Flags:
  -f, --facility string   used to build grpc and http urls

Use "tink hardware [command] --help" for more information about a command.

```
## How are existing users impacted? What migration steps/scripts do we need?
There will be a change for existing user for `tink hardware`  as mentioned in the description. There is no need of migration steps or scripts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant