Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Ceph Webapp Poc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Jacopo Gasparetto
Ceph Webapp Poc
Commits
bd6545b4
Commit
bd6545b4
authored
1 year ago
by
Jacopo Gasparetto
Browse files
Options
Downloads
Patches
Plain Diff
Rename BucketReponse to BucketInfoResponse
parent
fd202cb9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
backend/src/ceph_service.py
+3
-3
3 additions, 3 deletions
backend/src/ceph_service.py
backend/src/models/buckets.py
+3
-1
3 additions, 1 deletion
backend/src/models/buckets.py
backend/src/routes/buckets.py
+2
-2
2 additions, 2 deletions
backend/src/routes/buckets.py
with
8 additions
and
6 deletions
backend/src/ceph_service.py
+
3
−
3
View file @
bd6545b4
from
models.buckets
import
Bucket
,
BucketRWAccess
,
BucketResponse
from
models.buckets
import
Bucket
,
BucketRWAccess
,
Bucket
Info
Response
import
boto3
import
json
import
os
...
...
@@ -20,7 +20,7 @@ def get_s3_client():
)
def
list_buckets
()
->
BucketResponse
:
def
list_buckets
()
->
Bucket
Info
Response
:
s3
=
get_s3_client
()
client
=
s3
.
meta
.
client
response
=
client
.
list_buckets
()
...
...
@@ -49,4 +49,4 @@ def list_buckets() -> BucketResponse:
objects
=
n_objects
,
size
=
size_byte
)
return
BucketResponse
(
buckets
=
buckets
,
total
=
len
(
buckets
))
return
Bucket
Info
Response
(
buckets
=
buckets
,
total
=
len
(
buckets
))
This diff is collapsed.
Click to expand it.
backend/src/models/buckets.py
+
3
−
1
View file @
bd6545b4
...
...
@@ -16,6 +16,8 @@ class Bucket(BaseModel):
objects
:
int
size
:
int
class
BucketResponse
(
BaseModel
):
class
BucketInfoResponse
(
BaseModel
):
buckets
:
List
[
Bucket
]
total
:
int
This diff is collapsed.
Click to expand it.
backend/src/routes/buckets.py
+
2
−
2
View file @
bd6545b4
from
models.buckets
import
BucketResponse
from
models.buckets
import
Bucket
Info
Response
from
fastapi
import
APIRouter
import
ceph_service
...
...
@@ -6,5 +6,5 @@ router = APIRouter()
@router.get
(
"
/buckets
"
)
def
list_buckets
()
->
BucketResponse
:
def
list_buckets
()
->
Bucket
Info
Response
:
return
ceph_service
.
list_buckets
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment