-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
304 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
cmd/scw/testdata/test-all-usage-ipam-ip-create-usage.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 | ||
🟥🟥🟥 STDERR️️ 🟥🟥🟥️ | ||
Book a new IP from the specified source. Currently IPs can only be booked from a Private Network. | ||
|
||
USAGE: | ||
scw ipam ip create [arg=value ...] | ||
|
||
ARGS: | ||
[project-id] Project ID to use. If none is passed the default project ID will be used | ||
[source.zonal] Zone the IP lives in if the IP is a public zoned IP. | ||
[source.private-network-id] Private Network the IP lives in if the IP is a private IP. | ||
[source.subnet-id] Private Network subnet the IP lives in if the IP is a private IP in a Private Network. | ||
[is-ipv6] Request an IPv6 instead of an IPv4 | ||
[address] Request a specific IP in the requested source pool | ||
[tags.{index}] Tags for the IP | ||
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw) | ||
|
||
FLAGS: | ||
-h, --help help for create | ||
|
||
GLOBAL FLAGS: | ||
-c, --config string The path to the config file | ||
-D, --debug Enable debug mode | ||
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human") | ||
-p, --profile string The config profile to use |
19 changes: 19 additions & 0 deletions
19
cmd/scw/testdata/test-all-usage-ipam-ip-delete-usage.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 | ||
🟥🟥🟥 STDERR️️ 🟥🟥🟥️ | ||
Release an IP not currently attached to a resource, and returns it to the available IP pool. | ||
|
||
USAGE: | ||
scw ipam ip delete <ip-id ...> [arg=value ...] | ||
|
||
ARGS: | ||
ip-id IP ID | ||
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw) | ||
|
||
FLAGS: | ||
-h, --help help for delete | ||
|
||
GLOBAL FLAGS: | ||
-c, --config string The path to the config file | ||
-D, --debug Enable debug mode | ||
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human") | ||
-p, --profile string The config profile to use |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 | ||
🟥🟥🟥 STDERR️️ 🟥🟥🟥️ | ||
Retrieve details of an existing IP, specified by its IP ID. | ||
|
||
USAGE: | ||
scw ipam ip get <ip-id ...> [arg=value ...] | ||
|
||
ARGS: | ||
ip-id IP ID | ||
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw) | ||
|
||
FLAGS: | ||
-h, --help help for get | ||
|
||
GLOBAL FLAGS: | ||
-c, --config string The path to the config file | ||
-D, --debug Enable debug mode | ||
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human") | ||
-p, --profile string The config profile to use |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 | ||
🟥🟥🟥 STDERR️️ 🟥🟥🟥️ | ||
List existing IPs in the specified region using various filters. For example, you can filter for IPs within a specified Private Network, or for public IPs within a specified Project. By default, the IPs returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. | ||
|
||
USAGE: | ||
scw ipam ip list [arg=value ...] | ||
|
||
ARGS: | ||
[order-by] Sort order of the returned IPs (created_at_desc | created_at_asc | updated_at_desc | updated_at_asc | attached_at_desc | attached_at_asc) | ||
[project-id] Project ID to filter for. Only IPs belonging to this Project will be returned | ||
[zonal] Zone to filter for. Only IPs that are zonal, and in this zone, will be returned | ||
[private-network-id] Private Network to filter for | ||
[attached] Defines whether to filter only for IPs which are attached to a resource | ||
[resource-id] Resource ID to filter for. Only IPs attached to this resource will be returned | ||
[resource-type] Resource type to filter for. Only IPs attached to this type of resource will be returned (unknown_type | instance_server | instance_ip | instance_private_nic | lb_server | fip_ip | vpc_gateway | vpc_gateway_network | k8s_node | k8s_cluster | rdb_instance | redis_cluster | baremetal_server | baremetal_private_nic) | ||
[mac-address] MAC address to filter for. Only IPs attached to a resource with this MAC address will be returned | ||
[tags.{index}] Tags to filter for, only IPs with one or more matching tags will be returned | ||
[is-ipv6] Defines whether to filter only for IPv4s or IPv6s | ||
[resource-name] Attached resource name to filter for, only IPs attached to a resource with this string within their name will be returned. | ||
[organization-id] Organization ID to filter for. Only IPs belonging to this Organization will be returned | ||
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw | all) | ||
|
||
FLAGS: | ||
-h, --help help for list | ||
|
||
GLOBAL FLAGS: | ||
-c, --config string The path to the config file | ||
-D, --debug Enable debug mode | ||
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human") | ||
-p, --profile string The config profile to use |
20 changes: 20 additions & 0 deletions
20
cmd/scw/testdata/test-all-usage-ipam-ip-update-usage.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 | ||
🟥🟥🟥 STDERR️️ 🟥🟥🟥️ | ||
Update parameters including tags of the specified IP. | ||
|
||
USAGE: | ||
scw ipam ip update <ip-id ...> [arg=value ...] | ||
|
||
ARGS: | ||
ip-id IP ID | ||
[tags.{index}] Tags for the IP | ||
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw) | ||
|
||
FLAGS: | ||
-h, --help help for update | ||
|
||
GLOBAL FLAGS: | ||
-c, --config string The path to the config file | ||
-D, --debug Enable debug mode | ||
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human") | ||
-p, --profile string The config profile to use |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 | ||
🟥🟥🟥 STDERR️️ 🟥🟥🟥️ | ||
*ips_long. | ||
|
||
USAGE: | ||
scw ipam ip <command> | ||
|
||
AVAILABLE COMMANDS: | ||
create Book a new IP | ||
delete Release an IP | ||
get Get an IP | ||
list List existing IPs | ||
update Update an IP | ||
|
||
FLAGS: | ||
-h, --help help for ip | ||
|
||
GLOBAL FLAGS: | ||
-c, --config string The path to the config file | ||
-D, --debug Enable debug mode | ||
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human") | ||
-p, --profile string The config profile to use | ||
|
||
Use "scw ipam ip [command] --help" for more information about a command. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 | ||
🟥🟥🟥 STDERR️️ 🟥🟥🟥️ | ||
This API allows you to manage IP addresses with Scaleway's IP Address Management tool. | ||
|
||
USAGE: | ||
scw ipam <command> | ||
|
||
AVAILABLE COMMANDS: | ||
ip IP management command | ||
|
||
FLAGS: | ||
-h, --help help for ipam | ||
|
||
GLOBAL FLAGS: | ||
-c, --config string The path to the config file | ||
-D, --debug Enable debug mode | ||
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human") | ||
-p, --profile string The config profile to use | ||
|
||
Use "scw ipam [command] --help" for more information about a command. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
<!-- DO NOT EDIT: this file is automatically generated using scw-doc-gen --> | ||
# Documentation for `scw ipam` | ||
This API allows you to manage IP addresses with Scaleway's IP Address Management tool. | ||
|
||
- [IP management command](#ip-management-command) | ||
- [Book a new IP](#book-a-new-ip) | ||
- [Release an IP](#release-an-ip) | ||
- [Get an IP](#get-an-ip) | ||
- [List existing IPs](#list-existing-ips) | ||
- [Update an IP](#update-an-ip) | ||
|
||
|
||
## IP management command | ||
|
||
*ips_long. | ||
|
||
|
||
### Book a new IP | ||
|
||
Book a new IP from the specified source. Currently IPs can only be booked from a Private Network. | ||
|
||
**Usage:** | ||
|
||
``` | ||
scw ipam ip create [arg=value ...] | ||
``` | ||
|
||
|
||
**Args:** | ||
|
||
| Name | | Description | | ||
|------|---|-------------| | ||
| project-id | | Project ID to use. If none is passed the default project ID will be used | | ||
| source.zonal | | Zone the IP lives in if the IP is a public zoned IP. | | ||
| source.private-network-id | | Private Network the IP lives in if the IP is a private IP. | | ||
| source.subnet-id | | Private Network subnet the IP lives in if the IP is a private IP in a Private Network. | | ||
| is-ipv6 | | Request an IPv6 instead of an IPv4 | | ||
| address | | Request a specific IP in the requested source pool | | ||
| tags.{index} | | Tags for the IP | | ||
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | | ||
|
||
|
||
|
||
### Release an IP | ||
|
||
Release an IP not currently attached to a resource, and returns it to the available IP pool. | ||
|
||
**Usage:** | ||
|
||
``` | ||
scw ipam ip delete <ip-id ...> [arg=value ...] | ||
``` | ||
|
||
|
||
**Args:** | ||
|
||
| Name | | Description | | ||
|------|---|-------------| | ||
| ip-id | Required | IP ID | | ||
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | | ||
|
||
|
||
|
||
### Get an IP | ||
|
||
Retrieve details of an existing IP, specified by its IP ID. | ||
|
||
**Usage:** | ||
|
||
``` | ||
scw ipam ip get <ip-id ...> [arg=value ...] | ||
``` | ||
|
||
|
||
**Args:** | ||
|
||
| Name | | Description | | ||
|------|---|-------------| | ||
| ip-id | Required | IP ID | | ||
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | | ||
|
||
|
||
|
||
### List existing IPs | ||
|
||
List existing IPs in the specified region using various filters. For example, you can filter for IPs within a specified Private Network, or for public IPs within a specified Project. By default, the IPs returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. | ||
|
||
**Usage:** | ||
|
||
``` | ||
scw ipam ip list [arg=value ...] | ||
``` | ||
|
||
|
||
**Args:** | ||
|
||
| Name | | Description | | ||
|------|---|-------------| | ||
| order-by | One of: `created_at_desc`, `created_at_asc`, `updated_at_desc`, `updated_at_asc`, `attached_at_desc`, `attached_at_asc` | Sort order of the returned IPs | | ||
| project-id | | Project ID to filter for. Only IPs belonging to this Project will be returned | | ||
| zonal | | Zone to filter for. Only IPs that are zonal, and in this zone, will be returned | | ||
| private-network-id | | Private Network to filter for | | ||
| attached | | Defines whether to filter only for IPs which are attached to a resource | | ||
| resource-id | | Resource ID to filter for. Only IPs attached to this resource will be returned | | ||
| resource-type | One of: `unknown_type`, `instance_server`, `instance_ip`, `instance_private_nic`, `lb_server`, `fip_ip`, `vpc_gateway`, `vpc_gateway_network`, `k8s_node`, `k8s_cluster`, `rdb_instance`, `redis_cluster`, `baremetal_server`, `baremetal_private_nic` | Resource type to filter for. Only IPs attached to this type of resource will be returned | | ||
| mac-address | | MAC address to filter for. Only IPs attached to a resource with this MAC address will be returned | | ||
| tags.{index} | | Tags to filter for, only IPs with one or more matching tags will be returned | | ||
| is-ipv6 | | Defines whether to filter only for IPv4s or IPv6s | | ||
| resource-name | | Attached resource name to filter for, only IPs attached to a resource with this string within their name will be returned. | | ||
| organization-id | | Organization ID to filter for. Only IPs belonging to this Organization will be returned | | ||
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw`, `all` | Region to target. If none is passed will use default region from the config | | ||
|
||
|
||
|
||
### Update an IP | ||
|
||
Update parameters including tags of the specified IP. | ||
|
||
**Usage:** | ||
|
||
``` | ||
scw ipam ip update <ip-id ...> [arg=value ...] | ||
``` | ||
|
||
|
||
**Args:** | ||
|
||
| Name | | Description | | ||
|------|---|-------------| | ||
| ip-id | Required | IP ID | | ||
| tags.{index} | | Tags for the IP | | ||
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package ipam | ||
|
||
import "github.com/scaleway/scaleway-cli/v2/internal/core" | ||
|
||
func GetCommands() *core.Commands { | ||
cmds := GetGeneratedCommands() | ||
|
||
return cmds | ||
} |