Skip to content

Commit

Permalink
Merge pull request #22 from TheAntColony/master
Browse files Browse the repository at this point in the history
Integration tests
  • Loading branch information
jasmingacic authored Aug 12, 2019
2 parents 00eb086 + c025f49 commit 9f73e50
Show file tree
Hide file tree
Showing 81 changed files with 1,039 additions and 143 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*.dll
*.so
*.dylib
packet

# Test binary, build with `go test -c`
*.test
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ K := $(foreach exec,$(EXECUTABLES),\
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))

BINARY=packet
VERSION=0.0.2
VERSION=0.0.3
BUILD=`git rev-parse HEAD`
PLATFORMS=darwin linux windows
ARCHITECTURES=amd64 arm64
Expand Down Expand Up @@ -35,3 +35,6 @@ install:
generate-docs: clean-docs
mkdir -p docs
GENDOCS=true go run main.go

test:
go test ./tests
2 changes: 2 additions & 0 deletions cmd/create_device.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,6 @@ func init() {
createDeviceCmd.Flags().BoolVarP(&spotInstance, "spot-instance", "I", false, `Set the device as a spot instance`)
createDeviceCmd.Flags().Float64VarP(&spotPriceMax, "spot-price-max", "m", 0, `--spot-price-max=1.2 or -m=1.2`)
createDeviceCmd.Flags().StringVarP(&terminationTime, "termination-time", "T", "", `Device termination time: --termination-time="15:04:05"`)
createDeviceCmd.PersistentFlags().BoolVarP(&isJSON, "json", "j", false, "JSON output")
createDeviceCmd.PersistentFlags().BoolVarP(&isYaml, "yaml", "y", false, "YAML output")
}
2 changes: 2 additions & 0 deletions cmd/create_organization.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,6 @@ func init() {
createOrganizationCmd.Flags().StringVarP(&logo, "logo", "l", "", "Logo URL]")

createOrganizationCmd.MarkFlagRequired("name")
createOrganizationCmd.PersistentFlags().BoolVarP(&isJSON, "json", "j", false, "JSON output")
createOrganizationCmd.PersistentFlags().BoolVarP(&isYaml, "yaml", "y", false, "YAML output")
}
2 changes: 2 additions & 0 deletions cmd/create_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,6 @@ func init() {
createProjectCmd.Flags().StringVarP(&paymentMethodID, "payment-method-id", "m", "", "UUID of the payment method")

createProjectCmd.MarkFlagRequired("name")
createProjectCmd.PersistentFlags().BoolVarP(&isJSON, "json", "j", false, "JSON output")
createProjectCmd.PersistentFlags().BoolVarP(&isYaml, "yaml", "y", false, "YAML output")
}
2 changes: 2 additions & 0 deletions cmd/create_ssh-key.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,6 @@ func init() {

createSSHKeyCmd.MarkFlagRequired("label")
createSSHKeyCmd.MarkFlagRequired("key")
createSSHKeyCmd.PersistentFlags().BoolVarP(&isJSON, "json", "j", false, "JSON output")
createSSHKeyCmd.PersistentFlags().BoolVarP(&isYaml, "yaml", "y", false, "YAML output")
}
2 changes: 2 additions & 0 deletions cmd/create_virtual_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,6 @@ func init() {

createVirtualNetworkCmd.MarkFlagRequired("project-id")
createVirtualNetworkCmd.MarkFlagRequired("facility")
createVirtualNetworkCmd.PersistentFlags().BoolVarP(&isJSON, "json", "j", false, "JSON output")
createVirtualNetworkCmd.PersistentFlags().BoolVarP(&isYaml, "yaml", "y", false, "YAML output")
}
3 changes: 2 additions & 1 deletion cmd/create_volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,6 @@ func init() {
createVolumeCmd.Flags().StringVarP(&billingCycle, "billing-cycle", "b", "hourly", "Billing cycle")
createVolumeCmd.Flags().StringVarP(&description, "description", "d", "", "Description of the volume")
createVolumeCmd.Flags().BoolVarP(&locked, "locked", "l", false, "Set the volume to be locked")

createVolumeCmd.PersistentFlags().BoolVarP(&isJSON, "json", "j", false, "JSON output")
createVolumeCmd.PersistentFlags().BoolVarP(&isYaml, "yaml", "y", false, "YAML output")
}
2 changes: 1 addition & 1 deletion cmd/hardware_reservations.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (

// hardwareReservationsCmd represents the hardwareReservations command
var hardwareReservationsCmd = &cobra.Command{
Use: "hardware_reservation",
Use: "hardware-reservation",
Short: "Hardware reservation operations",
Long: `Hardware reservation operations: get, move`,
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/retrieve_volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Retrieve the list of volumes:
packet volume get --project-id [project_UUID]
Retrieve a specific volume:
packet get volume --id [volume_UUID]
packet volume get --id [volume_UUID]
`,
Run: func(cmd *cobra.Command, args []string) {
Expand Down
6 changes: 3 additions & 3 deletions docs/packet.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Command line interface for Packet Host
### Options

```
--config string Path to JSON or YAML configuration file (default "/Users/jasmingacic/.packet-cli.json")
--config string Path to JSON or YAML configuration file
-h, --help Help for packet
--version Version for packet
```
Expand All @@ -20,7 +20,7 @@ Command line interface for Packet Host
* [packet device](packet_device.md) - Device operations
* [packet event](packet_event.md) - Events operations
* [packet facilities](packet_facilities.md) - Facility operations
* [packet hardware_reservation](packet_hardware_reservation.md) - Hardware reservation operations
* [packet hardware-reservation](packet_hardware-reservation.md) - Hardware reservation operations
* [packet ip](packet_ip.md) - IP operations
* [packet operating-systems](packet_operating-systems.md) - Operating system operations
* [packet organization](packet_organization.md) - Organization operations
Expand All @@ -32,4 +32,4 @@ Command line interface for Packet Host
* [packet volume](packet_volume.md) - Volume operations
* [packet vpn](packet_vpn.md) - VPN service operations

###### Auto generated by spf13/cobra on 8-Oct-2018
###### Auto generated by spf13/cobra on 12-Aug-2019
4 changes: 2 additions & 2 deletions docs/packet_2fa.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Two Factor Authentication operations: enable, disable, receive
### Options inherited from parent commands

```
--config string Path to JSON or YAML configuration file (default "/Users/jasmingacic/.packet-cli.json")
--config string Path to JSON or YAML configuration file
```

### SEE ALSO
Expand All @@ -25,4 +25,4 @@ Two Factor Authentication operations: enable, disable, receive
* [packet 2fa enable](packet_2fa_enable.md) - Enables two factor authentication
* [packet 2fa receive](packet_2fa_receive.md) - Receive two factor authentication token

###### Auto generated by spf13/cobra on 8-Oct-2018
###### Auto generated by spf13/cobra on 12-Aug-2019
4 changes: 2 additions & 2 deletions docs/packet_2fa_disable.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ packet 2fa disable [flags]
### Options inherited from parent commands

```
--config string Path to JSON or YAML configuration file (default "/Users/jasmingacic/.packet-cli.json")
--config string Path to JSON or YAML configuration file
```

### SEE ALSO

* [packet 2fa](packet_2fa.md) - Two Factor Authentication operations

###### Auto generated by spf13/cobra on 8-Oct-2018
###### Auto generated by spf13/cobra on 12-Aug-2019
4 changes: 2 additions & 2 deletions docs/packet_2fa_enable.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ packet 2fa enable [flags]
### Options inherited from parent commands

```
--config string Path to JSON or YAML configuration file (default "/Users/jasmingacic/.packet-cli.json")
--config string Path to JSON or YAML configuration file
```

### SEE ALSO

* [packet 2fa](packet_2fa.md) - Two Factor Authentication operations

###### Auto generated by spf13/cobra on 8-Oct-2018
###### Auto generated by spf13/cobra on 12-Aug-2019
4 changes: 2 additions & 2 deletions docs/packet_2fa_receive.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ packet 2fa receive [flags]
### Options inherited from parent commands

```
--config string Path to JSON or YAML configuration file (default "/Users/jasmingacic/.packet-cli.json")
--config string Path to JSON or YAML configuration file
```

### SEE ALSO

* [packet 2fa](packet_2fa.md) - Two Factor Authentication operations

###### Auto generated by spf13/cobra on 8-Oct-2018
###### Auto generated by spf13/cobra on 12-Aug-2019
4 changes: 2 additions & 2 deletions docs/packet_device.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Device operations: create, delete, update, start/stop, reboot and get.
### Options inherited from parent commands

```
--config string Path to JSON or YAML configuration file (default "/Users/jasmingacic/.packet-cli.json")
--config string Path to JSON or YAML configuration file
```

### SEE ALSO
Expand All @@ -29,4 +29,4 @@ Device operations: create, delete, update, start/stop, reboot and get.
* [packet device stop](packet_device_stop.md) - Stops a device
* [packet device update](packet_device_update.md) - Updates a device

###### Auto generated by spf13/cobra on 8-Oct-2018
###### Auto generated by spf13/cobra on 12-Aug-2019
6 changes: 4 additions & 2 deletions docs/packet_device_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ packet device create [flags]
-h, --help Help for create
-H, --hostname string Hostname
-i, --ipxe-script-url string URL to the iPXE script
-j, --json JSON output
-o, --operating-system string Operating system name for the device
-P, --plan string Name of the plan
-p, --project-id string UUID of the project where the device will be created
Expand All @@ -35,16 +36,17 @@ packet device create [flags]
-t, --tags strings Tags for the device: --tags="tag1,tag2"
-T, --termination-time string Device termination time: --termination-time="15:04:05"
-u, --userdata string User data
-y, --yaml YAML output
```

### Options inherited from parent commands

```
--config string Path to JSON or YAML configuration file (default "/Users/jasmingacic/.packet-cli.json")
--config string Path to JSON or YAML configuration file
```

### SEE ALSO

* [packet device](packet_device.md) - Device operations

###### Auto generated by spf13/cobra on 8-Oct-2018
###### Auto generated by spf13/cobra on 12-Aug-2019
4 changes: 2 additions & 2 deletions docs/packet_device_delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ packet device delete [flags]
### Options inherited from parent commands

```
--config string Path to JSON or YAML configuration file (default "/Users/jasmingacic/.packet-cli.json")
--config string Path to JSON or YAML configuration file
```

### SEE ALSO

* [packet device](packet_device.md) - Device operations

###### Auto generated by spf13/cobra on 8-Oct-2018
###### Auto generated by spf13/cobra on 12-Aug-2019
4 changes: 2 additions & 2 deletions docs/packet_device_get.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ packet device get [flags]
### Options inherited from parent commands

```
--config string Path to JSON or YAML configuration file (default "/Users/jasmingacic/.packet-cli.json")
--config string Path to JSON or YAML configuration file
```

### SEE ALSO

* [packet device](packet_device.md) - Device operations

###### Auto generated by spf13/cobra on 8-Oct-2018
###### Auto generated by spf13/cobra on 12-Aug-2019
4 changes: 2 additions & 2 deletions docs/packet_device_reboot.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ packet device reboot [flags]
### Options inherited from parent commands

```
--config string Path to JSON or YAML configuration file (default "/Users/jasmingacic/.packet-cli.json")
--config string Path to JSON or YAML configuration file
```

### SEE ALSO

* [packet device](packet_device.md) - Device operations

###### Auto generated by spf13/cobra on 8-Oct-2018
###### Auto generated by spf13/cobra on 12-Aug-2019
4 changes: 2 additions & 2 deletions docs/packet_device_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ packet device start [flags]
### Options inherited from parent commands

```
--config string Path to JSON or YAML configuration file (default "/Users/jasmingacic/.packet-cli.json")
--config string Path to JSON or YAML configuration file
```

### SEE ALSO

* [packet device](packet_device.md) - Device operations

###### Auto generated by spf13/cobra on 8-Oct-2018
###### Auto generated by spf13/cobra on 12-Aug-2019
4 changes: 2 additions & 2 deletions docs/packet_device_stop.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ packet device stop [flags]
### Options inherited from parent commands

```
--config string Path to JSON or YAML configuration file (default "/Users/jasmingacic/.packet-cli.json")
--config string Path to JSON or YAML configuration file
```

### SEE ALSO

* [packet device](packet_device.md) - Device operations

###### Auto generated by spf13/cobra on 8-Oct-2018
###### Auto generated by spf13/cobra on 12-Aug-2019
4 changes: 2 additions & 2 deletions docs/packet_device_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ packet device update [flags]
### Options inherited from parent commands

```
--config string Path to JSON or YAML configuration file (default "/Users/jasmingacic/.packet-cli.json")
--config string Path to JSON or YAML configuration file
```

### SEE ALSO

* [packet device](packet_device.md) - Device operations

###### Auto generated by spf13/cobra on 8-Oct-2018
###### Auto generated by spf13/cobra on 12-Aug-2019
4 changes: 2 additions & 2 deletions docs/packet_event.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ Events operations: get
### Options inherited from parent commands

```
--config string Path to JSON or YAML configuration file (default "/Users/jasmingacic/.packet-cli.json")
--config string Path to JSON or YAML configuration file
```

### SEE ALSO

* [packet](packet.md) - Command line interface for Packet Host
* [packet event get](packet_event_get.md) - Retrieves one or more events for organizations, projects, or devices.

###### Auto generated by spf13/cobra on 8-Oct-2018
###### Auto generated by spf13/cobra on 12-Aug-2019
4 changes: 2 additions & 2 deletions docs/packet_event_get.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ packet event get [flags]
### Options inherited from parent commands

```
--config string Path to JSON or YAML configuration file (default "/Users/jasmingacic/.packet-cli.json")
--config string Path to JSON or YAML configuration file
```

### SEE ALSO

* [packet event](packet_event.md) - Events operations

###### Auto generated by spf13/cobra on 8-Oct-2018
###### Auto generated by spf13/cobra on 12-Aug-2019
4 changes: 2 additions & 2 deletions docs/packet_facilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ Facility operations: get
### Options inherited from parent commands

```
--config string Path to JSON or YAML configuration file (default "/Users/jasmingacic/.packet-cli.json")
--config string Path to JSON or YAML configuration file
```

### SEE ALSO

* [packet](packet.md) - Command line interface for Packet Host
* [packet facilities get](packet_facilities_get.md) - Retrieves a list of available facilities.

###### Auto generated by spf13/cobra on 8-Oct-2018
###### Auto generated by spf13/cobra on 12-Aug-2019
4 changes: 2 additions & 2 deletions docs/packet_facilities_get.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ packet facilities get [flags]
### Options inherited from parent commands

```
--config string Path to JSON or YAML configuration file (default "/Users/jasmingacic/.packet-cli.json")
--config string Path to JSON or YAML configuration file
```

### SEE ALSO

* [packet facilities](packet_facilities.md) - Facility operations

###### Auto generated by spf13/cobra on 8-Oct-2018
###### Auto generated by spf13/cobra on 12-Aug-2019
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## packet hardware_reservation
## packet hardware-reservation

Hardware reservation operations

Expand All @@ -9,19 +9,19 @@ Hardware reservation operations: get, move
### Options

```
-h, --help Help for hardware_reservation
-h, --help Help for hardware-reservation
```

### Options inherited from parent commands

```
--config string Path to JSON or YAML configuration file (default "/Users/jasmingacic/.packet-cli.json")
--config string Path to JSON or YAML configuration file
```

### SEE ALSO

* [packet](packet.md) - Command line interface for Packet Host
* [packet hardware_reservation get](packet_hardware_reservation_get.md) - Retrieves all hardware reservations of a project or a single hardware reservation
* [packet hardware_reservation move](packet_hardware_reservation_move.md) - Move hardware reservation to another project
* [packet hardware-reservation get](packet_hardware-reservation_get.md) - Retrieves all hardware reservations of a project or a single hardware reservation
* [packet hardware-reservation move](packet_hardware-reservation_move.md) - Move hardware reservation to another project

###### Auto generated by spf13/cobra on 8-Oct-2018
###### Auto generated by spf13/cobra on 12-Aug-2019
Loading

0 comments on commit 9f73e50

Please sign in to comment.