-
Notifications
You must be signed in to change notification settings - Fork 36
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
Added S3 user management #127
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,11 @@ jobs: | |
run: ~/actionutils.sh free_runner_disk | ||
|
||
- name: Install dependencies | ||
run: ~/actionutils.sh setup_lxd | ||
run: | | ||
# boto3 for appS3 test script. | ||
sudo python -m pip install --upgrade pip | ||
sudo pip install boto3 | ||
~/actionutils.sh setup_lxd | ||
|
||
- name: Create containers with loopback devices | ||
run: ~/actionutils.sh create_containers | ||
|
@@ -50,7 +54,7 @@ jobs: | |
run: ~/actionutils.sh headexec enable_rgw | ||
|
||
- name: Exercise RGW | ||
run: ~/actionutils.sh headexec testrgw | ||
run: ~/actionutils.sh headexec testrgw_old | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Naming nit: maybe a more descriptive name instead of testrgw_old |
||
|
||
- name: Upgrade to candidate | ||
run: ~/actionutils.sh refresh_snap quincy/candidate | ||
|
@@ -59,4 +63,4 @@ jobs: | |
run: ~/actionutils.sh headexec wait_for_osds 3 | ||
|
||
- name: Exercise RGW again | ||
run: ~/actionutils.sh headexec testrgw | ||
run: ~/actionutils.sh testrgw_on_headnode |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,7 @@ Pre | |
mds | ||
mon | ||
rgw | ||
radosgw | ||
rbd | ||
RBD | ||
MgrReports | ||
|
@@ -64,3 +65,4 @@ Noout | |
Unsetting | ||
cephfs | ||
filesystems | ||
json |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
Manage S3 users on MicroCeph | ||
============================= | ||
|
||
MicroCeph provides an easy to use interface for creating, viewing and deleting s3 users for interfacing with the RGW endpoint. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggest: capitalize S3 here and below (proper noun) |
||
This enables smooth and easy access to Object Storage. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggest: s/Object Storage/object storage/ |
||
|
||
.. list-table:: Supported s3-user operations | ||
:widths: 30 70 | ||
:header-rows: 1 | ||
|
||
* - Operation | ||
- Description | ||
* - create | ||
- Create provided s3 (radosgw) user with optionally provided access-key and secret | ||
* - delete | ||
- Delete provided s3 (radosgw) user | ||
* - get | ||
- Fetch key information of the provided s3 (radosgw) user | ||
* - list | ||
- List all s3 (radosgw) users | ||
.. note:: Users can additionally provide --json flag to create and get commands to dump a much detailed | ||
|
||
1. Create an S3 user (optionally provide --access-key --secret and --json) | ||
|
||
.. code-block:: shell | ||
|
||
$ sudo microceph s3-user create newTestUser --access-key=ThisIsAccessKey --secret=ThisIsSecret --json | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Think the cmdline here doesn't match up with the implementation? |
||
{ | ||
"user_id": "newTestUser", | ||
"display_name": "newTestUser", | ||
"email": "", | ||
"suspended": 0, | ||
"max_buckets": 1000, | ||
"subusers": [], | ||
"keys": [ | ||
{ | ||
"user": "newTestUser", | ||
"access_key": "ThisIsAccessKey", | ||
"secret_key": "ThisIsSecret" | ||
} | ||
], | ||
"swift_keys": [], | ||
"caps": [], | ||
"op_mask": "read, write, delete", | ||
"default_placement": "", | ||
"default_storage_class": "", | ||
"placement_tags": [], | ||
"bucket_quota": { | ||
"enabled": false, | ||
"check_on_raw": false, | ||
"max_size": -1, | ||
"max_size_kb": 0, | ||
"max_objects": -1 | ||
}, | ||
"user_quota": { | ||
"enabled": false, | ||
"check_on_raw": false, | ||
"max_size": -1, | ||
"max_size_kb": 0, | ||
"max_objects": -1 | ||
}, | ||
"temp_url_keys": [], | ||
"type": "rgw", | ||
"mfa_ids": [] | ||
} | ||
|
||
2. List all s3 users : | ||
|
||
.. code-block:: shell | ||
|
||
$ sudo microceph s3-user list | ||
+---+-------------+ | ||
| # | NAME | | ||
+---+-------------+ | ||
| 1 | newTestUser | | ||
+---+-------------+ | ||
| 2 | testUser | | ||
+---+-------------+ | ||
|
||
3. Get details of a an s3 user (optionally use --json flag to get complete details): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo, s/a an/an/ |
||
|
||
.. code-block:: shell | ||
|
||
$ sudo microceph s3-user get testUser | ||
+----------+----------------------+---------+ | ||
| NAME | ACCESS KEY | SECRET | | ||
+----------+----------------------+---------+ | ||
| testUser | ThisIsAccessKey | ThisIsSecret | | ||
+----------+----------------------+---------+ | ||
|
||
4. Delete an s3 user: | ||
|
||
.. code-block:: shell | ||
|
||
$ sudo microceph s3-user delete newTestUser | ||
$ sudo microceph s3-user list | ||
+---+----------+ | ||
| # | NAME | | ||
+---+----------+ | ||
| 1 | testUser | | ||
+---+----------+ | ||
|
||
.. warning:: All the related buckets+objects should be deleted before deletion of the user. | ||
|
||
For more fine-tuned user management use `radosgw-admin CLI <https://docs.ceph.com/en/latest/man/8/radosgw-admin/>`_ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package api | ||
|
||
import "github.com/canonical/microcluster/rest" | ||
|
||
// Top level client API | ||
var clientCmd = rest.Endpoint{ | ||
Path: "client", | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see these lines being repeated
Maybe could refactor the actionutils.sh a bit to have a
setup_host
function instead ofsetup_lxd
that handles all deps