From 68694ad097fb8ee572f6e3112b77109b83c586e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Thu, 28 Nov 2024 15:18:36 +0100 Subject: [PATCH 1/2] chore: purge ipfs/v1alpha1 --- .../test-all-usage-ipfs-name-usage.golden | 15 - ...-usage-ipfs-pin-create-by-cid-usage.golden | 26 - ...-usage-ipfs-pin-create-by-url-usage.golden | 25 - ...-usage-ipfs-pin-delete-usage.cassette.yaml | 35 - ...est-all-usage-ipfs-pin-delete-usage.golden | 21 - ...all-usage-ipfs-pin-get-usage.cassette.yaml | 35 - .../test-all-usage-ipfs-pin-get-usage.golden | 20 - .../test-all-usage-ipfs-pin-list-usage.golden | 23 - ...st-all-usage-ipfs-pin-replace-usage.golden | 28 - .../test-all-usage-ipfs-pin-usage.golden | 25 - .../test-all-usage-ipfs-usage#01.golden | 22 - .../testdata/test-all-usage-ipfs-usage.golden | 21 - ...-all-usage-ipfs-volume-create-usage.golden | 22 - ...-all-usage-ipfs-volume-delete-usage.golden | 19 - ...est-all-usage-ipfs-volume-get-usage.golden | 19 - ...st-all-usage-ipfs-volume-list-usage.golden | 20 - ...-all-usage-ipfs-volume-update-usage.golden | 21 - .../test-all-usage-ipfs-volume-usage.golden | 24 - ...st-all-usage-ipns-name-create-usage.golden | 21 - ...st-all-usage-ipns-name-delete-usage.golden | 19 - ...ll-usage-ipns-name-export-key-usage.golden | 19 - .../test-all-usage-ipns-name-get-usage.golden | 19 - ...ll-usage-ipns-name-import-key-usage.golden | 22 - ...test-all-usage-ipns-name-list-usage.golden | 21 - ...st-all-usage-ipns-name-update-usage.golden | 22 - .../test-all-usage-ipns-name-usage.golden | 26 - .../testdata/test-all-usage-ipns-usage.golden | 20 - cmd/scw/testdata/test-main-usage-usage.golden | 4 - commands/commands.go | 2 - core/cobra_builder.go | 6 +- docs/commands/ipfs.md | 284 ------ docs/commands/ipns.md | 169 ---- internal/namespaces/ipfs/v1alpha1/custom.go | 14 - internal/namespaces/ipfs/v1alpha1/ipfs_cli.go | 872 ------------------ 34 files changed, 3 insertions(+), 1958 deletions(-) delete mode 100644 cmd/scw/testdata/test-all-usage-ipfs-name-usage.golden delete mode 100644 cmd/scw/testdata/test-all-usage-ipfs-pin-create-by-cid-usage.golden delete mode 100644 cmd/scw/testdata/test-all-usage-ipfs-pin-create-by-url-usage.golden delete mode 100644 cmd/scw/testdata/test-all-usage-ipfs-pin-delete-usage.cassette.yaml delete mode 100644 cmd/scw/testdata/test-all-usage-ipfs-pin-delete-usage.golden delete mode 100644 cmd/scw/testdata/test-all-usage-ipfs-pin-get-usage.cassette.yaml delete mode 100644 cmd/scw/testdata/test-all-usage-ipfs-pin-get-usage.golden delete mode 100644 cmd/scw/testdata/test-all-usage-ipfs-pin-list-usage.golden delete mode 100644 cmd/scw/testdata/test-all-usage-ipfs-pin-replace-usage.golden delete mode 100644 cmd/scw/testdata/test-all-usage-ipfs-pin-usage.golden delete mode 100644 cmd/scw/testdata/test-all-usage-ipfs-usage#01.golden delete mode 100644 cmd/scw/testdata/test-all-usage-ipfs-usage.golden delete mode 100644 cmd/scw/testdata/test-all-usage-ipfs-volume-create-usage.golden delete mode 100644 cmd/scw/testdata/test-all-usage-ipfs-volume-delete-usage.golden delete mode 100644 cmd/scw/testdata/test-all-usage-ipfs-volume-get-usage.golden delete mode 100644 cmd/scw/testdata/test-all-usage-ipfs-volume-list-usage.golden delete mode 100644 cmd/scw/testdata/test-all-usage-ipfs-volume-update-usage.golden delete mode 100644 cmd/scw/testdata/test-all-usage-ipfs-volume-usage.golden delete mode 100644 cmd/scw/testdata/test-all-usage-ipns-name-create-usage.golden delete mode 100644 cmd/scw/testdata/test-all-usage-ipns-name-delete-usage.golden delete mode 100644 cmd/scw/testdata/test-all-usage-ipns-name-export-key-usage.golden delete mode 100644 cmd/scw/testdata/test-all-usage-ipns-name-get-usage.golden delete mode 100644 cmd/scw/testdata/test-all-usage-ipns-name-import-key-usage.golden delete mode 100644 cmd/scw/testdata/test-all-usage-ipns-name-list-usage.golden delete mode 100644 cmd/scw/testdata/test-all-usage-ipns-name-update-usage.golden delete mode 100644 cmd/scw/testdata/test-all-usage-ipns-name-usage.golden delete mode 100644 cmd/scw/testdata/test-all-usage-ipns-usage.golden delete mode 100644 docs/commands/ipfs.md delete mode 100644 docs/commands/ipns.md delete mode 100644 internal/namespaces/ipfs/v1alpha1/custom.go delete mode 100644 internal/namespaces/ipfs/v1alpha1/ipfs_cli.go diff --git a/cmd/scw/testdata/test-all-usage-ipfs-name-usage.golden b/cmd/scw/testdata/test-all-usage-ipfs-name-usage.golden deleted file mode 100644 index 15eeddac69..0000000000 --- a/cmd/scw/testdata/test-all-usage-ipfs-name-usage.golden +++ /dev/null @@ -1,15 +0,0 @@ -🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 -πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -This is the PKI namespace, where the private key is used to publish (sign) a record. - -USAGE: - scw ipfs name - -FLAGS: - -h, --help help for name - -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 diff --git a/cmd/scw/testdata/test-all-usage-ipfs-pin-create-by-cid-usage.golden b/cmd/scw/testdata/test-all-usage-ipfs-pin-create-by-cid-usage.golden deleted file mode 100644 index 547abf2e7d..0000000000 --- a/cmd/scw/testdata/test-all-usage-ipfs-pin-create-by-cid-usage.golden +++ /dev/null @@ -1,26 +0,0 @@ -🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 -πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -Will fetch and store the content pointed by the provided CID. The content must be available on the public IPFS network. -The content (IPFS blocks) will be host by the pinning service until pin deletion. -From that point, any other IPFS peer can fetch and host your content: Make sure to pin public or encrypted content. -Many pin requests (from different users) can target the same CID. -A pin is defined by its ID (UUID), its status (queued, pinning, pinned or failed) and target CID. - -USAGE: - scw ipfs pin create-by-cid [arg=value ...] - -ARGS: - volume-id Volume ID on which you want to pin your content - cid CID containing the content you want to pin - [origins.{index}] Node containing the content you want to pin - [name] Pin name - [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-by-cid - -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 diff --git a/cmd/scw/testdata/test-all-usage-ipfs-pin-create-by-url-usage.golden b/cmd/scw/testdata/test-all-usage-ipfs-pin-create-by-url-usage.golden deleted file mode 100644 index a3f77e5ad6..0000000000 --- a/cmd/scw/testdata/test-all-usage-ipfs-pin-create-by-url-usage.golden +++ /dev/null @@ -1,25 +0,0 @@ -🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 -πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -Will fetch and store the content pointed by the provided URL. The content must be available on the public IPFS network. -The content (IPFS blocks) will be host by the pinning service until pin deletion. -From that point, any other IPFS peer can fetch and host your content: Make sure to pin public or encrypted content. -Many pin requests (from different users) can target the same CID. -A pin is defined by its ID (UUID), its status (queued, pinning, pinned or failed) and target CID. - -USAGE: - scw ipfs pin create-by-url [arg=value ...] - -ARGS: - volume-id Volume ID on which you want to pin your content - url URL containing the content you want to pin - [name] Pin name - [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-by-url - -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 diff --git a/cmd/scw/testdata/test-all-usage-ipfs-pin-delete-usage.cassette.yaml b/cmd/scw/testdata/test-all-usage-ipfs-pin-delete-usage.cassette.yaml deleted file mode 100644 index 7d5b31b041..0000000000 --- a/cmd/scw/testdata/test-all-usage-ipfs-pin-delete-usage.cassette.yaml +++ /dev/null @@ -1,35 +0,0 @@ ---- -version: 1 -interactions: -- request: - body: '{"message":"authentication is denied","method":"api_key","reason":"not_found","type":"denied_authentication"}' - form: {} - headers: - User-Agent: - - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.1; linux; amd64) cli-e2e-test - url: https://api.scaleway.com/iam/v1alpha1/api-keys/SCWXXXXXXXXXXXXXXXXX - method: GET - response: - body: '{"message":"authentication is denied","method":"api_key","reason":"not_found","type":"denied_authentication"}' - headers: - Content-Length: - - "109" - Content-Security-Policy: - - default-src 'none'; frame-ancestors 'none' - Content-Type: - - application/json - Date: - - Fri, 22 Sep 2023 12:00:05 GMT - Server: - - Scaleway API-Gateway - Strict-Transport-Security: - - max-age=63072000 - X-Content-Type-Options: - - nosniff - X-Frame-Options: - - DENY - X-Request-Id: - - 094580b1-5e61-4598-b1c4-00d874b0f780 - status: 401 Unauthorized - code: 401 - duration: "" diff --git a/cmd/scw/testdata/test-all-usage-ipfs-pin-delete-usage.golden b/cmd/scw/testdata/test-all-usage-ipfs-pin-delete-usage.golden deleted file mode 100644 index 75017f24a7..0000000000 --- a/cmd/scw/testdata/test-all-usage-ipfs-pin-delete-usage.golden +++ /dev/null @@ -1,21 +0,0 @@ -🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 -πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -An unpin request means that you no longer own the content. -This content can therefore be removed and no longer provided on the IPFS network. - -USAGE: - scw ipfs pin delete [arg=value ...] - -ARGS: - [volume-id] Volume ID - pin-id Pin ID you want to remove from the volume - [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 diff --git a/cmd/scw/testdata/test-all-usage-ipfs-pin-get-usage.cassette.yaml b/cmd/scw/testdata/test-all-usage-ipfs-pin-get-usage.cassette.yaml deleted file mode 100644 index 158c4d721a..0000000000 --- a/cmd/scw/testdata/test-all-usage-ipfs-pin-get-usage.cassette.yaml +++ /dev/null @@ -1,35 +0,0 @@ ---- -version: 1 -interactions: -- request: - body: '{"message":"authentication is denied","method":"api_key","reason":"not_found","type":"denied_authentication"}' - form: {} - headers: - User-Agent: - - scaleway-sdk-go/v1.0.0-beta.7+dev (go1.21.2; linux; amd64) cli-e2e-test - url: https://api.scaleway.com/iam/v1alpha1/api-keys/SCWXXXXXXXXXXXXXXXXX - method: GET - response: - body: '{"message":"authentication is denied","method":"api_key","reason":"not_found","type":"denied_authentication"}' - headers: - Content-Length: - - "109" - Content-Security-Policy: - - default-src 'none'; frame-ancestors 'none' - Content-Type: - - application/json - Date: - - Wed, 11 Oct 2023 15:35:41 GMT - Server: - - Scaleway API-Gateway - Strict-Transport-Security: - - max-age=63072000 - X-Content-Type-Options: - - nosniff - X-Frame-Options: - - DENY - X-Request-Id: - - 51c3c629-50a5-440a-aaa2-370fc1f491a4 - status: 401 Unauthorized - code: 401 - duration: "" diff --git a/cmd/scw/testdata/test-all-usage-ipfs-pin-get-usage.golden b/cmd/scw/testdata/test-all-usage-ipfs-pin-get-usage.golden deleted file mode 100644 index 3871a34afb..0000000000 --- a/cmd/scw/testdata/test-all-usage-ipfs-pin-get-usage.golden +++ /dev/null @@ -1,20 +0,0 @@ -🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 -πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -Retrieve information about the provided **pin ID**, such as status, last modification, and CID. - -USAGE: - scw ipfs pin get [arg=value ...] - -ARGS: - [volume-id] Volume ID - pin-id Pin ID of which you want to obtain information - [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 diff --git a/cmd/scw/testdata/test-all-usage-ipfs-pin-list-usage.golden b/cmd/scw/testdata/test-all-usage-ipfs-pin-list-usage.golden deleted file mode 100644 index cdbd659601..0000000000 --- a/cmd/scw/testdata/test-all-usage-ipfs-pin-list-usage.golden +++ /dev/null @@ -1,23 +0,0 @@ -🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 -πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -Retrieve information about all pins within a volume. - -USAGE: - scw ipfs pin list [arg=value ...] - -ARGS: - volume-id Volume ID of which you want to list the pins - [project-id] Project ID - [order-by] Sort order of the returned Volume (created_at_asc | created_at_desc) - [status] List pins by status (unknown_status | queued | pinning | failed | pinned) - [organization-id] Organization ID - [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 diff --git a/cmd/scw/testdata/test-all-usage-ipfs-pin-replace-usage.golden b/cmd/scw/testdata/test-all-usage-ipfs-pin-replace-usage.golden deleted file mode 100644 index c4bc7deaad..0000000000 --- a/cmd/scw/testdata/test-all-usage-ipfs-pin-replace-usage.golden +++ /dev/null @@ -1,28 +0,0 @@ -🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 -πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -Deletes the given resource ID and pins the new CID in its place. -Will fetch and store the content pointed by the provided CID. The content must be available on the public IPFS network. -The content (IPFS blocks) is hosted by the pinning service until the pin is deleted. -While the content is available any other IPFS peer can fetch and host your content. For this reason, we recommend that you pin either public or encrypted content. -Several different pin requests can target the same CID. -A pin is defined by its ID (UUID), its status (queued, pinning, pinned or failed) and target CID. - -USAGE: - scw ipfs pin replace [arg=value ...] - -ARGS: - [volume-id] Volume ID - pin-id Pin ID whose information you wish to replace - [cid] New CID you want to pin in place of the old one - [name] New name to replace - [origins.{index}] Node containing the content you want to pin - [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 replace - -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 diff --git a/cmd/scw/testdata/test-all-usage-ipfs-pin-usage.golden b/cmd/scw/testdata/test-all-usage-ipfs-pin-usage.golden deleted file mode 100644 index c44ea3d500..0000000000 --- a/cmd/scw/testdata/test-all-usage-ipfs-pin-usage.golden +++ /dev/null @@ -1,25 +0,0 @@ -🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 -πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -It is possible that many pins target the same CID, regardless of the user. - -USAGE: - scw ipfs pin - -AVAILABLE COMMANDS: - create-by-cid Create a pin by CID - create-by-url Create a pin by URL - delete Create an unpin request - get Get pin information - list List all pins within a volume - replace Replace pin by CID - -FLAGS: - -h, --help help for pin - -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 ipfs pin [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-ipfs-usage#01.golden b/cmd/scw/testdata/test-all-usage-ipfs-usage#01.golden deleted file mode 100644 index 4dcedc195e..0000000000 --- a/cmd/scw/testdata/test-all-usage-ipfs-usage#01.golden +++ /dev/null @@ -1,22 +0,0 @@ -🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 -πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -IPFS Pinning service API. - -USAGE: - scw ipfs - -AVAILABLE COMMANDS: - name A name is a hash of the public key within the IPNS (InterPlanetary Name System) - pin A pin is an abstract object that holds a Content Identifier (CID). It is defined that during the lifespan of a pin, the CID (and all sub-CIDs) must be hosted by the service - volume A volume is bucket of pins. It is similar to an Object Storage bucket. Volumes are useful to gather pins with similar lifespans - -FLAGS: - -h, --help help for ipfs - -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 ipfs [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-ipfs-usage.golden b/cmd/scw/testdata/test-all-usage-ipfs-usage.golden deleted file mode 100644 index 85cfe12b76..0000000000 --- a/cmd/scw/testdata/test-all-usage-ipfs-usage.golden +++ /dev/null @@ -1,21 +0,0 @@ -🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 -πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -IPFS Pinning service API. - -USAGE: - scw ipfs - -AVAILABLE COMMANDS: - pin A pin is an abstract object that holds a Content Identifier (CID). It is defined that during the lifespan of a pin, the CID (and all sub-CIDs) must be hosted by the service - volume A volume is bucket of pins. It is similar to an Object Storage bucket. Volumes are useful to gather pins with similar lifespans - -FLAGS: - -h, --help help for ipfs - -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 ipfs [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-ipfs-volume-create-usage.golden b/cmd/scw/testdata/test-all-usage-ipfs-volume-create-usage.golden deleted file mode 100644 index 30cf10eca9..0000000000 --- a/cmd/scw/testdata/test-all-usage-ipfs-volume-create-usage.golden +++ /dev/null @@ -1,22 +0,0 @@ -🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 -πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -Create a new volume from a Project ID. Volume is identified by an ID and used to host pin references. -Volume is personal (at least to your organization) even if IPFS blocks and CID are available to anyone. -Should be the first command you made because every pin must be attached to a volume. - -USAGE: - scw ipfs volume create [arg=value ...] - -ARGS: - [project-id] Project ID to use. If none is passed the default project ID will be used - name Volume name - [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 diff --git a/cmd/scw/testdata/test-all-usage-ipfs-volume-delete-usage.golden b/cmd/scw/testdata/test-all-usage-ipfs-volume-delete-usage.golden deleted file mode 100644 index 35d55ad03f..0000000000 --- a/cmd/scw/testdata/test-all-usage-ipfs-volume-delete-usage.golden +++ /dev/null @@ -1,19 +0,0 @@ -🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 -πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -Delete a volume by its ID and every pin attached to this volume. This process can take a while to conclude, depending on the size of your pinned content. - -USAGE: - scw ipfs volume delete [arg=value ...] - -ARGS: - volume-id Volume 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 diff --git a/cmd/scw/testdata/test-all-usage-ipfs-volume-get-usage.golden b/cmd/scw/testdata/test-all-usage-ipfs-volume-get-usage.golden deleted file mode 100644 index 28df6c6ff8..0000000000 --- a/cmd/scw/testdata/test-all-usage-ipfs-volume-get-usage.golden +++ /dev/null @@ -1,19 +0,0 @@ -🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 -πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -Retrieve information about a specific volume. - -USAGE: - scw ipfs volume get [arg=value ...] - -ARGS: - volume-id Volume 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 diff --git a/cmd/scw/testdata/test-all-usage-ipfs-volume-list-usage.golden b/cmd/scw/testdata/test-all-usage-ipfs-volume-list-usage.golden deleted file mode 100644 index 7759a95489..0000000000 --- a/cmd/scw/testdata/test-all-usage-ipfs-volume-list-usage.golden +++ /dev/null @@ -1,20 +0,0 @@ -🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 -πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -Retrieve information about all volumes from a Project ID. - -USAGE: - scw ipfs volume list [arg=value ...] - -ARGS: - [project-id] Project ID to use. If none is passed the default project ID will be used - [order-by] Sort the order of the returned volumes (created_at_asc | created_at_desc) - [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 diff --git a/cmd/scw/testdata/test-all-usage-ipfs-volume-update-usage.golden b/cmd/scw/testdata/test-all-usage-ipfs-volume-update-usage.golden deleted file mode 100644 index 4f0e12203c..0000000000 --- a/cmd/scw/testdata/test-all-usage-ipfs-volume-update-usage.golden +++ /dev/null @@ -1,21 +0,0 @@ -🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 -πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -Update volume information (tag, name...). - -USAGE: - scw ipfs volume update [arg=value ...] - -ARGS: - [name] Volume name - volume-id Volume ID - [tags.{index}] Tags of the volume - [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 diff --git a/cmd/scw/testdata/test-all-usage-ipfs-volume-usage.golden b/cmd/scw/testdata/test-all-usage-ipfs-volume-usage.golden deleted file mode 100644 index ac022985ca..0000000000 --- a/cmd/scw/testdata/test-all-usage-ipfs-volume-usage.golden +++ /dev/null @@ -1,24 +0,0 @@ -🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 -πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -All pins must be attached to a volume. And all volumes must be attached to a Project ID. - -USAGE: - scw ipfs volume - -AVAILABLE COMMANDS: - create Create a new volume - delete Delete an existing volume - get Get information about a volume - list List all volumes by a Project ID - update Update volume information - -FLAGS: - -h, --help help for volume - -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 ipfs volume [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-ipns-name-create-usage.golden b/cmd/scw/testdata/test-all-usage-ipns-name-create-usage.golden deleted file mode 100644 index 76575d7af2..0000000000 --- a/cmd/scw/testdata/test-all-usage-ipns-name-create-usage.golden +++ /dev/null @@ -1,21 +0,0 @@ -🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 -πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -You can use the `ipns key` command to list and generate more names and their respective keys. - -USAGE: - scw ipns name create [arg=value ...] - -ARGS: - [project-id] Project ID to use. If none is passed the default project ID will be used - [name] Name for your records - [value] Value you want to associate with your records, CID or IPNS key - [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 diff --git a/cmd/scw/testdata/test-all-usage-ipns-name-delete-usage.golden b/cmd/scw/testdata/test-all-usage-ipns-name-delete-usage.golden deleted file mode 100644 index 73065319ec..0000000000 --- a/cmd/scw/testdata/test-all-usage-ipns-name-delete-usage.golden +++ /dev/null @@ -1,19 +0,0 @@ -🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 -πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -Delete a name by its ID. - -USAGE: - scw ipns name delete [arg=value ...] - -ARGS: - name-id Name ID you wish to delete - [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 diff --git a/cmd/scw/testdata/test-all-usage-ipns-name-export-key-usage.golden b/cmd/scw/testdata/test-all-usage-ipns-name-export-key-usage.golden deleted file mode 100644 index b2a653a911..0000000000 --- a/cmd/scw/testdata/test-all-usage-ipns-name-export-key-usage.golden +++ /dev/null @@ -1,19 +0,0 @@ -🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 -πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -Export a private key by its ID. - -USAGE: - scw ipns name export-key [arg=value ...] - -ARGS: - name-id Name ID whose keys you want to export - [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 export-key - -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 diff --git a/cmd/scw/testdata/test-all-usage-ipns-name-get-usage.golden b/cmd/scw/testdata/test-all-usage-ipns-name-get-usage.golden deleted file mode 100644 index cf7b5dcb78..0000000000 --- a/cmd/scw/testdata/test-all-usage-ipns-name-get-usage.golden +++ /dev/null @@ -1,19 +0,0 @@ -🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 -πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -Retrieve information about a specific name. - -USAGE: - scw ipns name get [arg=value ...] - -ARGS: - name-id Name ID whose information you want to retrieve - [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 diff --git a/cmd/scw/testdata/test-all-usage-ipns-name-import-key-usage.golden b/cmd/scw/testdata/test-all-usage-ipns-name-import-key-usage.golden deleted file mode 100644 index 5f298a9f89..0000000000 --- a/cmd/scw/testdata/test-all-usage-ipns-name-import-key-usage.golden +++ /dev/null @@ -1,22 +0,0 @@ -🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 -πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -Import a private key. - -USAGE: - scw ipns name import-key [arg=value ...] - -ARGS: - [project-id] Project ID to use. If none is passed the default project ID will be used - [name] Name for your records - private-key Base64 private key - [value] Value you want to associate with your records, CID or IPNS key - [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 import-key - -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 diff --git a/cmd/scw/testdata/test-all-usage-ipns-name-list-usage.golden b/cmd/scw/testdata/test-all-usage-ipns-name-list-usage.golden deleted file mode 100644 index 5e7a2180d0..0000000000 --- a/cmd/scw/testdata/test-all-usage-ipns-name-list-usage.golden +++ /dev/null @@ -1,21 +0,0 @@ -🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 -πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -Retrieve information about all names from a Project ID. - -USAGE: - scw ipns name list [arg=value ...] - -ARGS: - [project-id] Project ID - [order-by] Sort the order of the returned names (created_at_asc | created_at_desc) - [organization-id] Organization ID - [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 diff --git a/cmd/scw/testdata/test-all-usage-ipns-name-update-usage.golden b/cmd/scw/testdata/test-all-usage-ipns-name-update-usage.golden deleted file mode 100644 index 0b0d5430da..0000000000 --- a/cmd/scw/testdata/test-all-usage-ipns-name-update-usage.golden +++ /dev/null @@ -1,22 +0,0 @@ -🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 -πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -Update name information (CID, tag, name...). - -USAGE: - scw ipns name update [arg=value ...] - -ARGS: - name-id Name ID you wish to update - [name] New name you want to associate with your record - [tags.{index}] New tags you want to associate with your record - [value] Value you want to associate with your records, CID or IPNS key - [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 diff --git a/cmd/scw/testdata/test-all-usage-ipns-name-usage.golden b/cmd/scw/testdata/test-all-usage-ipns-name-usage.golden deleted file mode 100644 index a32ce471e0..0000000000 --- a/cmd/scw/testdata/test-all-usage-ipns-name-usage.golden +++ /dev/null @@ -1,26 +0,0 @@ -🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 -πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -This is the PKI namespace, where the private key is used to publish (sign) a record. - -USAGE: - scw ipns name - -AVAILABLE COMMANDS: - create Create a new name - delete Delete an existing name - export-key Export your private key - get Get information about a name - import-key Import your private key - list List all names by a Project ID - update Update name information - -FLAGS: - -h, --help help for name - -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 ipns name [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-ipns-usage.golden b/cmd/scw/testdata/test-all-usage-ipns-usage.golden deleted file mode 100644 index e4b76446b0..0000000000 --- a/cmd/scw/testdata/test-all-usage-ipns-usage.golden +++ /dev/null @@ -1,20 +0,0 @@ -🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 -πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ -IPFS Naming service API - -USAGE: - scw ipns - -AVAILABLE COMMANDS: - name A name is a hash of the public key within the IPNS (InterPlanetary Name System) - -FLAGS: - -h, --help help for ipns - -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 ipns [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-main-usage-usage.golden b/cmd/scw/testdata/test-main-usage-usage.golden index 306427d95b..c2ee383d94 100644 --- a/cmd/scw/testdata/test-main-usage-usage.golden +++ b/cmd/scw/testdata/test-main-usage-usage.golden @@ -41,10 +41,6 @@ AVAILABLE COMMANDS: vpc-gw This API allows you to manage your Public Gateways webhosting This API allows you to manage your Web Hosting services -AVAILABLE LABS COMMANDS: - ipfs IPFS Pinning service API - ipns IPFS Naming service API - CONFIGURATION COMMANDS: alias Alias related commands config Config file management diff --git a/commands/commands.go b/commands/commands.go index 686024d394..dc5e5b0c1a 100644 --- a/commands/commands.go +++ b/commands/commands.go @@ -29,7 +29,6 @@ import ( "github.com/scaleway/scaleway-cli/v2/internal/namespaces/instance/v1" "github.com/scaleway/scaleway-cli/v2/internal/namespaces/iot/v1" "github.com/scaleway/scaleway-cli/v2/internal/namespaces/ipam/v1" - ipfs "github.com/scaleway/scaleway-cli/v2/internal/namespaces/ipfs/v1alpha1" jobs "github.com/scaleway/scaleway-cli/v2/internal/namespaces/jobs/v1alpha1" "github.com/scaleway/scaleway-cli/v2/internal/namespaces/k8s/v1" keymanager "github.com/scaleway/scaleway-cli/v2/internal/namespaces/key_manager/v1alpha1" @@ -98,7 +97,6 @@ func GetCommands() *core.Commands { alias.GetCommands(), webhosting.GetCommands(), billing.GetCommands(), - ipfs.GetCommands(), documentdb.GetCommands(), mnq.GetCommands(), block.GetCommands(), diff --git a/core/cobra_builder.go b/core/cobra_builder.go index 812bf5b36e..4cb1ab029b 100644 --- a/core/cobra_builder.go +++ b/core/cobra_builder.go @@ -28,9 +28,9 @@ type cobraBuilder struct { func (b *cobraBuilder) build() *cobra.Command { groups := map[string]*cobra.Group{ "available": {ID: "available", Title: "AVAILABLE"}, - "labs": {ID: "labs", Title: "AVAILABLE LABS"}, - "config": {ID: "config", Title: "CONFIGURATION"}, - "utility": {ID: "utility", Title: "UTILITY"}, + //"labs": {ID: "labs", Title: "AVAILABLE LABS"}, + "config": {ID: "config", Title: "CONFIGURATION"}, + "utility": {ID: "utility", Title: "UTILITY"}, } commands := b.commands.GetAll() diff --git a/docs/commands/ipfs.md b/docs/commands/ipfs.md deleted file mode 100644 index 9abe39d43a..0000000000 --- a/docs/commands/ipfs.md +++ /dev/null @@ -1,284 +0,0 @@ - -# Documentation for `scw ipfs` -IPFS Pinning service API. - -- [A pin is an abstract object that holds a Content Identifier (CID). It is defined that during the lifespan of a pin, the CID (and all sub-CIDs) must be hosted by the service](#a-pin-is-an-abstract-object-that-holds-a-content-identifier-(cid).-it-is-defined-that-during-the-lifespan-of-a-pin,-the-cid-(and-all-sub-cids)-must-be-hosted-by-the-service) - - [Create a pin by CID](#create-a-pin-by-cid) - - [Create a pin by URL](#create-a-pin-by-url) - - [Create an unpin request](#create-an-unpin-request) - - [Get pin information](#get-pin-information) - - [List all pins within a volume](#list-all-pins-within-a-volume) - - [Replace pin by CID](#replace-pin-by-cid) -- [A volume is bucket of pins. It is similar to an Object Storage bucket. Volumes are useful to gather pins with similar lifespans](#a-volume-is-bucket-of-pins.-it-is-similar-to-an-object-storage-bucket.-volumes-are-useful-to-gather-pins-with-similar-lifespans) - - [Create a new volume](#create-a-new-volume) - - [Delete an existing volume](#delete-an-existing-volume) - - [Get information about a volume](#get-information-about-a-volume) - - [List all volumes by a Project ID](#list-all-volumes-by-a-project-id) - - [Update volume information](#update-volume-information) - - -## A pin is an abstract object that holds a Content Identifier (CID). It is defined that during the lifespan of a pin, the CID (and all sub-CIDs) must be hosted by the service - -It is possible that many pins target the same CID, regardless of the user. - - -### Create a pin by CID - -Will fetch and store the content pointed by the provided CID. The content must be available on the public IPFS network. -The content (IPFS blocks) will be host by the pinning service until pin deletion. -From that point, any other IPFS peer can fetch and host your content: Make sure to pin public or encrypted content. -Many pin requests (from different users) can target the same CID. -A pin is defined by its ID (UUID), its status (queued, pinning, pinned or failed) and target CID. - -**Usage:** - -``` -scw ipfs pin create-by-cid [arg=value ...] -``` - - -**Args:** - -| Name | | Description | -|------|---|-------------| -| volume-id | Required | Volume ID on which you want to pin your content | -| cid | Required | CID containing the content you want to pin | -| origins.{index} | | Node containing the content you want to pin | -| name | | Pin name | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | - - - -### Create a pin by URL - -Will fetch and store the content pointed by the provided URL. The content must be available on the public IPFS network. -The content (IPFS blocks) will be host by the pinning service until pin deletion. -From that point, any other IPFS peer can fetch and host your content: Make sure to pin public or encrypted content. -Many pin requests (from different users) can target the same CID. -A pin is defined by its ID (UUID), its status (queued, pinning, pinned or failed) and target CID. - -**Usage:** - -``` -scw ipfs pin create-by-url [arg=value ...] -``` - - -**Args:** - -| Name | | Description | -|------|---|-------------| -| volume-id | Required | Volume ID on which you want to pin your content | -| url | Required | URL containing the content you want to pin | -| name | | Pin name | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | - - - -### Create an unpin request - -An unpin request means that you no longer own the content. -This content can therefore be removed and no longer provided on the IPFS network. - -**Usage:** - -``` -scw ipfs pin delete [arg=value ...] -``` - - -**Args:** - -| Name | | Description | -|------|---|-------------| -| volume-id | | Volume ID | -| pin-id | Required | Pin ID you want to remove from the volume | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | - - - -### Get pin information - -Retrieve information about the provided **pin ID**, such as status, last modification, and CID. - -**Usage:** - -``` -scw ipfs pin get [arg=value ...] -``` - - -**Args:** - -| Name | | Description | -|------|---|-------------| -| volume-id | | Volume ID | -| pin-id | Required | Pin ID of which you want to obtain information | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | - - - -### List all pins within a volume - -Retrieve information about all pins within a volume. - -**Usage:** - -``` -scw ipfs pin list [arg=value ...] -``` - - -**Args:** - -| Name | | Description | -|------|---|-------------| -| volume-id | Required | Volume ID of which you want to list the pins | -| project-id | | Project ID | -| order-by | One of: `created_at_asc`, `created_at_desc` | Sort order of the returned Volume | -| status | One of: `unknown_status`, `queued`, `pinning`, `failed`, `pinned` | List pins by status | -| organization-id | | Organization ID | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw`, `all` | Region to target. If none is passed will use default region from the config | - - - -### Replace pin by CID - -Deletes the given resource ID and pins the new CID in its place. -Will fetch and store the content pointed by the provided CID. The content must be available on the public IPFS network. -The content (IPFS blocks) is hosted by the pinning service until the pin is deleted. -While the content is available any other IPFS peer can fetch and host your content. For this reason, we recommend that you pin either public or encrypted content. -Several different pin requests can target the same CID. -A pin is defined by its ID (UUID), its status (queued, pinning, pinned or failed) and target CID. - -**Usage:** - -``` -scw ipfs pin replace [arg=value ...] -``` - - -**Args:** - -| Name | | Description | -|------|---|-------------| -| volume-id | | Volume ID | -| pin-id | Required | Pin ID whose information you wish to replace | -| cid | | New CID you want to pin in place of the old one | -| name | | New name to replace | -| origins.{index} | | Node containing the content you want to pin | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | - - - -## A volume is bucket of pins. It is similar to an Object Storage bucket. Volumes are useful to gather pins with similar lifespans - -All pins must be attached to a volume. And all volumes must be attached to a Project ID. - - -### Create a new volume - -Create a new volume from a Project ID. Volume is identified by an ID and used to host pin references. -Volume is personal (at least to your organization) even if IPFS blocks and CID are available to anyone. -Should be the first command you made because every pin must be attached to a volume. - -**Usage:** - -``` -scw ipfs volume create [arg=value ...] -``` - - -**Args:** - -| Name | | Description | -|------|---|-------------| -| project-id | | Project ID to use. If none is passed the default project ID will be used | -| name | Required | Volume name | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | - - - -### Delete an existing volume - -Delete a volume by its ID and every pin attached to this volume. This process can take a while to conclude, depending on the size of your pinned content. - -**Usage:** - -``` -scw ipfs volume delete [arg=value ...] -``` - - -**Args:** - -| Name | | Description | -|------|---|-------------| -| volume-id | Required | Volume ID | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | - - - -### Get information about a volume - -Retrieve information about a specific volume. - -**Usage:** - -``` -scw ipfs volume get [arg=value ...] -``` - - -**Args:** - -| Name | | Description | -|------|---|-------------| -| volume-id | Required | Volume ID | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | - - - -### List all volumes by a Project ID - -Retrieve information about all volumes from a Project ID. - -**Usage:** - -``` -scw ipfs volume list [arg=value ...] -``` - - -**Args:** - -| Name | | Description | -|------|---|-------------| -| project-id | | Project ID to use. If none is passed the default project ID will be used | -| order-by | One of: `created_at_asc`, `created_at_desc` | Sort the order of the returned volumes | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw`, `all` | Region to target. If none is passed will use default region from the config | - - - -### Update volume information - -Update volume information (tag, name...). - -**Usage:** - -``` -scw ipfs volume update [arg=value ...] -``` - - -**Args:** - -| Name | | Description | -|------|---|-------------| -| name | | Volume name | -| volume-id | Required | Volume ID | -| tags.{index} | | Tags of the volume | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | - - - diff --git a/docs/commands/ipns.md b/docs/commands/ipns.md deleted file mode 100644 index 6d22a59830..0000000000 --- a/docs/commands/ipns.md +++ /dev/null @@ -1,169 +0,0 @@ - -# Documentation for `scw ipns` -IPFS Naming service API - -- [A name is a hash of the public key within the IPNS (InterPlanetary Name System)](#a-name-is-a-hash-of-the-public-key-within-the-ipns-(interplanetary-name-system)) - - [Create a new name](#create-a-new-name) - - [Delete an existing name](#delete-an-existing-name) - - [Export your private key](#export-your-private-key) - - [Get information about a name](#get-information-about-a-name) - - [Import your private key](#import-your-private-key) - - [List all names by a Project ID](#list-all-names-by-a-project-id) - - [Update name information](#update-name-information) - - -## A name is a hash of the public key within the IPNS (InterPlanetary Name System) - -This is the PKI namespace, where the private key is used to publish (sign) a record. - - -### Create a new name - -You can use the `ipns key` command to list and generate more names and their respective keys. - -**Usage:** - -``` -scw ipns name create [arg=value ...] -``` - - -**Args:** - -| Name | | Description | -|------|---|-------------| -| project-id | | Project ID to use. If none is passed the default project ID will be used | -| name | | Name for your records | -| value | | Value you want to associate with your records, CID or IPNS key | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | - - - -### Delete an existing name - -Delete a name by its ID. - -**Usage:** - -``` -scw ipns name delete [arg=value ...] -``` - - -**Args:** - -| Name | | Description | -|------|---|-------------| -| name-id | Required | Name ID you wish to delete | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | - - - -### Export your private key - -Export a private key by its ID. - -**Usage:** - -``` -scw ipns name export-key [arg=value ...] -``` - - -**Args:** - -| Name | | Description | -|------|---|-------------| -| name-id | Required | Name ID whose keys you want to export | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | - - - -### Get information about a name - -Retrieve information about a specific name. - -**Usage:** - -``` -scw ipns name get [arg=value ...] -``` - - -**Args:** - -| Name | | Description | -|------|---|-------------| -| name-id | Required | Name ID whose information you want to retrieve | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | - - - -### Import your private key - -Import a private key. - -**Usage:** - -``` -scw ipns name import-key [arg=value ...] -``` - - -**Args:** - -| Name | | Description | -|------|---|-------------| -| project-id | | Project ID to use. If none is passed the default project ID will be used | -| name | | Name for your records | -| private-key | Required | Base64 private key | -| value | | Value you want to associate with your records, CID or IPNS key | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | - - - -### List all names by a Project ID - -Retrieve information about all names from a Project ID. - -**Usage:** - -``` -scw ipns name list [arg=value ...] -``` - - -**Args:** - -| Name | | Description | -|------|---|-------------| -| project-id | | Project ID | -| order-by | One of: `created_at_asc`, `created_at_desc` | Sort the order of the returned names | -| organization-id | | Organization ID | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw`, `all` | Region to target. If none is passed will use default region from the config | - - - -### Update name information - -Update name information (CID, tag, name...). - -**Usage:** - -``` -scw ipns name update [arg=value ...] -``` - - -**Args:** - -| Name | | Description | -|------|---|-------------| -| name-id | Required | Name ID you wish to update | -| name | | New name you want to associate with your record | -| tags.{index} | | New tags you want to associate with your record | -| value | | Value you want to associate with your records, CID or IPNS key | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | - - - diff --git a/internal/namespaces/ipfs/v1alpha1/custom.go b/internal/namespaces/ipfs/v1alpha1/custom.go deleted file mode 100644 index 6944cd06d5..0000000000 --- a/internal/namespaces/ipfs/v1alpha1/custom.go +++ /dev/null @@ -1,14 +0,0 @@ -package ipfs - -import ( - "github.com/scaleway/scaleway-cli/v2/core" -) - -// GetCommands returns the list of commands for the 'ipfs' namespace. -func GetCommands() *core.Commands { - cmds := GetGeneratedCommands() - - cmds.MustFind("ipns").Groups = []string{"labs"} - cmds.MustFind("ipfs").Groups = []string{"labs"} - return cmds -} diff --git a/internal/namespaces/ipfs/v1alpha1/ipfs_cli.go b/internal/namespaces/ipfs/v1alpha1/ipfs_cli.go deleted file mode 100644 index 7be42e6b44..0000000000 --- a/internal/namespaces/ipfs/v1alpha1/ipfs_cli.go +++ /dev/null @@ -1,872 +0,0 @@ -// This file was automatically generated. DO NOT EDIT. -// If you have any remark or suggestion do not hesitate to open an issue. - -package ipfs - -import ( - "context" - "reflect" - - "github.com/scaleway/scaleway-cli/v2/core" - "github.com/scaleway/scaleway-sdk-go/api/ipfs/v1alpha1" - "github.com/scaleway/scaleway-sdk-go/scw" -) - -// always import dependencies -var ( - _ = scw.RegionFrPar -) - -func GetGeneratedCommands() *core.Commands { - return core.NewCommands( - ipfsRoot(), - ipnsRoot(), - ipfsPin(), - ipfsVolume(), - ipnsName(), - ipfsVolumeCreate(), - ipfsVolumeGet(), - ipfsVolumeList(), - ipfsVolumeUpdate(), - ipfsVolumeDelete(), - ipfsPinCreateByURL(), - ipfsPinCreateByCid(), - ipfsPinReplace(), - ipfsPinGet(), - ipfsPinList(), - ipfsPinDelete(), - ipnsNameCreate(), - ipnsNameGet(), - ipnsNameDelete(), - ipnsNameList(), - ipnsNameUpdate(), - ipnsNameExportKey(), - ipnsNameImportKey(), - ) -} -func ipfsRoot() *core.Command { - return &core.Command{ - Short: `IPFS Pinning service API`, - Long: `IPFS Pinning service API.`, - Namespace: "ipfs", - } -} - -func ipnsRoot() *core.Command { - return &core.Command{ - Short: `IPFS Naming service API`, - Long: ``, - Namespace: "ipns", - } -} - -func ipfsPin() *core.Command { - return &core.Command{ - Short: `A pin is an abstract object that holds a Content Identifier (CID). It is defined that during the lifespan of a pin, the CID (and all sub-CIDs) must be hosted by the service`, - Long: `It is possible that many pins target the same CID, regardless of the user.`, - Namespace: "ipfs", - Resource: "pin", - } -} - -func ipfsVolume() *core.Command { - return &core.Command{ - Short: `A volume is bucket of pins. It is similar to an Object Storage bucket. Volumes are useful to gather pins with similar lifespans`, - Long: `All pins must be attached to a volume. And all volumes must be attached to a Project ID.`, - Namespace: "ipfs", - Resource: "volume", - } -} - -func ipnsName() *core.Command { - return &core.Command{ - Short: `A name is a hash of the public key within the IPNS (InterPlanetary Name System)`, - Long: `This is the PKI namespace, where the private key is used to publish (sign) a record.`, - Namespace: "ipns", - Resource: "name", - } -} - -func ipfsVolumeCreate() *core.Command { - return &core.Command{ - Short: `Create a new volume`, - Long: `Create a new volume from a Project ID. Volume is identified by an ID and used to host pin references. -Volume is personal (at least to your organization) even if IPFS blocks and CID are available to anyone. -Should be the first command you made because every pin must be attached to a volume.`, - Namespace: "ipfs", - Resource: "volume", - Verb: "create", - // Deprecated: false, - ArgsType: reflect.TypeOf(ipfs.CreateVolumeRequest{}), - ArgSpecs: core.ArgSpecs{ - core.ProjectIDArgSpec(), - { - Name: "name", - Short: `Volume name`, - Required: true, - Deprecated: false, - Positional: false, - }, - core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw), - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*ipfs.CreateVolumeRequest) - - client := core.ExtractClient(ctx) - api := ipfs.NewAPI(client) - return api.CreateVolume(request) - - }, - } -} - -func ipfsVolumeGet() *core.Command { - return &core.Command{ - Short: `Get information about a volume`, - Long: `Retrieve information about a specific volume.`, - Namespace: "ipfs", - Resource: "volume", - Verb: "get", - // Deprecated: false, - ArgsType: reflect.TypeOf(ipfs.GetVolumeRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "volume-id", - Short: `Volume ID`, - Required: true, - Deprecated: false, - Positional: false, - }, - core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw), - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*ipfs.GetVolumeRequest) - - client := core.ExtractClient(ctx) - api := ipfs.NewAPI(client) - return api.GetVolume(request) - - }, - } -} - -func ipfsVolumeList() *core.Command { - return &core.Command{ - Short: `List all volumes by a Project ID`, - Long: `Retrieve information about all volumes from a Project ID.`, - Namespace: "ipfs", - Resource: "volume", - Verb: "list", - // Deprecated: false, - ArgsType: reflect.TypeOf(ipfs.ListVolumesRequest{}), - ArgSpecs: core.ArgSpecs{ - core.ProjectIDArgSpec(), - { - Name: "order-by", - Short: `Sort the order of the returned volumes`, - Required: false, - Deprecated: false, - Positional: false, - EnumValues: []string{"created_at_asc", "created_at_desc"}, - }, - core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw, scw.Region(core.AllLocalities)), - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*ipfs.ListVolumesRequest) - - client := core.ExtractClient(ctx) - api := ipfs.NewAPI(client) - opts := []scw.RequestOption{scw.WithAllPages()} - if request.Region == scw.Region(core.AllLocalities) { - opts = append(opts, scw.WithRegions(api.Regions()...)) - request.Region = "" - } - resp, err := api.ListVolumes(request, opts...) - if err != nil { - return nil, err - } - return resp.Volumes, nil - - }, - } -} - -func ipfsVolumeUpdate() *core.Command { - return &core.Command{ - Short: `Update volume information`, - Long: `Update volume information (tag, name...).`, - Namespace: "ipfs", - Resource: "volume", - Verb: "update", - // Deprecated: false, - ArgsType: reflect.TypeOf(ipfs.UpdateVolumeRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "name", - Short: `Volume name`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "volume-id", - Short: `Volume ID`, - Required: true, - Deprecated: false, - Positional: false, - }, - { - Name: "tags.{index}", - Short: `Tags of the volume`, - Required: false, - Deprecated: false, - Positional: false, - }, - core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw), - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*ipfs.UpdateVolumeRequest) - - client := core.ExtractClient(ctx) - api := ipfs.NewAPI(client) - return api.UpdateVolume(request) - - }, - } -} - -func ipfsVolumeDelete() *core.Command { - return &core.Command{ - Short: `Delete an existing volume`, - Long: `Delete a volume by its ID and every pin attached to this volume. This process can take a while to conclude, depending on the size of your pinned content.`, - Namespace: "ipfs", - Resource: "volume", - Verb: "delete", - // Deprecated: false, - ArgsType: reflect.TypeOf(ipfs.DeleteVolumeRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "volume-id", - Short: `Volume ID`, - Required: true, - Deprecated: false, - Positional: false, - }, - core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw), - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*ipfs.DeleteVolumeRequest) - - client := core.ExtractClient(ctx) - api := ipfs.NewAPI(client) - e = api.DeleteVolume(request) - if e != nil { - return nil, e - } - return &core.SuccessResult{ - Resource: "volume", - Verb: "delete", - }, nil - }, - } -} - -func ipfsPinCreateByURL() *core.Command { - return &core.Command{ - Short: `Create a pin by URL`, - Long: `Will fetch and store the content pointed by the provided URL. The content must be available on the public IPFS network. -The content (IPFS blocks) will be host by the pinning service until pin deletion. -From that point, any other IPFS peer can fetch and host your content: Make sure to pin public or encrypted content. -Many pin requests (from different users) can target the same CID. -A pin is defined by its ID (UUID), its status (queued, pinning, pinned or failed) and target CID.`, - Namespace: "ipfs", - Resource: "pin", - Verb: "create-by-url", - // Deprecated: false, - ArgsType: reflect.TypeOf(ipfs.CreatePinByURLRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "volume-id", - Short: `Volume ID on which you want to pin your content`, - Required: true, - Deprecated: false, - Positional: false, - }, - { - Name: "url", - Short: `URL containing the content you want to pin`, - Required: true, - Deprecated: false, - Positional: false, - }, - { - Name: "name", - Short: `Pin name`, - Required: false, - Deprecated: false, - Positional: false, - }, - core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw), - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*ipfs.CreatePinByURLRequest) - - client := core.ExtractClient(ctx) - api := ipfs.NewAPI(client) - return api.CreatePinByURL(request) - - }, - } -} - -func ipfsPinCreateByCid() *core.Command { - return &core.Command{ - Short: `Create a pin by CID`, - Long: `Will fetch and store the content pointed by the provided CID. The content must be available on the public IPFS network. -The content (IPFS blocks) will be host by the pinning service until pin deletion. -From that point, any other IPFS peer can fetch and host your content: Make sure to pin public or encrypted content. -Many pin requests (from different users) can target the same CID. -A pin is defined by its ID (UUID), its status (queued, pinning, pinned or failed) and target CID.`, - Namespace: "ipfs", - Resource: "pin", - Verb: "create-by-cid", - // Deprecated: false, - ArgsType: reflect.TypeOf(ipfs.CreatePinByCIDRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "volume-id", - Short: `Volume ID on which you want to pin your content`, - Required: true, - Deprecated: false, - Positional: false, - }, - { - Name: "cid", - Short: `CID containing the content you want to pin`, - Required: true, - Deprecated: false, - Positional: false, - }, - { - Name: "origins.{index}", - Short: `Node containing the content you want to pin`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "name", - Short: `Pin name`, - Required: false, - Deprecated: false, - Positional: false, - }, - core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw), - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*ipfs.CreatePinByCIDRequest) - - client := core.ExtractClient(ctx) - api := ipfs.NewAPI(client) - return api.CreatePinByCID(request) - - }, - } -} - -func ipfsPinReplace() *core.Command { - return &core.Command{ - Short: `Replace pin by CID`, - Long: `Deletes the given resource ID and pins the new CID in its place. -Will fetch and store the content pointed by the provided CID. The content must be available on the public IPFS network. -The content (IPFS blocks) is hosted by the pinning service until the pin is deleted. -While the content is available any other IPFS peer can fetch and host your content. For this reason, we recommend that you pin either public or encrypted content. -Several different pin requests can target the same CID. -A pin is defined by its ID (UUID), its status (queued, pinning, pinned or failed) and target CID.`, - Namespace: "ipfs", - Resource: "pin", - Verb: "replace", - // Deprecated: false, - ArgsType: reflect.TypeOf(ipfs.ReplacePinRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "volume-id", - Short: `Volume ID`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "pin-id", - Short: `Pin ID whose information you wish to replace`, - Required: true, - Deprecated: false, - Positional: false, - }, - { - Name: "cid", - Short: `New CID you want to pin in place of the old one`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "name", - Short: `New name to replace`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "origins.{index}", - Short: `Node containing the content you want to pin`, - Required: false, - Deprecated: false, - Positional: false, - }, - core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw), - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*ipfs.ReplacePinRequest) - - client := core.ExtractClient(ctx) - api := ipfs.NewAPI(client) - return api.ReplacePin(request) - - }, - } -} - -func ipfsPinGet() *core.Command { - return &core.Command{ - Short: `Get pin information`, - Long: `Retrieve information about the provided **pin ID**, such as status, last modification, and CID.`, - Namespace: "ipfs", - Resource: "pin", - Verb: "get", - // Deprecated: false, - ArgsType: reflect.TypeOf(ipfs.GetPinRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "volume-id", - Short: `Volume ID`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "pin-id", - Short: `Pin ID of which you want to obtain information`, - Required: true, - Deprecated: false, - Positional: false, - }, - core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw), - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*ipfs.GetPinRequest) - - client := core.ExtractClient(ctx) - api := ipfs.NewAPI(client) - return api.GetPin(request) - - }, - } -} - -func ipfsPinList() *core.Command { - return &core.Command{ - Short: `List all pins within a volume`, - Long: `Retrieve information about all pins within a volume.`, - Namespace: "ipfs", - Resource: "pin", - Verb: "list", - // Deprecated: false, - ArgsType: reflect.TypeOf(ipfs.ListPinsRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "volume-id", - Short: `Volume ID of which you want to list the pins`, - Required: true, - Deprecated: false, - Positional: false, - }, - { - Name: "project-id", - Short: `Project ID`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "order-by", - Short: `Sort order of the returned Volume`, - Required: false, - Deprecated: false, - Positional: false, - EnumValues: []string{"created_at_asc", "created_at_desc"}, - }, - { - Name: "status", - Short: `List pins by status`, - Required: false, - Deprecated: false, - Positional: false, - EnumValues: []string{"unknown_status", "queued", "pinning", "failed", "pinned"}, - }, - { - Name: "organization-id", - Short: `Organization ID`, - Required: false, - Deprecated: false, - Positional: false, - }, - core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw, scw.Region(core.AllLocalities)), - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*ipfs.ListPinsRequest) - - client := core.ExtractClient(ctx) - api := ipfs.NewAPI(client) - opts := []scw.RequestOption{scw.WithAllPages()} - if request.Region == scw.Region(core.AllLocalities) { - opts = append(opts, scw.WithRegions(api.Regions()...)) - request.Region = "" - } - resp, err := api.ListPins(request, opts...) - if err != nil { - return nil, err - } - return resp.Pins, nil - - }, - } -} - -func ipfsPinDelete() *core.Command { - return &core.Command{ - Short: `Create an unpin request`, - Long: `An unpin request means that you no longer own the content. -This content can therefore be removed and no longer provided on the IPFS network.`, - Namespace: "ipfs", - Resource: "pin", - Verb: "delete", - // Deprecated: false, - ArgsType: reflect.TypeOf(ipfs.DeletePinRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "volume-id", - Short: `Volume ID`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "pin-id", - Short: `Pin ID you want to remove from the volume`, - Required: true, - Deprecated: false, - Positional: false, - }, - core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw), - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*ipfs.DeletePinRequest) - - client := core.ExtractClient(ctx) - api := ipfs.NewAPI(client) - e = api.DeletePin(request) - if e != nil { - return nil, e - } - return &core.SuccessResult{ - Resource: "pin", - Verb: "delete", - }, nil - }, - } -} - -func ipnsNameCreate() *core.Command { - return &core.Command{ - Short: `Create a new name`, - Long: `You can use the ` + "`" + `ipns key` + "`" + ` command to list and generate more names and their respective keys.`, - Namespace: "ipns", - Resource: "name", - Verb: "create", - // Deprecated: false, - ArgsType: reflect.TypeOf(ipfs.IpnsAPICreateNameRequest{}), - ArgSpecs: core.ArgSpecs{ - core.ProjectIDArgSpec(), - { - Name: "name", - Short: `Name for your records`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "value", - Short: `Value you want to associate with your records, CID or IPNS key`, - Required: false, - Deprecated: false, - Positional: false, - }, - core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw), - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*ipfs.IpnsAPICreateNameRequest) - - client := core.ExtractClient(ctx) - api := ipfs.NewIpnsAPI(client) - return api.CreateName(request) - - }, - } -} - -func ipnsNameGet() *core.Command { - return &core.Command{ - Short: `Get information about a name`, - Long: `Retrieve information about a specific name.`, - Namespace: "ipns", - Resource: "name", - Verb: "get", - // Deprecated: false, - ArgsType: reflect.TypeOf(ipfs.IpnsAPIGetNameRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "name-id", - Short: `Name ID whose information you want to retrieve`, - Required: true, - Deprecated: false, - Positional: false, - }, - core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw), - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*ipfs.IpnsAPIGetNameRequest) - - client := core.ExtractClient(ctx) - api := ipfs.NewIpnsAPI(client) - return api.GetName(request) - - }, - } -} - -func ipnsNameDelete() *core.Command { - return &core.Command{ - Short: `Delete an existing name`, - Long: `Delete a name by its ID.`, - Namespace: "ipns", - Resource: "name", - Verb: "delete", - // Deprecated: false, - ArgsType: reflect.TypeOf(ipfs.IpnsAPIDeleteNameRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "name-id", - Short: `Name ID you wish to delete`, - Required: true, - Deprecated: false, - Positional: false, - }, - core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw), - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*ipfs.IpnsAPIDeleteNameRequest) - - client := core.ExtractClient(ctx) - api := ipfs.NewIpnsAPI(client) - e = api.DeleteName(request) - if e != nil { - return nil, e - } - return &core.SuccessResult{ - Resource: "name", - Verb: "delete", - }, nil - }, - } -} - -func ipnsNameList() *core.Command { - return &core.Command{ - Short: `List all names by a Project ID`, - Long: `Retrieve information about all names from a Project ID.`, - Namespace: "ipns", - Resource: "name", - Verb: "list", - // Deprecated: false, - ArgsType: reflect.TypeOf(ipfs.IpnsAPIListNamesRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "project-id", - Short: `Project ID`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "order-by", - Short: `Sort the order of the returned names`, - Required: false, - Deprecated: false, - Positional: false, - EnumValues: []string{"created_at_asc", "created_at_desc"}, - }, - { - Name: "organization-id", - Short: `Organization ID`, - Required: false, - Deprecated: false, - Positional: false, - }, - core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw, scw.Region(core.AllLocalities)), - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*ipfs.IpnsAPIListNamesRequest) - - client := core.ExtractClient(ctx) - api := ipfs.NewIpnsAPI(client) - opts := []scw.RequestOption{scw.WithAllPages()} - if request.Region == scw.Region(core.AllLocalities) { - opts = append(opts, scw.WithRegions(api.Regions()...)) - request.Region = "" - } - resp, err := api.ListNames(request, opts...) - if err != nil { - return nil, err - } - return resp.Names, nil - - }, - } -} - -func ipnsNameUpdate() *core.Command { - return &core.Command{ - Short: `Update name information`, - Long: `Update name information (CID, tag, name...).`, - Namespace: "ipns", - Resource: "name", - Verb: "update", - // Deprecated: false, - ArgsType: reflect.TypeOf(ipfs.IpnsAPIUpdateNameRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "name-id", - Short: `Name ID you wish to update`, - Required: true, - Deprecated: false, - Positional: false, - }, - { - Name: "name", - Short: `New name you want to associate with your record`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "tags.{index}", - Short: `New tags you want to associate with your record`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "value", - Short: `Value you want to associate with your records, CID or IPNS key`, - Required: false, - Deprecated: false, - Positional: false, - }, - core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw), - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*ipfs.IpnsAPIUpdateNameRequest) - - client := core.ExtractClient(ctx) - api := ipfs.NewIpnsAPI(client) - return api.UpdateName(request) - - }, - } -} - -func ipnsNameExportKey() *core.Command { - return &core.Command{ - Short: `Export your private key`, - Long: `Export a private key by its ID.`, - Namespace: "ipns", - Resource: "name", - Verb: "export-key", - // Deprecated: false, - ArgsType: reflect.TypeOf(ipfs.IpnsAPIExportKeyNameRequest{}), - ArgSpecs: core.ArgSpecs{ - { - Name: "name-id", - Short: `Name ID whose keys you want to export`, - Required: true, - Deprecated: false, - Positional: false, - }, - core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw), - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*ipfs.IpnsAPIExportKeyNameRequest) - - client := core.ExtractClient(ctx) - api := ipfs.NewIpnsAPI(client) - return api.ExportKeyName(request) - - }, - } -} - -func ipnsNameImportKey() *core.Command { - return &core.Command{ - Short: `Import your private key`, - Long: `Import a private key.`, - Namespace: "ipns", - Resource: "name", - Verb: "import-key", - // Deprecated: false, - ArgsType: reflect.TypeOf(ipfs.IpnsAPIImportKeyNameRequest{}), - ArgSpecs: core.ArgSpecs{ - core.ProjectIDArgSpec(), - { - Name: "name", - Short: `Name for your records`, - Required: false, - Deprecated: false, - Positional: false, - }, - { - Name: "private-key", - Short: `Base64 private key`, - Required: true, - Deprecated: false, - Positional: false, - }, - { - Name: "value", - Short: `Value you want to associate with your records, CID or IPNS key`, - Required: false, - Deprecated: false, - Positional: false, - }, - core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw), - }, - Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { - request := args.(*ipfs.IpnsAPIImportKeyNameRequest) - - client := core.ExtractClient(ctx) - api := ipfs.NewIpnsAPI(client) - return api.ImportKeyName(request) - - }, - } -} From 138fa1cc111874774a7dc8bcc09bf342bf1483a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Thu, 28 Nov 2024 15:26:35 +0100 Subject: [PATCH 2/2] Fix --- core/cobra_builder.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/cobra_builder.go b/core/cobra_builder.go index 4cb1ab029b..e931ace71b 100644 --- a/core/cobra_builder.go +++ b/core/cobra_builder.go @@ -28,9 +28,8 @@ type cobraBuilder struct { func (b *cobraBuilder) build() *cobra.Command { groups := map[string]*cobra.Group{ "available": {ID: "available", Title: "AVAILABLE"}, - //"labs": {ID: "labs", Title: "AVAILABLE LABS"}, - "config": {ID: "config", Title: "CONFIGURATION"}, - "utility": {ID: "utility", Title: "UTILITY"}, + "config": {ID: "config", Title: "CONFIGURATION"}, + "utility": {ID: "utility", Title: "UTILITY"}, } commands := b.commands.GetAll()