Skip to content

Commit

Permalink
Merge branch 'master' into feat/create-cli-doc-website-poc
Browse files Browse the repository at this point in the history
  • Loading branch information
SamyOubouaziz authored Nov 25, 2024
2 parents 0ce139b + 86fd6ca commit a08a2b1
Show file tree
Hide file tree
Showing 229 changed files with 32,178 additions and 15,354 deletions.
2 changes: 0 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ linters:
- depguard # Go linter that checks if package imports are in a list of acceptable packages [fast: true, auto-fix: false]
- dupl # Tool for code clone detection [fast: true, auto-fix: false]
- errorlint # errorlint is a linter for that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13. [fast: false, auto-fix: false]
- execinquery # execinquery is a linter about query string checker in Query function which reads your Go src files and warning it finds [fast: false, auto-fix: false]
- exhaustive # check exhaustiveness of enum switch statements [fast: false, auto-fix: false]
- forcetypeassert # finds forced type assertions [fast: true, auto-fix: false]
- funlen # Tool for detection of long functions [fast: true, auto-fix: false]
Expand All @@ -89,7 +88,6 @@ linters:
- godot # Check if comments end in a period [fast: true, auto-fix: true]
- godox # Tool for detection of FIXME, TODO and other comment keywords [fast: true, auto-fix: false]
- err113 # Golang linter to check the errors handling expressions [fast: false, auto-fix: false]
- gomnd # An analyzer to detect magic numbers. [fast: true, auto-fix: false]
- lll # Reports long lines [fast: true, auto-fix: false]
- maintidx # maintidx measures the maintainability index of each function. [fast: true, auto-fix: false]
- nestif # Reports deeply nested if statements [fast: true, auto-fix: false]
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ To enable beta features, you can set `SCW_ENABLE_BETA=1` in your environment.
| `instance` | Instance API | [CLI](./docs/commands/instance.md) / [API](https://www.scaleway.com/en/developers/api/instance/) |
| `iot` | IoT API | [CLI](./docs/commands/iot.md) / [API](https://www.scaleway.com/en/developers/api/iot/) |
| `ipam` | IPAM API | [CLI](./docs/commands/ipam.md) / [API](https://www.scaleway.com/en/developers/api/ipam/) |
| `jobs` | Serverless Jobs API | [CLI](./docs/commands/jobs.md) / [API](https://www.scaleway.com/en/developers/api/serverless-jobs/) |
| `k8s` | Kapsule API | [CLI](./docs/commands/k8s.md) / [API](https://www.scaleway.com/en/developers/api/kubernetes/) |
| `lb` | Load Balancer API | [CLI](./docs/commands/lb.md) / [API](https://www.scaleway.com/en/developers/api/load-balancer/zoned-api/) |
| `marketplace` | Marketplace API | [CLI](./docs/commands/marketplace.md) |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Allows to customize the partitioning schemas of your servers (available on some offers and OSs).

USAGE:
scw baremetal partitioning-schemas

FLAGS:
-h, --help help for partitioning-schemas

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
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,36 @@ EXAMPLES:
scw baremetal server create

ARGS:
[project-id] Project ID to use. If none is passed the default project ID will be used
name=<generated> Name of the server (≠hostname)
[description] Description associated with the server, max 255 characters
[type] Server commercial type
[tags.{index}] Tags to associate to the server
[install.os-id] ID of the OS to installation on the server
[install.hostname] Hostname of the server
[install.ssh-key-ids.{index}] SSH key IDs authorized on the server
[install.user] User for the installation
[install.password] Password for the installation
[install.service-user] Regular user that runs the service to be installed on the server
[install.service-password] Password used for the service to install
[option-ids.{index}] IDs of options to enable on server
[organization-id] Organization ID to use. If none is passed the default organization ID will be used
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | nl-ams-2 | pl-waw-2 | pl-waw-3)
[project-id] Project ID to use. If none is passed the default project ID will be used
name=<generated> Name of the server (≠hostname)
[description] Description associated with the server, max 255 characters
[type] Server commercial type
[tags.{index}] Tags to associate to the server
[install.os-id] ID of the OS to installation on the server
[install.hostname] Hostname of the server
[install.ssh-key-ids.{index}] SSH key IDs authorized on the server
[install.user] User for the installation
[install.password] Password for the installation
[install.service-user] Regular user that runs the service to be installed on the server
[install.service-password] Password used for the service to install
[install.partitioning-schema.disks.{index}.device]
[install.partitioning-schema.disks.{index}.partitions.{index}.label] (unknown_partition_label | uefi | legacy | root | boot | swap | data | home | raid | zfs)
[install.partitioning-schema.disks.{index}.partitions.{index}.number]
[install.partitioning-schema.disks.{index}.partitions.{index}.size]
[install.partitioning-schema.raids.{index}.name]
[install.partitioning-schema.raids.{index}.level] (unknown_raid_level | raid_level_0 | raid_level_1 | raid_level_5 | raid_level_6 | raid_level_10)
[install.partitioning-schema.raids.{index}.devices.{index}]
[install.partitioning-schema.filesystems.{index}.device]
[install.partitioning-schema.filesystems.{index}.format] (unknown_format | fat32 | ext4 | swap | zfs | xfs)
[install.partitioning-schema.filesystems.{index}.mountpoint]
[install.partitioning-schema.zfs.pools.{index}.name]
[install.partitioning-schema.zfs.pools.{index}.type] (unknown_type | no_raid | mirror | raidz1 | raidz2)
[install.partitioning-schema.zfs.pools.{index}.devices.{index}]
[install.partitioning-schema.zfs.pools.{index}.options.{index}]
[install.partitioning-schema.zfs.pools.{index}.filesystem-options.{index}]
[option-ids.{index}] IDs of options to enable on server
[organization-id] Organization ID to use. If none is passed the default organization ID will be used
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | nl-ams-2 | pl-waw-2 | pl-waw-3)

FLAGS:
-h, --help help for create
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,28 @@ ARGS:
os-id ID of the OS to installation on the server
hostname Hostname of the server
ssh (one of):
[all-ssh-keys] Add all SSH keys on your baremetal instance (cannot be used with ssh-key-ids)
ssh-key-ids.{index} SSH key IDs authorized on the server (cannot be used with all-ssh-keys)
[user] User used for the installation
[password] Password used for the installation
[service-user] User used for the service to install
[service-password] Password used for the service to install
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | nl-ams-2 | pl-waw-2 | pl-waw-3)
[all-ssh-keys] Add all SSH keys on your baremetal instance (cannot be used with ssh-key-ids)
ssh-key-ids.{index} SSH key IDs authorized on the server (cannot be used with all-ssh-keys)
[user] User used for the installation
[password] Password used for the installation
[service-user] User used for the service to install
[service-password] Password used for the service to install
[partitioning-schema.disks.{index}.device]
[partitioning-schema.disks.{index}.partitions.{index}.label] (unknown_partition_label | uefi | legacy | root | boot | swap | data | home | raid | zfs)
[partitioning-schema.disks.{index}.partitions.{index}.number]
[partitioning-schema.disks.{index}.partitions.{index}.size]
[partitioning-schema.raids.{index}.name]
[partitioning-schema.raids.{index}.level] (unknown_raid_level | raid_level_0 | raid_level_1 | raid_level_5 | raid_level_6 | raid_level_10)
[partitioning-schema.raids.{index}.devices.{index}]
[partitioning-schema.filesystems.{index}.device]
[partitioning-schema.filesystems.{index}.format] (unknown_format | fat32 | ext4 | swap | zfs | xfs)
[partitioning-schema.filesystems.{index}.mountpoint]
[partitioning-schema.zfs.pools.{index}.name]
[partitioning-schema.zfs.pools.{index}.type] (unknown_type | no_raid | mirror | raidz1 | raidz2)
[partitioning-schema.zfs.pools.{index}.devices.{index}]
[partitioning-schema.zfs.pools.{index}.options.{index}]
[partitioning-schema.zfs.pools.{index}.filesystem-options.{index}]
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | nl-ams-2 | pl-waw-2 | pl-waw-3)

FLAGS:
-h, --help help for install
Expand Down
15 changes: 8 additions & 7 deletions cmd/scw/testdata/test-all-usage-baremetal-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ USAGE:
scw baremetal <command>

AVAILABLE COMMANDS:
bmc Baseboard Management Controller (BMC) management commands
offer Server offer management commands
options Server options management commands
os Operating System (OS) management commands
private-network Private Network management command
server Server management commands
settings Settings management commands
bmc Baseboard Management Controller (BMC) management commands
offer Server offer management commands
options Server options management commands
os Operating System (OS) management commands
partitioning-schemas Partitioning-schemas management commands
private-network Private Network management command
server Server management commands
settings Settings management commands

FLAGS:
-h, --help help for baremetal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ USAGE:
scw block snapshot create [arg=value ...]

ARGS:
[volume-id] UUID of the volume to snapshot
[name] Name of the snapshot
[project-id] Project ID to use. If none is passed the default project ID will be used
[tags.{index}] List of tags assigned to the snapshot
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | nl-ams-2 | nl-ams-3 | pl-waw-3)
[volume-id] UUID of the volume to snapshot
[name=<generated>] Name of the snapshot
[project-id] Project ID to use. If none is passed the default project ID will be used
[tags.{index}] List of tags assigned to the snapshot
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | fr-par-3 | nl-ams-1 | nl-ams-2 | nl-ams-3 | pl-waw-1 | pl-waw-2 | pl-waw-3)

