Skip to content

Commit

Permalink
feat: update generated APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
scaleway-bot committed Mar 5, 2024
1 parent 1e94877 commit d19e2f0
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ EXAMPLES:
scw instance snapshot create name=foobar volume-id=11111111-1111-1111-1111-111111111111

Import a QCOW file as an Instance snapshot
scw instance snapshot create zone=fr-par-1 name=my-imported-snapshot volume-type=unified bucket=my-bucket key=my-qcow2-file-name
scw instance snapshot create zone=fr-par-1 name=my-imported-snapshot volume-type=b_ssd bucket=my-bucket key=my-qcow2-file-name

ARGS:
[name=<generated>] Name of the snapshot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@ have one Instance with a volume containing the OS and another one
containing the application data, and you want to use different
snapshot strategies on both volumes.

A snapshot's volume type can be either its original volume's type
(`l_ssd` or `b_ssd`) or `unified`. Similarly, volumes can be created as well from snapshots
of their own type or `unified`. Therefore, to migrate data from a `l_ssd` volume
to a `b_ssd` volume, one can create a `unified` snapshot from the original volume
and a new `b_ssd` volume from this snapshot. The newly created volume will hold a copy
of the data of the original volume.
A snapshot's volume type is its original volume's type (`l_ssd` or `b_ssd`).
Volumes can be created from snapshots of their own type.

USAGE:
scw instance snapshot <command>
Expand Down
3 changes: 0 additions & 3 deletions cmd/scw/testdata/test-all-usage-instance-volume-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ Two different types of volume (`volume_type`) are available:
centralized cluster. You can plug and unplug a volume while
your Instance is running.

Note: The `unified` volume type is not available for volumes. This
type can only be used on snapshots.

Minimum and maximum volume sizes for each volume types can be queried
from the zone `/products/volumes` API endpoint. _I.e_ for:
- `fr-par-1` use https://api.scaleway.com/instance/v1/zones/fr-par-1/products/volumes
Expand Down
13 changes: 3 additions & 10 deletions docs/commands/instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -2379,12 +2379,8 @@ have one Instance with a volume containing the OS and another one
containing the application data, and you want to use different
snapshot strategies on both volumes.

A snapshot's volume type can be either its original volume's type
(`l_ssd` or `b_ssd`) or `unified`. Similarly, volumes can be created as well from snapshots
of their own type or `unified`. Therefore, to migrate data from a `l_ssd` volume
to a `b_ssd` volume, one can create a `unified` snapshot from the original volume
and a new `b_ssd` volume from this snapshot. The newly created volume will hold a copy
of the data of the original volume.
A snapshot's volume type is its original volume's type (`l_ssd` or `b_ssd`).
Volumes can be created from snapshots of their own type.


### Create a snapshot from a specified volume or from a QCOW2 file
Expand Down Expand Up @@ -2434,7 +2430,7 @@ scw instance snapshot create name=foobar volume-id=11111111-1111-1111-1111-11111

Import a QCOW file as an Instance snapshot
```
scw instance snapshot create zone=fr-par-1 name=my-imported-snapshot volume-type=unified bucket=my-bucket key=my-qcow2-file-name
scw instance snapshot create zone=fr-par-1 name=my-imported-snapshot volume-type=b_ssd bucket=my-bucket key=my-qcow2-file-name
```


Expand Down Expand Up @@ -2845,9 +2841,6 @@ Two different types of volume (`volume_type`) are available:
centralized cluster. You can plug and unplug a volume while
your Instance is running.

Note: The `unified` volume type is not available for volumes. This
type can only be used on snapshots.

Minimum and maximum volume sizes for each volume types can be queried
from the zone `/products/volumes` API endpoint. _I.e_ for:
- `fr-par-1` use https://api.scaleway.com/instance/v1/zones/fr-par-1/products/volumes
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ require (
github.com/moby/buildkit v0.11.6
github.com/opencontainers/go-digest v1.0.0
github.com/pkg/errors v0.9.1
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.25
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.25.0.20240304163539-4f60618924cb
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,8 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.25 h1:/8rfZAdFfafRXOgz+ZpMZZWZ5pYggCY9t7e/BvjaBHM=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.25/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.25.0.20240304163539-4f60618924cb h1:hKonT9HWXUZx9113DMqtWPg81A/SQYsq8VGYUCiVDno=
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.25.0.20240304163539-4f60618924cb/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
github.com/secure-systems-lab/go-securesystemslib v0.4.0 h1:b23VGrQhTA8cN2CbBw7/FulN9fTtqYUdS5+Oxzt+DUE=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
Expand Down
13 changes: 3 additions & 10 deletions internal/namespaces/instance/v1/instance_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,8 @@ have one Instance with a volume containing the OS and another one
containing the application data, and you want to use different
snapshot strategies on both volumes.
A snapshot's volume type can be either its original volume's type
(` + "`" + `l_ssd` + "`" + ` or ` + "`" + `b_ssd` + "`" + `) or ` + "`" + `unified` + "`" + `. Similarly, volumes can be created as well from snapshots
of their own type or ` + "`" + `unified` + "`" + `. Therefore, to migrate data from a ` + "`" + `l_ssd` + "`" + ` volume
to a ` + "`" + `b_ssd` + "`" + ` volume, one can create a ` + "`" + `unified` + "`" + ` snapshot from the original volume
and a new ` + "`" + `b_ssd` + "`" + ` volume from this snapshot. The newly created volume will hold a copy
of the data of the original volume.`,
A snapshot's volume type is its original volume's type (` + "`" + `l_ssd` + "`" + ` or ` + "`" + `b_ssd` + "`" + `).
Volumes can be created from snapshots of their own type.`,
Namespace: "instance",
Resource: "snapshot",
}
Expand Down Expand Up @@ -249,9 +245,6 @@ Two different types of volume (` + "`" + `volume_type` + "`" + `) are available:
centralized cluster. You can plug and unplug a volume while
your Instance is running.
Note: The ` + "`" + `unified` + "`" + ` volume type is not available for volumes. This
type can only be used on snapshots.
Minimum and maximum volume sizes for each volume types can be queried
from the zone ` + "`" + `/products/volumes` + "`" + ` API endpoint. _I.e_ for:
- ` + "`" + `fr-par-1` + "`" + ` use https://api.scaleway.com/instance/v1/zones/fr-par-1/products/volumes
Expand Down Expand Up @@ -1474,7 +1467,7 @@ func instanceSnapshotCreate() *core.Command {
},
{
Short: "Import a QCOW file as an Instance snapshot",
ArgsJSON: `{"bucket":"my-bucket","key":"my-qcow2-file-name","name":"my-imported-snapshot","volume_type":"unified","zone":"fr-par-1"}`,
ArgsJSON: `{"bucket":"my-bucket","key":"my-qcow2-file-name","name":"my-imported-snapshot","volume_type":"b_ssd","zone":"fr-par-1"}`,
},
},
}
Expand Down

0 comments on commit d19e2f0

Please sign in to comment.