Commit graph

36 commits

Author SHA1 Message Date
Pavel Karpy
8c59ade4ed [#854] cli: Do not use global flags
Also delete `ttl` and `xhdr` flags from
`accounting balance` command and refactor
command initialization.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-10-04 12:12:21 +03:00
Pavel Karpy
3c848b2cad [#788] cli: Wrap/sync errors
Add context to error messages. Sync error
messages for errors with the same context.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-09-07 09:52:53 +03:00
Pavel Karpy
9b32b5523d [#760] cli: Support COMMON_PREFIX matchtype
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-08-27 15:03:15 +03:00
Pavel Karpy
3a7d7bdecd [#665] cli: Set non-zero exit codes in err cases
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-07-06 18:10:38 +03:00
Leonard Lyubich
56d4410913 [#638] Update to Go 1.16
Changes:

  * replace `iotuil` elements with the ones from `os` package;
  * replace `os.Filemode` with `fs.FileMode`;
  * use `signal.NotifyContext` instead of `NewGracefulContext` (removed).

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-06-29 13:44:59 +03:00
Pavel Karpy
14afc6a1e5 [#635] cli: Do not enter password twice
Obtain key once in every cobra command to
pass it to `getOwnerID` and `initSession`
and do not ask to enter password more than
one time in `put` and `putSG` operations.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-06-23 10:22:28 +03:00
Pavel Karpy
02ca1c4cc1 [#624] cli: Do not print help on any failure
Change usage function to `Run`(does not return
err). Log errors with `cmd.PrintErrln`. Change
all `fmt.Print*` to `cmd.Print*`.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-06-23 10:08:40 +03:00
Pavel Karpy
af72412b77 [#624] cli/object: Fix error messages
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-06-23 10:08:40 +03:00
Leonard Lyubich
3dd10b6795 [#570] *: Remove usage of deprecated elements from API Go library
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-05-31 20:45:15 +03:00
Evgenii Stratonikov
60d74bce67 [#466] cli: support NEP-2 and NEP-6 key formats
NEP-2 is contains WIF encrypted with password.
NEP-6 is format used for neo-go wallets.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-04-23 10:11:47 +03:00
Leonard Lyubich
383d2494eb [#425] Adapt the Client's refactoring to the interface
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-03-17 15:00:37 +03:00
Leonard Lyubich
2bb48642ee [#393] cli: Add dedicated flag to indicate object expiration
Add `--expires-on` flag to `put` sub-command of `object` command that
indicates object's expiration epoch. Set corresponding object attributes if
flag value is set.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-02-24 11:14:22 +03:00
Leonard Lyubich
6cb906ab5f [#362] cli/object: Support JSON input of search filter
Consider single word of search filter expression as path to file with
protobuf JSON filters. Decode filters from file and add them to the rest.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-02-11 14:01:35 +03:00
Leonard Lyubich
6039cd119c [#362] cli/object: Change query language of search filters
Make `--filters` flag to be repeated. Define new filter expression format:
 * `<key> <binary_op> <value>` for binary filters. Supported binary ops: `EQ` (`STRING_EQUAL`), `NE` (`STRING_NOT_EQUAL`).
 * `<key> <unary_op>` for unary filters. Supported unary ops: `NOPRESENT` (`NOT_PRESENT`).
Any other string expressions are considered invalid.

Additionally support shorthand flag `-f`.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-02-11 14:01:35 +03:00
Leonard Lyubich
1e170c3812 [#234] services/object: Support netmap epoch and lookup dead in read ops
Support processing of NetmapEpoch and NetmapLookupDepth X-headers when
processing object read operations. Placement for operations
Get/Head/GetRange/GetRangeHash/Search is built for the epoch specified in
NetmapEpoch X-header (by default latest). Also the specified operations are
processed until success is achieved for network maps from the past up to
NetmapLookupDepth value. Behavior for default values (zero or missing) left
unchanged.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-01-12 19:19:11 +03:00
Alex Vanin
0f3570bdeb [#302] Fix golint naming linter errors
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-01-12 18:47:02 +03:00
Leonard Lyubich
07a6e2cc43 [#290] cmd/cli: Trim 0x prefix from salt argument of object hash cmd
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-01-11 18:40:59 +03:00
Leonard Lyubich
6df8c84fc2 [#290] cmd/cli: Add salt flag to object hash command
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-01-11 18:40:59 +03:00
Leonard Lyubich
51b85b0a73 [#278] cli: Support request X-Headers
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-12-24 15:03:02 +03:00
Alex Vanin
7daf3727ee [#248] neofs-cli/object: Print split header values in Head command
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-12-14 14:46:59 +03:00
Leonard Lyubich
6814140a19 [#240] cmd/cli: Support raw flag in object GET/HEAD/RANGE commands
Support boolean raw flag. Print split information upon receipt.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-12-14 12:05:13 +03:00
Leonard Lyubich
09916f21b5 [#243] cmd/cli: Write tombstone address in Object.Delete cmd
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-12-11 17:19:37 +03:00
Alex Vanin
4c0ca23b34 [#208] Print split ID in object.Head output of neofs-cli
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-11-30 10:44:15 +03:00
Leonard Lyubich
ea36789b51 [#179] cmd/neofs-cli: Implement range command in Object section
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-11-23 13:23:31 +03:00
Leonard Lyubich
dbfb6fadd6 [#177] cmd/neofs-cli: Add object ID filter flag to search cmd
Add "oid" flag that allows to filter objects by identifier.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-11-23 09:54:59 +03:00
Leonard Lyubich
58fcb35fb0 [#174] Use Marshal(JSON)/Unmarshal(JSON) methods for encoding/decoding
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-11-17 11:56:00 +03:00
Leonard Lyubich
3de8febe57 [#174] Update to latest neofs-api-go changes
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-11-17 11:56:00 +03:00
Alex Vanin
e47c866d6a [#169] Add --ttl argument in CLI
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-11-16 12:50:21 +03:00
Alex Vanin
e580f2afd6 [#160] Update object CLI flags
* remove no-leaf
* rename leaf to phy
* remove no-root

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-11-16 10:02:12 +03:00
Alex Vanin
64caa15556 [#148] Use base name as FileName attribute value
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-11-05 18:37:06 +03:00
Alex Vanin
54818d5a11 [#144] Support well-known application attributes for object in CLI
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-11-05 09:28:13 +03:00
Alex Vanin
b12d26f974 Update neofs-api-go to latest version
Handle errors provided by JSON encoders.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-10-30 11:28:49 +03:00
Alex Vanin
e7f9da9139 [#120] Add --bearer argument in CLI
Bearer token should be stored in file and correctly
signed.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-10-23 15:31:04 +03:00
Alex Vanin
1482b0c5d0 [#79] Simplify getCID and getOID functions in CLI
Parser from string is available in neofs-api-go.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-10-21 18:22:59 +03:00
Evgenii Stratonikov
4d2ff842a2 [#79] Implement object commands
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2020-10-19 14:35:39 +03:00
Stanislav Bogatyrev
246a15de35 cli: Add empty neofs-cli app structure
In the following release `neofs-cli` will be used to directly manage NeoFS Node.
All required definitions and interfaces are also moving from `neofs-api` to
`neofs-node` repository, so it's more convinient to have `neofs-cli` here.

Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
2020-10-02 11:25:35 +03:00