Skip to content

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Chelsea486MHz committed Dec 31, 2023
1 parent d8eae0e commit ebce8d7
Showing 1 changed file with 69 additions and 8 deletions.
77 changes: 69 additions & 8 deletions docs/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ The request must be formated as follows, with `type` being either `"user"`, `"ma
```
{
"type": type,
"expiration": expiration
"expiration_date": expiration_date
}
```

Expand Down Expand Up @@ -131,21 +131,23 @@ $ENDPOINT/api/compute/universe/update
`$STATE` must be formated as an array of Stargazer bodies:
```
{
body0,
...,
bodyn
"body": [
body0,
...,
bodyn
]
}
```

**compute/universe/constants**
**compute/configure**

Sets the coupling constants to be used in further computations, as well as the timestep.
```
$ curl \
-H 'Authorization: $MANAGER_TOKEN \
-H 'Content-Type: application/json' \
-d '$CONSTANTS' \
$ENDPOINT/api/compute/universe/update
$ENDPOINT/api/compute/configure
```

`$CONSTANTS` must be formated as an array:
Expand Down Expand Up @@ -287,7 +289,19 @@ Performs numerical integration on the bodies, returning new positions, velocitie
$ curl \
-H 'Authorization: $MANAGER_TOKEN \
-H 'Content-Type: application/json' \
$ENDPOINT/api/compute/force/electrostatic
$ENDPOINT/api/compute/integrate
```

The response data is formated as an array of Stargazer bodies:

```
{
"bodies": [
body0,
...
bodyn
]
}
```


Expand All @@ -313,4 +327,51 @@ $ curl \
-H 'Authorization: $COMPUTE_TOKEN \
-H 'Content-Type: application/json' \
$ENDPOINT/api/manager/unregister
```
```

**manager/configure**

Users can configure the manager nodes for further simulations.
```
$ curl \
-H 'Authorization: $USER_TOKEN \
-H 'Content-Type: application/json' \
-d '$CONFIGURATION'
$ENDPOINT/api/manager/configure
```

`$CONFIGURATION` must be formatted as such:
```
{
"constants": {
"timestep": timestep,
"gravity": gravitational_constant,
"electrostatic": electrostatic_constant
},
"bodies": [
body0,
...
bodyn
]
}
```

**manager/simulate**

Runs a simulation.
```
$ curl \
-H 'Authorization: $USER_TOKEN \
-H 'Content-Type: application/json' \
-d '$CONFIGURATION'
$ENDPOINT/api/manager/simulate
```

`$CONFIGURATION` must be formatted as such:
```
{
"duration": duration
}
```

The response data is an XYZ file.

0 comments on commit ebce8d7

Please sign in to comment.