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

admin page for usage #1241

Merged
merged 10 commits into from
May 10, 2024
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
1 change: 0 additions & 1 deletion .github/workflows/site_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ jobs:
if: ${{ github.event.inputs.server_only != 'true' }}
run: |
set -ux
cd vcell-client
mvn clean install -DskipTests
- name: deploy installers and singularity to kubernetes site and web help to vcell.org
if: ${{ github.event.inputs.deployment_type == 'kubernetes' }}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
<httpcore.version>4.4.13</httpcore.version>
<imagej2.version>2.3.0</imagej2.version>
<imagej.version>${imagej2.version}</imagej.version>
<itext.version>1.4.8</itext.version>
<itext.version>2.1.7</itext.version>
<jackson-annotations.version>2.15.2</jackson-annotations.version>
<jackson-core.version>2.15.2</jackson-core.version>
<jackson-databind.version>2.15.2</jackson-databind.version>
Expand Down
2 changes: 2 additions & 0 deletions python-restclient/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.gitignore
README.md
docs/AccesTokenRepresentationRecord.md
docs/AdminResourceApi.md
docs/BioModel.md
docs/BioModelResourceApi.md
docs/BiomodelRef.md
Expand All @@ -21,6 +22,7 @@ test/__init__.py
tox.ini
vcell_client/__init__.py
vcell_client/api/__init__.py
vcell_client/api/admin_resource_api.py
vcell_client/api/bio_model_resource_api.py
vcell_client/api/hello_world_api.py
vcell_client/api/publication_resource_api.py
Expand Down
16 changes: 11 additions & 5 deletions python-restclient/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,24 @@ configuration = vcell_client.Configuration(
host = "https://vcellapi-test.cam.uchc.edu"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.


# Enter a context with an instance of the API client
with vcell_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = vcell_client.BioModelResourceApi(api_client)
bio_model_id = 'bio_model_id_example' # str |
api_instance = vcell_client.AdminResourceApi(api_client)

try:
# Delete the BioModel from VCell's database.
api_instance.delete_bio_model(bio_model_id)
# Get usage summary
api_response = api_instance.get_usage()
print("The response of AdminResourceApi->get_usage:\n")
pprint(api_response)
except ApiException as e:
print("Exception when calling BioModelResourceApi->delete_bio_model: %s\n" % e)
print("Exception when calling AdminResourceApi->get_usage: %s\n" % e)

```

Expand All @@ -84,6 +89,7 @@ All URIs are relative to *https://vcellapi-test.cam.uchc.edu*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AdminResourceApi* | [**get_usage**](docs/AdminResourceApi.md#get_usage) | **GET** /api/v1/admin/usage | Get usage summary
*BioModelResourceApi* | [**delete_bio_model**](docs/BioModelResourceApi.md#delete_bio_model) | **DELETE** /api/v1/bioModel/{bioModelID} | Delete the BioModel from VCell&#39;s database.
*BioModelResourceApi* | [**get_biomodel_by_id**](docs/BioModelResourceApi.md#get_biomodel_by_id) | **GET** /api/v1/bioModel/{bioModelID} | Get BioModel information in JSON format by ID.
*BioModelResourceApi* | [**upload_bio_model**](docs/BioModelResourceApi.md#upload_bio_model) | **POST** /api/v1/bioModel/upload_bioModel | Upload the BioModel to VCell database. Returns BioModel ID.
Expand Down
75 changes: 75 additions & 0 deletions python-restclient/docs/AdminResourceApi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# vcell_client.AdminResourceApi

All URIs are relative to *https://vcellapi-test.cam.uchc.edu*

Method | HTTP request | Description
------------- | ------------- | -------------
[**get_usage**](AdminResourceApi.md#get_usage) | **GET** /api/v1/admin/usage | Get usage summary


# **get_usage**
> bytearray get_usage()

Get usage summary

### Example

```python
import time
import os
import vcell_client
from vcell_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://vcellapi-test.cam.uchc.edu
# See configuration.py for a list of all supported configuration parameters.
configuration = vcell_client.Configuration(
host = "https://vcellapi-test.cam.uchc.edu"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Enter a context with an instance of the API client
with vcell_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = vcell_client.AdminResourceApi(api_client)

try:
# Get usage summary
api_response = api_instance.get_usage()
print("The response of AdminResourceApi->get_usage:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AdminResourceApi->get_usage: %s\n" % e)
```



### Parameters
This endpoint does not need any parameter.

### Return type

**bytearray**

### Authorization

[openId](../README.md#openId)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/pdf

### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | The PDF report | - |
**401** | Not Authorized | - |
**403** | Not Allowed | - |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

2 changes: 1 addition & 1 deletion python-restclient/docs/UsersResourceApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ Name | Type | Description | Notes
### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json
- **Accept**: text/plain

### HTTP response details
| Status code | Description | Response headers |
Expand Down
39 changes: 39 additions & 0 deletions python-restclient/test/test_admin_resource_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# coding: utf-8

"""
VCell API

VCell API

The version of the OpenAPI document: 1.0.1
Contact: [email protected]
Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.
""" # noqa: E501


import unittest

from vcell_client.api.admin_resource_api import AdminResourceApi


class TestAdminResourceApi(unittest.TestCase):
"""AdminResourceApi unit test stubs"""

def setUp(self) -> None:
self.api = AdminResourceApi()

def tearDown(self) -> None:
pass

def test_get_usage(self) -> None:
"""Test case for get_usage

Get usage summary
"""
pass


if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions python-restclient/vcell_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
__version__ = "1.0.0"

# import apis into sdk package
from vcell_client.api.admin_resource_api import AdminResourceApi
from vcell_client.api.bio_model_resource_api import BioModelResourceApi
from vcell_client.api.hello_world_api import HelloWorldApi
from vcell_client.api.publication_resource_api import PublicationResourceApi
Expand Down
1 change: 1 addition & 0 deletions python-restclient/vcell_client/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# flake8: noqa

# import apis into api package
from vcell_client.api.admin_resource_api import AdminResourceApi
from vcell_client.api.bio_model_resource_api import BioModelResourceApi
from vcell_client.api.hello_world_api import HelloWorldApi
from vcell_client.api.publication_resource_api import PublicationResourceApi
Expand Down
Loading
Loading