FLAGS:
-h, --help help for create
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
You must specify the `snapshot_id` of the snapshot you want to delete. The snapshot must not be in use.

USAGE:
scw block snapshot delete [arg=value ...]
scw block snapshot delete <snapshot-id ...> [arg=value ...]

ARGS:
snapshot-id UUID of the snapshot
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | nl-ams-2 | nl-ams-3 | pl-waw-3)
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | fr-par-3 | nl-ams-1 | nl-ams-2 | nl-ams-3 | pl-waw-1 | pl-waw-2 | pl-waw-3)

FLAGS:
-h, --help help for delete
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ARGS:
snapshot-id UUID of the snapshot
[bucket] Scaleway Object Storage bucket where the object is stored
[key] The object key inside the given bucket
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | nl-ams-2 | nl-ams-3 | pl-waw-3)
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | fr-par-3 | nl-ams-1 | nl-ams-2 | nl-ams-3 | pl-waw-1 | pl-waw-2 | pl-waw-3)

FLAGS:
-h, --help help for export-to-object-storage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ USAGE:

ARGS:
snapshot-id UUID of the snapshot
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | nl-ams-2 | nl-ams-3 | pl-waw-3)
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | fr-par-3 | nl-ams-1 | nl-ams-2 | nl-ams-3 | pl-waw-1 | pl-waw-2 | pl-waw-3)

