Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DBAAS: support for user operations #654

Merged
merged 15 commits into from
Dec 9, 2024
Merged

Conversation

tgrondier
Copy link
Member

@tgrondier tgrondier commented Nov 29, 2024

Description

This adds for the following API calls:

  • Creating users for supported DBAAS services
  • Deleting users for supported DBAAS services
  • Resetting user credentials for supported DBAAS services
  • Listing and showing user details for supported DBAAS services

Checklist

(For exoscale contributors)

  • Changelog updated (under Unreleased block)
  • Testing

Testing






➜  ~/exo/cli git:(tgrondier/sc-104242/cli-users) ✗ go run . dbaas user delete test myuser3                                                                                                                                  24-11-29 16:12 
[+] Are you sure you want to delete user "myuser3" [yN]: y
 ✔ Creating DBaaS user "myuser3" 0s
┼───────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼
│   DATABASE SERVICE    │                                                                                                                              │
┼───────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼
│ Zone                  │ ch-gva-2                                                                                                                     │
│ Name                  │ test                                                                                                                         │
│ Type                  │ mysql                                                                                                                        │
│ Plan                  │ hobbyist-2                                                                                                                   │
│ Disk Size             │ 8.0 GiB                                                                                                                      │
│ State                 │ running                                                                                                                      │
│ Creation Date         │ 2024-11-29 15:00:34 +0000 UTC                                                                                                │
│ Update Date           │ 2024-11-29 15:02:56 +0000 UTC                                                                                                │
│ Nodes                 │ 1                                                                                                                            │
│ Node CPUs             │ 2                                                                                                                            │
│ Node Memory           │ 2.0 GiB                                                                                                                      │
│ Termination Protected │ false                                                                                                                        │
│ Maintenance           │ saturday (19:26:58)                                                                                                          │
...
│ Users                 │ avnadmin (primary)                                                                                                           │

┼───────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼



➜  ~/exo/cli git:(tgrondier/sc-104242/cli-users) ✗ go run . dbaas user reset-credentials test myuser2                                                                                                                                                                                                       24-12-02 10:52 
 ✔ Resetting DBaaS user "myuser2" 0s
┼────────────────┼──────────────────────────┼
│  SERVICE USER  │                          │
┼────────────────┼──────────────────────────┼
│ Username       │ myuser2                  │
│ Type           │ regular                  │
│ Password       │ AVNS_46o-1gO9pE8acEc9Nzp │
│ Access Control │   Categories             │
│                │   Channels     *         │
│                │   Commands               │
│                │   Keys                   │
│                │                          │
┼────────────────┼──────────────────────────┼


➜  ~/exo/cli git:(tgrondier/sc-104242/cli-users) ✗ go run . dbaas user create test myuser2                                                                                                                                                                                                                  24-12-02 10:46 
 ✔ Creating DBaaS user "myuser2" 0s
┼────────────────┼──────────────────────────┼
│  SERVICE USER  │                          │
┼────────────────┼──────────────────────────┼
│ Username       │ myuser2                  │
│ Type           │ normal                   │
│ Password       │ AVNS_QWLuqR0A_FCAll3JiVN │
│ Authentication │ caching_sha2_password    │
┼────────────────┼──────────────────────────┼

@tgrondier tgrondier force-pushed the tgrondier/sc-104242/cli-users branch from 060fecb to da30717 Compare November 29, 2024 15:27
@tgrondier tgrondier force-pushed the tgrondier/sc-104242/cli-users branch from da30717 to 105090e Compare November 29, 2024 15:29
@tgrondier tgrondier marked this pull request as ready for review December 2, 2024 09:58
@clovisgenevard
Copy link

Hello! Could someone provide some context about this release, the roadmap, or anything else relevant so @ridge can work on the changelog and community update?

cmd/dbaas_user_show_redis.go Outdated Show resolved Hide resolved
cmd/dbaas_user_reset_redis.go Outdated Show resolved Hide resolved
Copy link
Member

@ste-m ste-m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not add Redis in any way.
It's going to be deprecated by Aiven (last week's news) and we will need to remove it from our CLI as well, during first half (quarter?) of 2025.
If instead we consider that since the work has been already done, better deliver it, then i would remove the ACLs management for Redis, which is not fully supported.

@tgrondier
Copy link
Member Author

Removed all redis support from this PR ( efdee4f )

@ste-m
Copy link
Member

ste-m commented Dec 2, 2024

Hello! Could someone provide some context about this release, the roadmap, or anything else relevant so @ridge can work on the changelog and community update?

Nothing super new @clovisgenevard , we are simply aligning the clients.
When we release a feature we reach API level, then clients follow on their own rhythm.
Sometimes some parts are being left behind for a while. In this case the features exists since long, but the CLI had no opportunity to follow.
If you want to communicate you can do something on the lines of "DBaaS user management is now available in the CLI".

cmd/dbaas_user_show_kafka.go Outdated Show resolved Hide resolved
@tgrondier tgrondier marked this pull request as draft December 2, 2024 16:04
@retrack
Copy link
Member

retrack commented Dec 2, 2024

I would not add Redis in any way. It's going to be deprecated by Aiven (last week's news) and we will need to remove it from our CLI as well, during first half (quarter?) of 2025. If instead we consider that since the work has been already done, better deliver it, then i would remove the ACLs management for Redis, which is not fully supported.

redis is going to be replaced as a drop in by valkey under the same naming: Caching, so not sure we should avoid doing redis now.

@tgrondier tgrondier force-pushed the tgrondier/sc-104242/cli-users branch from ac6cb06 to 3e80a06 Compare December 2, 2024 16:24
@tgrondier tgrondier marked this pull request as ready for review December 2, 2024 16:25
@ste-m
Copy link
Member

ste-m commented Dec 3, 2024

redis is going to be replaced as a drop in by valkey under the same naming: Caching, so not sure we should avoid doing redis now.

For one thing, the commands will all change name. To my understanding it's NOT an in-place substitution, is a NEW service, and customer will need to adapt to new endpoints, new commands, new naming etc etc. Their services will not just renamed "Valkey" under the hood, they will be MIGRATED to Valkey. I would not encourage using redis when we are going to deprecate it by the end of the month: it will soon not be possible anymore to create a new redis services and i doubt we will have Valkey before Februray at soonest.

Copy link
Member

@pierre-emmanuelJ pierre-emmanuelJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @tgrondier !

@tgrondier tgrondier merged commit 4e00cc6 into master Dec 9, 2024
2 checks passed
@tgrondier tgrondier deleted the tgrondier/sc-104242/cli-users branch December 9, 2024 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants