This page gives an overview of the University Student API, describing its current status, where and
how it's developed and deployed, and who is responsible for maintaining it.
## Service Description
The University Student API is a read-only REST API which allows access to identity information
related to students at the University. It exposes an easy-to-consume interface, allowing clients
to query students by student number (USN) or by affiliation (institution or academic plan). The API
exposes a view of data from the
[University's Student Management System (CamSIS)](https://www.camsis.cam.ac.uk/).
The University Student API queries data from CamSIS using an HTTP endpoint which exposes a stream
of [student entities in XML form](https://gitlab.developers.cam.ac.uk/uis/devops/iam/card-database/card-api/uploads/48ec5f320052d35d4eea8bf012511314/CamTech-CardFeedofStudents-260321-0836-4.pdf), and caches data within GCP buckets to allow for
The source code for the University Student API is spread over the following repositories:
| Repository | Description
| ----------- | ------------------ |
| [API project](https://gitlab.developers.cam.ac.uk/uis/devops/iam/student-api) | The source code for the API project |
| [Infrastructure Deployment](https://gitlab.developers.cam.ac.uk/uis/devops/iam/deploy-identity/-/blob/master/student_identity.tf) | The Terraform infrastructure code for deploying the API to GCP, part of the identity platform deployment |
## Technologies used
The following gives an overview of the technologies the University Student API is built on:
| Language | Framework(s) |
| ---------- | ------------ |
| Python 3.9 | FastAPI |
## Operational documentation
The following gives an overview of how the University Student API is deployed and maintained.
### How and where the University Student API is deployed
The API is deployed to [GCP Cloud Run](https://cloud.google.com/run) as part of the
[`root-bootstrap` sub-project of the identity deployment project](https://gitlab.developers.cam.ac.uk/uis/devops/iam/deploy-identity/-/blob/master/root-bootstrap/main.tf).
### Deploying a new release
A new release to staging and production can be triggered by running the
[pipeline of the default branch within GitLab](https://gitlab.developers.cam.ac.uk/uis/devops/iam/student-api/-/pipelines/153913).
Deployments to staging and development can be triggered manually by triggering a
[pipeline within the deploy identity project](https://gitlab.developers.cam.ac.uk/uis/devops/iam/deploy-identity/-/pipelines/new)
with the following variables set:
```sh
DEPLOY_ENABLED=<development|staging>
STUDENT_IDENTITY_DOCKER_IMAGE=<gitlab registry url of image to deploy>
```
### Monitoring
The University Student API makes use of our
[GCP site monitoring module](https://gitlab.developers.cam.ac.uk/uis/devops/infra/terraform/gcp-site-monitoring)
for monitoring of the production environment. This will send an alert to
devops-alarms@uis.cam.ac.uk if any of the deployments have non-transient uptime check failures.
Additionally, an alert is configured to fire if the API has been unable to refresh its cache of