FLAGS:
-h, --help help for get
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
The bucket must contain a QCOW2 image.
The bucket can be imported into any Availability Zone as long as it is in the same region as the bucket.

USAGE:
scw block snapshot import-from-object-storage [arg=value ...]

ARGS:
[bucket] Scaleway Object Storage bucket where the object is stored
[key] The object key inside the given bucket
[name] Name of the snapshot
[project-id] Project ID to use. If none is passed the default project ID will be used
[tags.{index}] List of tags assigned to the snapshot
[size] Size of the snapshot
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | fr-par-3 | nl-ams-1 | nl-ams-2 | nl-ams-3 | pl-waw-1 | pl-waw-2 | pl-waw-3)

FLAGS:
-h, --help help for import-from-object-storage

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
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ARGS:
[volume-id] Filter snapshots by the ID of the original volume
[name] Filter snapshots by their names
[organization-id] Filter by Organization ID
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | nl-ams-2 | nl-ams-3 | pl-waw-3 | all)
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | fr-par-3 | nl-ams-1 | nl-ams-2 | nl-ams-3 | pl-waw-1 | pl-waw-2 | pl-waw-3 | all)

FLAGS:
-h, --help help for list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ARGS:
snapshot-id UUID of the snapshot
[name] When defined, is the name of the snapshot
[tags.{index}] List of tags assigned to the snapshot
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | nl-ams-2 | nl-ams-3 | pl-waw-3)
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | fr-par-3 | nl-ams-1 | nl-ams-2 | nl-ams-3 | pl-waw-1 | pl-waw-2 | pl-waw-3)

FLAGS:
-h, --help help for update
Expand Down
13 changes: 7 additions & 6 deletions cmd/scw/testdata/test-all-usage-block-snapshot-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ USAGE:
scw block snapshot <command>

AVAILABLE COMMANDS:
create Create a snapshot of a volume
delete Delete a snapshot
export-to-object-storage Export a snapshot to a Scaleway Object Storage bucket
get Get a snapshot
list List all snapshots
update Update a snapshot
create Create a snapshot of a volume
delete Delete a snapshot
export-to-object-storage Export a snapshot to a Scaleway Object Storage bucket
get Get a snapshot
import-from-object-storage Import a snapshot from a Scaleway Object Storage bucket
list List all snapshots
update Update a snapshot

FLAGS:
-h, --help help for snapshot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ USAGE:
scw block volume create [arg=value ...]

ARGS:
name Name of the volume
name=<generated> Name of the volume
perf-iops The maximum IO/s expected, according to the different options available in stock (`5000 | 15000`)
[project-id] Project ID to use. If none is passed the default project ID will be used
[from-empty.size] Volume size in bytes, with a granularity of 1 GB (10^9 bytes)
[from-snapshot.size] Volume size in bytes, with a granularity of 1 GB (10^9 bytes)
[from-snapshot.snapshot-id] Source snapshot from which volume will be created
[tags.{index}] List of tags assigned to the volume
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | nl-ams-2 | nl-ams-3 | pl-waw-3)
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | fr-par-3 | nl-ams-1 | nl-ams-2 | nl-ams-3 | pl-waw-1 | pl-waw-2 | pl-waw-3)

FLAGS:
-h, --help help for create
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
You must specify the `volume_id` of the volume you want to delete. The volume must not be in the `in_use` status.

USAGE:
scw block volume delete [arg=value ...]
scw block volume delete <volume-id ...> [arg=value ...]

ARGS:
volume-id UUID of the volume
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | nl-ams-2 | nl-ams-3 | pl-waw-3)
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | fr-par-3 | nl-ams-1 | nl-ams-2 | nl-ams-3 | pl-waw-1 | pl-waw-2 | pl-waw-3)

FLAGS:
-h, --help help for delete
Expand Down
Loading

0 comments on commit a08a2b1

Please sign in to comment.