adm: Support frostfsid operations #908

Merged
fyrchik merged 4 commits from dkirillov/frostfs-node:feature/adm_interact_with_frostfsid into master 2024-01-19 11:04:05 +00:00
Member

Add frostfsid interactions:

$ frostfs-adm -c frostfs-adm.yml morph frostfsid create-namespace --namespace tmp

$ frostfs-adm -c frostfs-adm.yml morph frostfsid list-namespaces
<root>
tmp

$ frostfs-adm -c frostfs-adm.yml morph frostfsid create-subject --subject-name s3 --subject-key 0313b1ac3a8076e155a7e797b24f0b650cccad5941ea59d7cfd51a024a8b2a06bf

$ frostfs-adm -c frostfs-adm.yml morph frostfsid list-subjects --include-names
NUUb82KR2JrVByHs2YSKgtK29gKnF5q6Vt (s3)

$ frostfs-adm -c frostfs-adm.yml morph frostfsid list-subjects --namespace tmp

$ frostfs-adm -c frostfs-adm.yml morph frostfsid create-group --group-name to
group 'to' created with id: 1

$ frostfs-adm -c frostfs-adm.yml morph frostfsid list-groups
to (1)

$ frostfs-adm -c frostfs-adm.yml morph frostfsid add-subject-to-group --subject-address NUUb82KR2JrVByHs2YSKgtK29gKnF5q6Vt --group-id 1

$ frostfs-adm -c frostfs-adm.yml morph frostfsid list-group-subjects --group-id 1 --include-names
NUUb82KR2JrVByHs2YSKgtK29gKnF5q6Vt (s3)

$ frostfs-adm -c frostfs-adm.yml morph frostfsid remove-subject-from-group --subject-address NUUb82KR2JrVByHs2YSKgtK29gKnF5q6Vt --group-id 1

$ frostfs-adm -c frostfs-adm.yml morph frostfsid list-group-subjects --group-id 1 

$ frostfs-adm -c frostfs-adm.yml morph frostfsid delete-subject --subject-address NUUb82KR2JrVByHs2YSKgtK29gKnF5q6Vt

$ frostfs-adm -c frostfs-adm.yml morph frostfsid list-subjects 

$ frostfs-adm -c frostfs-adm.yml morph frostfsid delete-group --group-id 1

$ frostfs-adm -c frostfs-adm.yml morph frostfsid list-groups 

In operations where namespace is required to invoke method if flag namespace isn't provide the default one (empty namespace) will be used

