Skip to content

Commit

Permalink
Merge branch 'main' into gateways
Browse files Browse the repository at this point in the history
  • Loading branch information
aayushrangwala committed Nov 10, 2023
2 parents 246f280 + cd40bb0 commit 4b87ce6
Show file tree
Hide file tree
Showing 17 changed files with 620 additions and 21 deletions.
2 changes: 2 additions & 0 deletions cmd/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/equinix/metal-cli/internal/gateway"
"github.com/equinix/metal-cli/internal/hardware"
initPkg "github.com/equinix/metal-cli/internal/init"
"github.com/equinix/metal-cli/internal/interconnections"
"github.com/equinix/metal-cli/internal/ips"
"github.com/equinix/metal-cli/internal/metros"
"github.com/equinix/metal-cli/internal/organizations"
Expand Down Expand Up @@ -93,5 +94,6 @@ func (cli *Cli) RegisterCommands(client *root.Client) {
twofa.NewClient(client, cli.Outputer).NewCommand(),
gateway.NewClient(client, cli.Outputer).NewCommand(),
ports.NewClient(client, cli.Outputer).NewCommand(),
interconnections.NewClient(client, cli.Outputer).NewCommand(),
)
}
1 change: 1 addition & 0 deletions docs/metal.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Command line interface for Equinix Metal
* [metal gateway](metal_gateway.md) - Metal Gateway operations: create, delete, and retrieve.
* [metal hardware-reservation](metal_hardware-reservation.md) - Hardware reservation operations: get, move.
* [metal init](metal_init.md) - Create a configuration file.
* [metal interconnections](metal_interconnections.md) - interconnections operations: create, get, update, delete
* [metal ip](metal_ip.md) - IP address, reservations, and assignment operations: assign, unassign, remove, available, request and get.
* [metal metros](metal_metros.md) - Metro operations: get.
* [metal operating-systems](metal_operating-systems.md) - Operating system operations: get.
Expand Down
7 changes: 4 additions & 3 deletions docs/metal_device_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Updates a device.
Updates the hostname of a device. Updates or adds a description, tags, userdata, custom data, and iPXE settings for an already provisioned device. Can also lock or unlock future changes to the device.

```
metal device update -i <device_id> [-H <hostname>] [-d <description>] [--locked <boolean>] [-t <tags>] [-u <userdata>] [-c <customdata>] [-s <ipxe_script_url>] [--always-pxe=<true|false>] [flags]
metal device update -i <device_id> [-H <hostname>] [-d <description>] [--locked <boolean>] [-t <tags>] [-u <userdata> | --userdata-file <filepath>] [-c <customdata>] [-s <ipxe_script_url>] [--always-pxe=<true|false>] [flags]
```

### Examples
Expand All @@ -20,16 +20,17 @@ metal device update -i <device_id> [-H <hostname>] [-d <description>] [--locked
### Options

```
-a, --always-pxe Sets the device to always iPXE on reboot.
-a, --always-pxe Updates the always_pxe toggle for the device (<true|false>).
-c, --customdata string Adds or updates custom data to be included with your device's metadata.
-d, --description string Adds or updates the description for the device.
-h, --help help for update
-H, --hostname string The new hostname of the device.
-i, --id string The UUID of the device.
-s, --ipxe-script-url string Add or update the URL of the iPXE script.
-l, --locked Locks or unlocks the device for future changes.
-l, --locked Locks or unlocks the device for future changes (<true|false>).
-t, --tags strings Adds or updates the tags for the device --tags="tag1,tag2".
-u, --userdata string Adds or updates the userdata for the device.
--userdata-file string Path to a userdata file for device initialization. Can not be used with --userdata.
```

### Options inherited from parent commands
Expand Down
37 changes: 37 additions & 0 deletions docs/metal_interconnections.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
## metal interconnections

interconnections operations: create, get, update, delete

### Synopsis

Get information on Metro locations. For more information on https://deploy.equinix.com/developers/docs/metal/interconnections.

### Options

```
-h, --help help for interconnections
```

### Options inherited from parent commands

```
--config string Path to JSON or YAML configuration file
--exclude strings Comma separated Href references to collapse in results, may be dotted three levels deep
--filter stringArray Filter 'get' actions with name value pairs. Filter is not supported by all resources and is implemented as request query parameters.
--http-header strings Headers to add to requests (in format key=value)
--include strings Comma separated Href references to expand in results, may be dotted three levels deep
-o, --output string Output format (*table, json, yaml). env output formats are (*sh, terraform, capp).
--search string Search keyword for use in 'get' actions. Search is not supported by all resources.
--sort-by string Sort fields for use in 'get' actions. Sort is not supported by all resources.
--sort-dir string Sort field direction for use in 'get' actions. Sort is not supported by all resources.
--token string Metal API Token (METAL_AUTH_TOKEN)
```

### SEE ALSO

* [metal](metal.md) - Command line interface for Equinix Metal
* [metal interconnections create](metal_interconnections_create.md) - Creates an interconnection.
* [metal interconnections delete](metal_interconnections_delete.md) - Deletes a interconnection.
* [metal interconnections get](metal_interconnections_get.md) - Retrieves interconnections for the current user, an organization, a project or the details of a specific interconnection.
* [metal interconnections update](metal_interconnections_update.md) - Updates a connection.

55 changes: 55 additions & 0 deletions docs/metal_interconnections_create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
## metal interconnections create

Creates an interconnection.

### Synopsis

Creates a new interconnection as per the organization ID or project ID

```
metal interconnections create -n <name> [-m <metro>] [-r <redundancy> ] [-t <type> ] [-p <project_id> ] | [-O <organization_id> ] [flags]
```

### Examples

```
# Creates a new interconnection named "it-interconnection":
metal interconnections create -n <name> [-m <metro>] [-r <redundancy>] [-t "dedicated" ] [-p <project_id>] | [-O <organization_id>]
metal interconnections create -n <name> [-m <metro>] [-r <redundancy>] [-t "shared" ] [-p <project_id>] | [-O <organization_id>] -T <service_token_type>
metal interconnections create -n <name> [-m <metro>] [-r <redundancy>] [-t "shared" ] [-p <project_id>] | [-O <organization_id>] -T <service_token_type> -v <vrfs>
```

### Options

```
-h, --help help for create
-m, --metro string metro in the interconnection
-n, --name string Name of the interconnection
-O, --organizationID string Org ID
-p, --projectID string project ID
-r, --redundancy string Website URL of the organization.
-t, --type string type of of interconnection.
-v, --vrfs strings Return only the specified vrfs.
```

### Options inherited from parent commands

```
--config string Path to JSON or YAML configuration file
--exclude strings Comma separated Href references to collapse in results, may be dotted three levels deep
--filter stringArray Filter 'get' actions with name value pairs. Filter is not supported by all resources and is implemented as request query parameters.
--http-header strings Headers to add to requests (in format key=value)
--include strings Comma separated Href references to expand in results, may be dotted three levels deep
-o, --output string Output format (*table, json, yaml). env output formats are (*sh, terraform, capp).
--search string Search keyword for use in 'get' actions. Search is not supported by all resources.
--sort-by string Sort fields for use in 'get' actions. Sort is not supported by all resources.
--sort-dir string Sort field direction for use in 'get' actions. Sort is not supported by all resources.
--token string Metal API Token (METAL_AUTH_TOKEN)
```

### SEE ALSO

* [metal interconnections](metal_interconnections.md) - interconnections operations: create, get, update, delete

45 changes: 45 additions & 0 deletions docs/metal_interconnections_delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
## metal interconnections delete

Deletes a interconnection.

### Synopsis

Deletes the specified interconnection.

```
metal interconnections delete -i <connection_id> [flags]
```

### Examples

```
# Deletes the specified interconnection:
metal interconnections delete -i 7ec86e23-8dcf-48ed-bd9b-c25c20958277
```

### Options

```
-h, --help help for delete
-i, --id string The UUID of the interconnection.
```

### Options inherited from parent commands

```
--config string Path to JSON or YAML configuration file
--exclude strings Comma separated Href references to collapse in results, may be dotted three levels deep
--filter stringArray Filter 'get' actions with name value pairs. Filter is not supported by all resources and is implemented as request query parameters.
--http-header strings Headers to add to requests (in format key=value)
--include strings Comma separated Href references to expand in results, may be dotted three levels deep
-o, --output string Output format (*table, json, yaml). env output formats are (*sh, terraform, capp).
--search string Search keyword for use in 'get' actions. Search is not supported by all resources.
--sort-by string Sort fields for use in 'get' actions. Sort is not supported by all resources.
--sort-dir string Sort field direction for use in 'get' actions. Sort is not supported by all resources.
--token string Metal API Token (METAL_AUTH_TOKEN)
```

### SEE ALSO

* [metal interconnections](metal_interconnections.md) - interconnections operations: create, get, update, delete

55 changes: 55 additions & 0 deletions docs/metal_interconnections_get.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
## metal interconnections get

Retrieves interconnections for the current user, an organization, a project or the details of a specific interconnection.

### Synopsis

Retrieves interconnections for the current user, an organization, a project or the details of a specific interconnection.

```
metal interconnections get [flags]
```

### Examples

```
# Retrieve all interconnections of a current user::
# Retrieve the details of a specific interconnection:
metal interconnections get -i e9a969b3-8911-4667-9d99-57cd3dd4ef6f
# Retrieve all the interconnection of an organization:
metal interconnections get -O c079178c-9557-48f2-9ce7-cfb927b81928
# Retrieve all interconnection of a project:
metal interconnections get -p 1867ee8f-6a11-470a-9505-952d6a324040
```

### Options

```
-i, --connID string UUID of the interconnection
-h, --help help for get
-O, --organizationID string UUID of the organization
-p, --projectID string Project ID (METAL_PROJECT_ID)
```

### Options inherited from parent commands

```
--config string Path to JSON or YAML configuration file
--exclude strings Comma separated Href references to collapse in results, may be dotted three levels deep
--filter stringArray Filter 'get' actions with name value pairs. Filter is not supported by all resources and is implemented as request query parameters.
--http-header strings Headers to add to requests (in format key=value)
--include strings Comma separated Href references to expand in results, may be dotted three levels deep
-o, --output string Output format (*table, json, yaml). env output formats are (*sh, terraform, capp).
--search string Search keyword for use in 'get' actions. Search is not supported by all resources.
--sort-by string Sort fields for use in 'get' actions. Sort is not supported by all resources.
--sort-dir string Sort field direction for use in 'get' actions. Sort is not supported by all resources.
--token string Metal API Token (METAL_AUTH_TOKEN)
```

### SEE ALSO

* [metal interconnections](metal_interconnections.md) - interconnections operations: create, get, update, delete

51 changes: 51 additions & 0 deletions docs/metal_interconnections_update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
## metal interconnections update

Updates a connection.

### Synopsis

Updates a specified connection.

```
metal interconnections update -i <connection_id> [flags]
```

### Examples

```
# Updates a specified connection.:
metal interconnections update --id 30c15082-a06e-4c43-bfc3-252616b46eba -n [<name>] -d [<description>] -r [<'redundant'|'primary'>]-m [<standard|tunnel>] -e [<E-mail>] --tags="tag1,tag2"
```

### Options

```
-e, --contactEmail string adds or updates the Email
-d, --description string Adds or updates the description for the interconnection.
-h, --help help for update
-i, --id string The UUID of the interconnection.
-m, --mode string Adds or updates the mode for the interconnection.
-n, --name string The new name of the interconnection.
-r, --redundancy string Updating from 'redundant' to 'primary' will remove a secondary port, while updating from 'primary' to 'redundant' will add one.
-t, --tags strings Adds or updates the tags for the connection --tags="tag1,tag2".
```

### Options inherited from parent commands

```
--config string Path to JSON or YAML configuration file
--exclude strings Comma separated Href references to collapse in results, may be dotted three levels deep
--filter stringArray Filter 'get' actions with name value pairs. Filter is not supported by all resources and is implemented as request query parameters.
--http-header strings Headers to add to requests (in format key=value)
--include strings Comma separated Href references to expand in results, may be dotted three levels deep
-o, --output string Output format (*table, json, yaml). env output formats are (*sh, terraform, capp).
--search string Search keyword for use in 'get' actions. Search is not supported by all resources.
--sort-by string Sort fields for use in 'get' actions. Sort is not supported by all resources.
--sort-dir string Sort field direction for use in 'get' actions. Sort is not supported by all resources.
--token string Metal API Token (METAL_AUTH_TOKEN)
```

### SEE ALSO

* [metal interconnections](metal_interconnections.md) - interconnections operations: create, get, update, delete

10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ module github.com/equinix/metal-cli
go 1.19

require (
github.com/equinix-labs/metal-go v0.25.0
github.com/equinix-labs/metal-go v0.26.0
github.com/manifoldco/promptui v0.9.0
github.com/olekukonko/tablewriter v0.0.5
github.com/packethost/packngo v0.30.0
github.com/spf13/cobra v1.7.0
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.17.0
github.com/stretchr/testify v1.8.4
golang.org/x/term v0.13.0
golang.org/x/term v0.14.0
sigs.k8s.io/yaml v1.3.0
)

require (
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
Expand All @@ -37,7 +37,7 @@ require (
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/sys v0.14.0 // indirect
golang.org/x/text v0.13.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
20 changes: 10 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM=
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
Expand All @@ -63,8 +63,8 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m
github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po=
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/equinix-labs/metal-go v0.25.0 h1:AgMwoRYhfqPSkGu1FFLlyVCFBRy/xiBgnfiydMtw7jY=
github.com/equinix-labs/metal-go v0.25.0/go.mod h1:SmxCklxW+KjmBLVMdEXgtFO5gD5/b4N0VxcNgUYbOH4=
github.com/equinix-labs/metal-go v0.26.0 h1:0rBTyjF8j58dg++kMFLRi9Jhs5gng5BFn5Y0bl5NPtM=
github.com/equinix-labs/metal-go v0.26.0/go.mod h1:SmxCklxW+KjmBLVMdEXgtFO5gD5/b4N0VxcNgUYbOH4=
github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
Expand Down Expand Up @@ -179,8 +179,8 @@ github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY=
github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ=
github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA=
github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48=
github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.17.0 h1:I5txKw7MJasPL/BrfkbA0Jyo/oELqVmux4pR/UxOMfI=
Expand Down Expand Up @@ -345,11 +345,11 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek=
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
golang.org/x/term v0.14.0 h1:LGK9IlZ8T9jvdy6cTdfKUCltatMFOehAQo9SRC46UQ8=
golang.org/x/term v0.14.0/go.mod h1:TySc+nGkYR6qt8km8wUhuFRTVSMIX3XPR58y2lC8vww=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down
Loading

0 comments on commit 4b87ce6

Please sign in to comment.