-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
27 changed files
with
2,788 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3.0.56 | ||
3.0.64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
server/swagger_server/controllers/journey_tracker_controller.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import connexion | ||
import six | ||
|
||
from swagger_server.models.journey_tracker_people import JourneyTrackerPeople # noqa: E501 | ||
from swagger_server.models.status400_bad_request import Status400BadRequest # noqa: E501 | ||
from swagger_server.models.status401_unauthorized import Status401Unauthorized # noqa: E501 | ||
from swagger_server.models.status403_forbidden import Status403Forbidden # noqa: E501 | ||
from swagger_server.models.status404_not_found import Status404NotFound # noqa: E501 | ||
from swagger_server.models.status500_internal_server_error import Status500InternalServerError # noqa: E501 | ||
from swagger_server import util | ||
from swagger_server.response_code import journey_tracker_controller as rc | ||
|
||
|
||
def journey_tracker_people_get(since_date, until_date=None): # noqa: E501 | ||
"""Get people information for Journey Tracker | ||
Get people information for Journey Tracker # noqa: E501 | ||
:param since_date: starting date to search from | ||
:type since_date: str | ||
:param until_date: ending date to search to | ||
:type until_date: str | ||
:rtype: JourneyTrackerPeople | ||
""" | ||
return rc.journey_tracker_people_get(since_date, until_date) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
import connexion | ||
import six | ||
|
||
from swagger_server.models.quotas import Quotas # noqa: E501 | ||
from swagger_server.models.quotas_details import QuotasDetails # noqa: E501 | ||
from swagger_server.models.quotas_post import QuotasPost # noqa: E501 | ||
from swagger_server.models.quotas_put import QuotasPut # noqa: E501 | ||
from swagger_server.models.status200_ok_no_content import Status200OkNoContent # noqa: E501 | ||
from swagger_server.models.status400_bad_request import Status400BadRequest # noqa: E501 | ||
from swagger_server.models.status401_unauthorized import Status401Unauthorized # noqa: E501 | ||
from swagger_server.models.status403_forbidden import Status403Forbidden # noqa: E501 | ||
from swagger_server.models.status404_not_found import Status404NotFound # noqa: E501 | ||
from swagger_server.models.status500_internal_server_error import Status500InternalServerError # noqa: E501 | ||
from swagger_server import util | ||
from swagger_server.response_code import quotas_controller as rc | ||
|
||
|
||
def quotas_get(project_uuid=None, offset=None, limit=None): # noqa: E501 | ||
"""Get list of Resource Quotas | ||
Get list of Resource Quotas # noqa: E501 | ||
:param project_uuid: project uuid | ||
:type project_uuid: str | ||
:param offset: number of items to skip before starting to collect the result set | ||
:type offset: int | ||
:param limit: maximum number of results to return per page (1 or more) | ||
:type limit: int | ||
:rtype: Quotas | ||
""" | ||
return rc.quotas_get(project_uuid, offset, limit) | ||
|
||
|
||
def quotas_post(body=None): # noqa: E501 | ||
"""Create new Resource Quota | ||
Create new Resource Quota # noqa: E501 | ||
:param body: Create a new Resource Quota | ||
:type body: dict | bytes | ||
:rtype: Quotas | ||
""" | ||
if connexion.request.is_json: | ||
body = QuotasPost.from_dict(connexion.request.get_json()) # noqa: E501 | ||
return rc.quotas_post(body) | ||
|
||
|
||
def quotas_uuid_delete(uuid): # noqa: E501 | ||
"""Delete single Resource Quota by UUID | ||
Delete single Resource Quota by UUID # noqa: E501 | ||
:param uuid: universally unique identifier | ||
:type uuid: str | ||
:rtype: Status200OkNoContent | ||
""" | ||
return rc.quotas_uuid_delete(uuid) | ||
|
||
|
||
def quotas_uuid_get(uuid): # noqa: E501 | ||
"""Get single Resource Quota by UUID | ||
Get single Resource Quota by UUID # noqa: E501 | ||
:param uuid: universally unique identifier | ||
:type uuid: str | ||
:rtype: QuotasDetails | ||
""" | ||
return rc.quotas_uuid_get(uuid) | ||
|
||
|
||
def quotas_uuid_put(uuid, body=None): # noqa: E501 | ||
"""Update single Resource Quota by UUID | ||
Update single Resource Quota by UUID # noqa: E501 | ||
:param uuid: universally unique identifier | ||
:type uuid: str | ||
:param body: Update a Resource Quota | ||
:type body: dict | bytes | ||
:rtype: Status200OkNoContent | ||
""" | ||
if connexion.request.is_json: | ||
body = QuotasPut.from_dict(connexion.request.get_json()) # noqa: E501 | ||
return rc.quotas_uuid_put(uuid, body) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import enum | ||
|
||
from sqlalchemy import UniqueConstraint | ||
|
||
from swagger_server.database.db import db | ||
|
||
|
||
# Enum for Resource Types | ||
class EnumResourceTypes(enum.Enum): | ||
core = "Core" | ||
disk = "Disk" | ||
fpga = "FPGA" | ||
gpu = "GPU" | ||
nvme = "NVME" | ||
p4 = "P4" | ||
ram = "RAM" | ||
sharednic = "SharedNIC" | ||
smartnic = "SmartNIC" | ||
storage = "Storage" | ||
|
||
|
||
# Enum for Resource Units | ||
class EnumResourceUnits(enum.Enum): | ||
hours = "Hours" | ||
|
||
|
||
class FabricQuotas(db.Model): | ||
""" | ||
Quotas - Control Framework quotas for projects | ||
- created_at = UTC datetime | ||
- id - primary key | ||
- project_uuid = UUID as string | ||
- quota_limit = Float | ||
- quota_used = Float | ||
- resource_type = in [p4, core, ram, disk, gpu, smartnic, sharednic, fpga, nvme, storage] as string | ||
- resource_unit = in [hours, ...] as string | ||
- updated_at = UTC datetime | ||
- uuid = UUID as string | ||
""" | ||
query: db.Query | ||
__tablename__ = 'quotas' | ||
__table_args__ = ( | ||
UniqueConstraint('project_uuid', 'resource_type', 'resource_unit', name='project_resource_type_unit'),) | ||
__allow_unmapped__ = True | ||
|
||
created_at = db.Column(db.DateTime(timezone=True), nullable=False) | ||
id = db.Column(db.Integer, nullable=False, primary_key=True) | ||
project_uuid = db.Column(db.String(), nullable=False) | ||
quota_limit = db.Column(db.Float, nullable=False) | ||
quota_used = db.Column(db.Float, nullable=False) | ||
resource_type = db.Column(db.Enum(EnumResourceTypes), default=EnumResourceTypes.core, nullable=False) | ||
resource_unit = db.Column(db.Enum(EnumResourceUnits), default=EnumResourceUnits.hours, nullable=False) | ||
updated_at = db.Column(db.DateTime(timezone=True), nullable=False) | ||
uuid = db.Column(db.String(), primary_key=False, nullable=False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
# coding: utf-8 | ||
|
||
from __future__ import absolute_import | ||
from datetime import date, datetime # noqa: F401 | ||
|
||
from typing import List, Dict # noqa: F401 | ||
|
||
from swagger_server.models.base_model_ import Model | ||
from swagger_server.models.journey_tracker_people_one import JourneyTrackerPeopleOne # noqa: F401,E501 | ||
from swagger_server.models.status200_ok_single import Status200OkSingle # noqa: F401,E501 | ||
from swagger_server import util | ||
|
||
|
||
class JourneyTrackerPeople(Model): | ||
"""NOTE: This class is auto generated by the swagger code generator program. | ||
Do not edit the class manually. | ||
""" | ||
def __init__(self, results: List[JourneyTrackerPeopleOne]=None, size: int=1, status: int=200, type: str=None): # noqa: E501 | ||
"""JourneyTrackerPeople - a model defined in Swagger | ||
:param results: The results of this JourneyTrackerPeople. # noqa: E501 | ||
:type results: List[JourneyTrackerPeopleOne] | ||
:param size: The size of this JourneyTrackerPeople. # noqa: E501 | ||
:type size: int | ||
:param status: The status of this JourneyTrackerPeople. # noqa: E501 | ||
:type status: int | ||
:param type: The type of this JourneyTrackerPeople. # noqa: E501 | ||
:type type: str | ||
""" | ||
self.swagger_types = { | ||
'results': List[JourneyTrackerPeopleOne], | ||
'size': int, | ||
'status': int, | ||
'type': str | ||
} | ||
|
||
self.attribute_map = { | ||
'results': 'results', | ||
'size': 'size', | ||
'status': 'status', | ||
'type': 'type' | ||
} | ||
self._results = results | ||
self._size = size | ||
self._status = status | ||
self._type = type | ||
|
||
@classmethod | ||
def from_dict(cls, dikt) -> 'JourneyTrackerPeople': | ||
"""Returns the dict as a model | ||
:param dikt: A dict. | ||
:type: dict | ||
:return: The journey_tracker_people of this JourneyTrackerPeople. # noqa: E501 | ||
:rtype: JourneyTrackerPeople | ||
""" | ||
return util.deserialize_model(dikt, cls) | ||
|
||
@property | ||
def results(self) -> List[JourneyTrackerPeopleOne]: | ||
"""Gets the results of this JourneyTrackerPeople. | ||
:return: The results of this JourneyTrackerPeople. | ||
:rtype: List[JourneyTrackerPeopleOne] | ||
""" | ||
return self._results | ||
|
||
@results.setter | ||
def results(self, results: List[JourneyTrackerPeopleOne]): | ||
"""Sets the results of this JourneyTrackerPeople. | ||
:param results: The results of this JourneyTrackerPeople. | ||
:type results: List[JourneyTrackerPeopleOne] | ||
""" | ||
|
||
self._results = results | ||
|
||
@property | ||
def size(self) -> int: | ||
"""Gets the size of this JourneyTrackerPeople. | ||
:return: The size of this JourneyTrackerPeople. | ||
:rtype: int | ||
""" | ||
return self._size | ||
|
||
@size.setter | ||
def size(self, size: int): | ||
"""Sets the size of this JourneyTrackerPeople. | ||
:param size: The size of this JourneyTrackerPeople. | ||
:type size: int | ||
""" | ||
|
||
self._size = size | ||
|
||
@property | ||
def status(self) -> int: | ||
"""Gets the status of this JourneyTrackerPeople. | ||
:return: The status of this JourneyTrackerPeople. | ||
:rtype: int | ||
""" | ||
return self._status | ||
|
||
@status.setter | ||
def status(self, status: int): | ||
"""Sets the status of this JourneyTrackerPeople. | ||
:param status: The status of this JourneyTrackerPeople. | ||
:type status: int | ||
""" | ||
|
||
self._status = status | ||
|
||
@property | ||
def type(self) -> str: | ||
"""Gets the type of this JourneyTrackerPeople. | ||
:return: The type of this JourneyTrackerPeople. | ||
:rtype: str | ||
""" | ||
return self._type | ||
|
||
@type.setter | ||
def type(self, type: str): | ||
"""Sets the type of this JourneyTrackerPeople. | ||
:param type: The type of this JourneyTrackerPeople. | ||
:type type: str | ||
""" | ||
|
||
self._type = type |
Oops, something went wrong.