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

feat: Enabled virtual-circuit sub commands in metal-cli #369

Merged
merged 1 commit into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cmd/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"github.com/equinix/metal-cli/internal/ssh"
"github.com/equinix/metal-cli/internal/twofa"
"github.com/equinix/metal-cli/internal/users"
"github.com/equinix/metal-cli/internal/virtualcircuit"
"github.com/equinix/metal-cli/internal/vlan"
"github.com/equinix/metal-cli/internal/vrf"
)
Expand Down Expand Up @@ -97,5 +98,6 @@ func (cli *Cli) RegisterCommands(client *root.Client) {
ports.NewClient(client, cli.Outputer).NewCommand(),
interconnections.NewClient(client, cli.Outputer).NewCommand(),
vrf.NewClient(client, cli.Outputer).NewCommand(),
virtualcircuit.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 @@ -46,6 +46,7 @@ Command line interface for Equinix Metal
* [metal project](metal_project.md) - Project operations: create, get, update, delete, and bgp-enable, bgp-config, bgp-sessions.
* [metal ssh-key](metal_ssh-key.md) - SSH key operations: create, get, update, and delete.
* [metal user](metal_user.md) - User operations: get and add.
* [metal virtual-circuit](metal_virtual-circuit.md) - virtual-circuit operations: create, get, update, delete
* [metal virtual-network](metal_virtual-network.md) - Virtual network (VLAN) operations : create, get, delete.
* [metal vrf](metal_vrf.md) - VRF operations : create, get, delete

37 changes: 37 additions & 0 deletions docs/metal_virtual-circuit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
## metal virtual-circuit

virtual-circuit operations: create, get, update, delete

### Synopsis

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

### Options

```
-h, --help help for virtual-circuit
```

### Options inherited from parent commands

```
--config string Path to JSON or YAML configuration file (METAL_CONFIG)
--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 virtual-circuit create](metal_virtual-circuit_create.md) - Creates an create-virtual-circuit for specific interconnection.
* [metal virtual-circuit delete](metal_virtual-circuit_delete.md) - Deletes a virtual-circuit.
* [metal virtual-circuit get](metal_virtual-circuit_get.md) - Retrieves virtual circuit for a specific circuit Id.
* [metal virtual-circuit update](metal_virtual-circuit_update.md) - Updates a virtualcircuit.

63 changes: 63 additions & 0 deletions docs/metal_virtual-circuit_create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
## metal virtual-circuit create

Creates an create-virtual-circuit for specific interconnection.

### Synopsis

Creates an create-virtual-circuit for specific interconnection

```
metal virtual-circuit create [-c connection_id] [-p port_id] [-P <project_id> ] -n <name> [-d <description>] [--vnid <vnid> ] [-V <vlan> ] [-s <speed> ] [-t <tags> ] [flags]
```

### Examples

```
# Creates a new virtual-circuit named "interconnection":
metal vc create [-c connection_id] [-p port_id] [-P <project_id> ] [-n <name>] [-d <description>] [--vnid <vnid> ] [-V <vlan> ] [-s <speed> ] [-t <tags> ]
metal vc create -c 81c9cb9e-b02f-4c73-9e04-06702f1380a0 -p 9c8f0c71-591d-42fe-9519-2f632761e2da -P b4673e33-0f48-4948-961a-c31d6edf64f8 -n test-inter -d test-interconnection -v 15315810-2fda-48b8-b8cd-441ebab684b5 -V 1010 -s 100
metal vc create [-c connection_id] [-p port_id] [-P <project_id> ] [-n <name>] [-d <description>] [-v <vrf-id>] [-M <md5sum>] [-a <peer-asn>] [-S <subnet>] [-c <customer_ip>] [-m <metal_ip>]
```

### Options

```
-c, --connection-id string Specify the UUID of the interconnection.
--customer-ip string An IP address from the subnet that will be used on the Customer side
-d, --description string Description for a Virtual Circuit
-h, --help help for create
-M, --md5 string The plaintext BGP peering password shared by neighbors as an MD5 checksum
-m, --metal-ip string An IP address from the subnet that will be used on the Metal side.
-n, --name string Name of the Virtual Circuit
-a, --peer-asn int The peer ASN that will be used with the VRF on the Virtual Circuit.
-p, --port-id string Specify the UUID of the port.
-P, --project-id string The project's UUID. This flag is required, unless specified in the config created by metal init or set as METAL_PROJECT_ID environment variable.
-s, --speed int bps speed or string (e.g. 52 - '52m' or '100g' or '4 gbps')
-S, --subnet string The /30 or /31 subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit.
-t, --tags strings Adds the tags for the virtual-circuit --tags "tag1,tag2" OR --tags "tag1" --tags "tag2"
-V, --vlan int Adds or updates vlan Must be between 2 and 4094
--vnid string Specify the UUID of the VLAN.
-v, --vrf-id string The UUID of the VRF that will be associated with the Virtual Circuit.
```

### Options inherited from parent commands

```
--config string Path to JSON or YAML configuration file (METAL_CONFIG)
--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 virtual-circuit](metal_virtual-circuit.md) - virtual-circuit operations: create, get, update, delete

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

