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

Group page and user quotas #750

Merged
merged 14 commits into from
May 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions applications/accounts-api/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,66 @@ paths:
type: string
in: path
required: true
'/groups/{groupname}/':
get:
tags:
- groups
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Group'
description: Get a user's public information
operationId: getGroup
put:
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/User'
required: true
tags:
- groups
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/User'
description: The user as just saved
security:
-
bearerAuth: []
operationId: updateGroup
parameters:
-
name: groupname
schema:
type: string
in: path
required: true
'/groups/{groupname}/users':
get:
tags:
- groups
responses:
'200':
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/User'
description: Get a user's public information
operationId: getGroupUsers
parameters:
-
name: groupname
schema:
type: string
in: path
required: true
components:
schemas:
Valid:
Expand Down Expand Up @@ -166,6 +226,34 @@ components:
$ref: '#/components/schemas/Profiles'
description: ''
additionalProperties: true
Group:
description: ''
required:
- name
type: object
properties:
quotas:
$ref: '#/components/schemas/Profiles'
description: ''
name:
description: ''
type: string
description:
description: ''
links:
$ref: '#/components/schemas/Profiles'
description: ''
keywords:
description: ''
type: array
items:
type: string
image:
$ref: '#/components/schemas/Url'
description: Image url
email:
description: ''
type: string
securitySchemes:
bearerAuth:
scheme: bearer
Expand Down
5 changes: 3 additions & 2 deletions applications/accounts-api/backend/.openapi-generator-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
setup.py
*/controllers/*
Dockerfile
src/__main__.py
**/__main__.py
requirements.txt
test-requirements.txt
test-requirements.txt
*/.openapi-generator
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import connexion
import six
from typing import Dict
from typing import Tuple
from typing import Union

from accounts_api.models.group import Group # noqa: E501
from accounts_api.models.user import User # noqa: E501
from accounts_api import util

from accounts_api.services import group_service

def get_group(groupname): # noqa: E501
"""get_group

# noqa: E501

:param groupname:
:type groupname: str

:rtype: Union[Group, Tuple[Group, int], Tuple[Group, int, Dict[str, str]]
"""
try:
return group_service.get_group_by_name(groupname)
except group_service.GroupNotFound as e:
return "Group not found", 404



def get_group_users(groupname): # noqa: E501
"""get_group_users

# noqa: E501

:param groupname:
:type groupname: str

:rtype: Union[Group, Tuple[Group, int], Tuple[Group, int, Dict[str, str]]
"""
try:
return group_service.get_group_users(groupname)
except group_service.GroupNotFound as e:
return "Group not found", 404


def update_group(groupname, request_body): # noqa: E501
"""update_group

# noqa: E501

:param groupname:
:type groupname: str
:param request_body:
:type request_body: Dict[str, ]

:rtype: Union[User, Tuple[User, int], Tuple[User, int, Dict[str, str]]
"""
return 'do some magic!'
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
# flake8: noqa
from __future__ import absolute_import
# import models into model package
from accounts_api.models.group import Group
from accounts_api.models.user import User
from accounts_api.models.valid import Valid
Loading