Add frostfsid interactions: ``` $ frostfs-adm -c frostfs-adm.yml morph frostfsid create-namespace --namespace tmp $ frostfs-adm -c frostfs-adm.yml morph frostfsid list-namespaces <root> tmp $ frostfs-adm -c frostfs-adm.yml morph frostfsid create-subject --subject-name s3 --subject-key 0313b1ac3a8076e155a7e797b24f0b650cccad5941ea59d7cfd51a024a8b2a06bf $ frostfs-adm -c frostfs-adm.yml morph frostfsid list-subjects --include-names NUUb82KR2JrVByHs2YSKgtK29gKnF5q6Vt (s3) $ frostfs-adm -c frostfs-adm.yml morph frostfsid list-subjects --namespace tmp $ frostfs-adm -c frostfs-adm.yml morph frostfsid create-group --group-name to group 'to' created with id: 1 $ frostfs-adm -c frostfs-adm.yml morph frostfsid list-groups to (1) $ frostfs-adm -c frostfs-adm.yml morph frostfsid add-subject-to-group --subject-address NUUb82KR2JrVByHs2YSKgtK29gKnF5q6Vt --group-id 1 $ frostfs-adm -c frostfs-adm.yml morph frostfsid list-group-subjects --group-id 1 --include-names NUUb82KR2JrVByHs2YSKgtK29gKnF5q6Vt (s3) $ frostfs-adm -c frostfs-adm.yml morph frostfsid remove-subject-from-group --subject-address NUUb82KR2JrVByHs2YSKgtK29gKnF5q6Vt --group-id 1 $ frostfs-adm -c frostfs-adm.yml morph frostfsid list-group-subjects --group-id 1 $ frostfs-adm -c frostfs-adm.yml morph frostfsid delete-subject --subject-address NUUb82KR2JrVByHs2YSKgtK29gKnF5q6Vt $ frostfs-adm -c frostfs-adm.yml morph frostfsid list-subjects $ frostfs-adm -c frostfs-adm.yml morph frostfsid delete-group --group-id 1 $ frostfs-adm -c frostfs-adm.yml morph frostfsid list-groups ``` In operations where namespace is required to invoke method if flag `namespace` isn't provide the default one (empty namespace) will be used
dkirillov force-pushed feature/adm_interact_with_frostfsid from 1f118dc161 to 18538a85bf 2024-01-12 15:03:35 +00:00 Compare
dkirillov changed title from WIP: [#XX] adm: Support frostfsid basic operations to WIP: [#908] adm: Support frostfsid basic operations 2024-01-15 08:47:42 +00:00
dkirillov force-pushed feature/adm_interact_with_frostfsid from 18538a85bf to 695706e479 2024-01-15 08:49:05 +00:00 Compare
dkirillov force-pushed feature/adm_interact_with_frostfsid from 695706e479 to eaff92614b 2024-01-15 08:49:39 +00:00 Compare
dkirillov changed title from WIP: [#908] adm: Support frostfsid basic operations to WIP: [#908] adm: Support frostfsid operations 2024-01-15 09:29:47 +00:00
dkirillov force-pushed feature/adm_interact_with_frostfsid from eaff92614b to be04d69538 2024-01-15 09:34:51 +00:00 Compare
dkirillov changed title from WIP: [#908] adm: Support frostfsid operations to [#908] adm: Support frostfsid operations 2024-01-15 09:36:20 +00:00
dkirillov requested review from storage-core-committers 2024-01-15 09:36:35 +00:00
dkirillov requested review from storage-core-developers 2024-01-15 09:36:39 +00:00

$ frostfs-adm -c frostfs-adm.yml morph frostfsid list-namespaces
"tmp"
""

Maybe add some placeholder for root namespace?

``` $ frostfs-adm -c frostfs-adm.yml morph frostfsid list-namespaces "tmp" "" ``` Maybe add some placeholder for root namespace?
dstepanov-yadro approved these changes 2024-01-15 13:52:07 +00:00
Member

Why there are no delete-group command?

Why there are no `delete-group` command?
aarifullin approved these changes 2024-01-16 07:34:01 +00:00
fyrchik changed title from [#908] adm: Support frostfsid operations to adm: Support frostfsid operations 2024-01-16 13:47:41 +00:00
fyrchik reviewed 2024-01-16 13:56:51 +00:00
@ -0,0 +196,4 @@
frostfsidListGroupSubjectsCmd.Flags().Bool(includeNamesFlag, false, "Whether include subject name (require additional requests)")
}
func frostfsidCreateNamespace(cmd *cobra.Command, _ []string) {
Owner

Why is it frostfsID in some functions and frostfsid in others?

Why is it `frostfsID` in some functions and `frostfsid` in others?
@ -0,0 +216,4 @@
sort.Slice(namespaces, func(i, j int) bool { return namespaces[i].Name < namespaces[j].Name })
for _, namespace := range namespaces {
cmd.Printf("%q\n", namespace.Name)
Owner

Why is it %q and not %s? Makes sense to take spaces into account and display empty strings.
The latter is addressed by @dstepanov-yadro comment and the former should not be popular, especially with some validation -- namespace creation is not something an arbitrary user can do.

Why is it `%q` and not `%s`? Makes sense to take spaces into account and display empty strings. The latter is addressed by @dstepanov-yadro comment and the former should not be popular, especially with some validation -- namespace creation is not something an arbitrary user can do.
Owner

%s is also easier to process with bash scripts.

`%s` is also easier to process with bash scripts.
dkirillov force-pushed feature/adm_interact_with_frostfsid from be04d69538 to 6d753003d8 2024-01-17 08:43:17 +00:00 Compare
dkirillov force-pushed feature/adm_interact_with_frostfsid from 6d753003d8 to d62bdec373 2024-01-17 08:46:01 +00:00 Compare
aarifullin approved these changes 2024-01-17 10:19:50 +00:00
dkirillov force-pushed feature/adm_interact_with_frostfsid from d62bdec373 to 5f67387506 2024-01-18 08:39:15 +00:00 Compare
dkirillov force-pushed feature/adm_interact_with_frostfsid from 5f67387506 to 29da568dca 2024-01-18 09:02:20 +00:00 Compare
fyrchik merged commit e42262a863 into master 2024-01-19 11:04:05 +00:00
dkirillov deleted branch feature/adm_interact_with_frostfsid 2024-01-19 11:51:47 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#908
No description provided.