Deletes a virtual-circuit.

### Synopsis

Deletes the specified virtual-circuit.

```
metal virtual-circuit delete -i <virtual-circuit_id> [flags]
```

### Examples

```
# Deletes the specified virtual-circuit:
metal vc delete -i 7ec86e23-8dcf-48ed-bd9b-c25c20958277
```

### Options

```
-h, --help help for delete
-i, --id string Specify the UUID of the virtual-circuit.
```

### Options inherited from parent commands

```
--config string Path to JSON or YAML configuration file (METAL_CONFIG)
--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 virtual-circuit](metal_virtual-circuit.md) - virtual-circuit operations: create, get, update, delete

47 changes: 47 additions & 0 deletions docs/metal_virtual-circuit_get.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
## metal virtual-circuit get

Retrieves virtual circuit for a specific circuit Id.

### Synopsis

Retrieves virtual circuit for a specific circuit Id.

```
metal virtual-circuit get -i <id> [flags]
```

### Examples

```
# Retrieve virtual circuit for a specific circuit::
# Retrieve the details of a specific virtual-circuit:
metal vc get -i e9a969b3-8911-4667-9d99-57cd3dd4ef6f
```

### Options

```
-h, --help help for get
-i, --id string Specify UUID of the virtual-circuit
```

### Options inherited from parent commands

```
--config string Path to JSON or YAML configuration file (METAL_CONFIG)
--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 virtual-circuit](metal_virtual-circuit.md) - virtual-circuit operations: create, get, update, delete

60 changes: 60 additions & 0 deletions docs/metal_virtual-circuit_update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
## metal virtual-circuit update

Updates a virtualcircuit.

### Synopsis

Updates a specified virtualcircuit etiher of vlanID OR vrfID

```
metal virtual-circuit update -i <id> [-v <vlan UUID>] [-d <description>] [-n <name>] [-s <speed>] [-t <tags>] [flags]
```

### Examples

```
# Updates a specified virtualcircuit etiher of vlanID OR vrfID:
metal vc update [-i <id>] [-n <name>] [-d <description>] [-v <vnid> ] [-s <speed> ] [-t <tags> ]
metal vc update -i e2edb90b-a8ef-47cb-a577-63b0ba129c29 -d "test-inter-fri-dedicated"
metal vc update [-i <id>] [-n <name>] [-d <description>] [-M <md5sum>] [-a <peer-asn>] [-S <subnet>] [-c <customer-ip>] [-m <metal-ip>] [-t <tags> ]
```

### Options

```
-c, --customer-ip string An IP address from the subnet that will be used on the Customer side
-d, --description string Description for a Virtual Circuit
-h, --help help for update
-i, --id string Specify the UUID of the virtual-circuit.
-M, --md5 string The plaintext BGP peering password shared by neighbors as an MD5 checksum
-m, --metal-ip string An IP address from the subnet that will be used on the Metal side.
-n, --name string Name of the Virtual Circuit
-a, --peer-asn int The peer ASN that will be used with the VRF on the Virtual Circuit.
-s, --speed string Adds or updates Speed can be changed only if it is an interconnection on a Dedicated Port
-S, --subnet string The /30 or /31 subnet of one of the VRF IP Blocks that will be used with the VRF for the Virtual Circuit.
-t, --tags strings updates the tags for the virtual circuit --tags "tag1,tag2" OR --tags "tag1" --tags "tag2" (NOTE: --tags "" will remove all tags from the virtual circuit
-v, --vnid string A Virtual Network record UUID or the VNID of a Metro Virtual Network in your project.
```

### Options inherited from parent commands

```
--config string Path to JSON or YAML configuration file (METAL_CONFIG)
--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 virtual-circuit](metal_virtual-circuit.md) - virtual-circuit operations: create, get, update, delete

Loading
Loading