Skip to content

Commit

Permalink
Merge from main
Browse files Browse the repository at this point in the history
  • Loading branch information
gregcube committed Dec 2, 2024
1 parent ca08f35 commit 70c91d3
Show file tree
Hide file tree
Showing 23 changed files with 1,698 additions and 525 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
--exclude '.github' \
--exclude '.env' \
--exclude 'tests' \
--exclude 'config' \
--exclude 'config/sync' \
--exclude 'models/' \
--exclude 'web/sites/*/files' \
--exclude 'web/libraries' \
Expand All @@ -97,8 +97,9 @@ jobs:
echo "Deploying to $DEPLOY_PATH"
cd $DEPLOY_PATH
composer install --no-dev --no-progress --optimize-autoloader
./vendor/bin/drush cr
./vendor/bin/drush updb -y
./vendor/bin/drush cim --partial --source=modules/mof/config/install -y
./vendor/bin/drush cr
EOF
- name: Revoke IP address
Expand Down
89 changes: 89 additions & 0 deletions API.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# API

## Overview

This API provides read-only access to a collection of models. It is open to the public and does not require an API key for access.

### Response Format

- All responses are in **JSON** format.

### Rate Limiting

- **Limit**: 10,000 requests per hour per IP address.
- Exceeding this limit will result in temporary rate-limiting.
- Rate-limited responses include the following structure:
```json
{
"error": {
"code": 429,
"message": "Rate limit exceeded. Try again later."
}
}
```

---

## Endpoints

### **GET /api/v1/models**

Lists all models with pagination.

#### Query Parameters:
- `page` (optional): The page number to retrieve (default: `1`). Pages are 1-indexed.
- `limit` (optional): The number of models per page (default: `100`).

#### Example Request:
```http
GET /api/v1/models?page=2&limit=50
```

#### Example Response:
```json
{
"pager": {
"total_items": 235,
"total_pages": 5,
"current_page": 2
},
"models": [...]
}
```

---

### **GET /api/v1/model/{model}**

Retrieves details of a specific model.

#### Path Parameters:
- `model`: The ID of the model to retrieve. Model IDs can be found using the `/api/v1/models` endpoint.

#### Example Request:
```http
GET /api/v1/model/1130
```

#### Example Response:
```json
{
"id": "1130",
"framework": {
"name": "Model Openness Framework",
"version": "1.0",
"date": "2024-12-15"
},
"release": {...},
"classification": {
"class": 1,
"label": "Class I - Open Science",
"progress": {
"1": 100,
"2": 100,
"3": 100
}
}
}
```

6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"cweagans/composer-patches": "^1.7",
"drupal/block_exclude_pages": "^2.1",
"drupal/cheeseburger_menu": "^5.0@RC",
"drupal/core-composer-scaffold": "^10.2",
"drupal/core-project-message": "^10.2",
"drupal/core-recommended": "^10.2",
"drupal/core-composer-scaffold": "10.3.10",
"drupal/core-project-message": "10.3.10",
"drupal/core-recommended": "10.3.10",
"drupal/devel": "^5.1",
"drupal/devel_entity_updates": "^4.1",
"drupal/fontawesome": "^2.26",
Expand Down
Loading

0 comments on commit 70c91d3

Please sign in to comment.