Skip to content

Commit

Permalink
Merge pull request #2760 from EnterpriseDB/release/2022-06-08
Browse files Browse the repository at this point in the history
Release: 2022-06-08
  • Loading branch information
drothery-edb authored Jun 8, 2022
2 parents 8cc5fd5 + b9b9f89 commit e556686
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1,437 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ When using AWS, you can create a cluster in the following regions:
- United States (US):
- US East 1 (N. Virginia)
- US East 2 (Ohio)
- US West 1 (N. California)
- US West 2 (Oregon)
- Europe (EU)
- Europe 1 (Ireland)
- Europe 2 (London)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,10 @@
title: Using the BigAnimal API
---

!!!important "Deprecation notice"
EDB released v2 of BigAnimal API in June 2022. v1 of BigAnimal API goes out of support on Dec 31, 2022. To see the changes in v2, see the [Change log](change_log). Update your applications accordingly.
!!!

Use the BigAnimal API to integrate directly with BigAnimal for management activities such as cluster provisioning, de-provisioning, and scaling.

The API reference documentation is available from the [BigAnimal portal](https://portal.biganimal.com). The direct documentation link is <https://portal.biganimal.com/api/docs/>.



To access the API, you need a token. The high-level steps to obtain a token are:

1. [Query the authentication endpoint](#query-the-authentication-endpoint).
Expand All @@ -30,7 +24,7 @@ This call returns the information that either:
- The `get-token` script uses to generate the tokens for you.

```
curl https://portal.biganimal.com/api/v2/auth/provider
curl https://portal.biganimal.com/api/v1/auth/provider
```

The response returns the `clientId`, `freetrialClientId`, `issuerUri`, `scope`, and `audience`. For example:
Expand Down Expand Up @@ -145,7 +139,7 @@ For example:
{
"access_token": "eyJhbGc.......1Qtkaw2fyho",
"id_token": "eyJhbGci.......FBra7tA",
"refresh_token": "v2.MTvuZpu.......sbiionEhtTw",
"refresh_token": "v1.MTvuZpu.......sbiionEhtTw",
"scope": "openid profile email offline_access",
"expires_in": 86400,
"token_type": "Bearer"
Expand All @@ -156,7 +150,7 @@ Store the access token and refresh token in environment variables for future use

```
RAW_ACCESS_TOKEN="eyJhbGc.......1Qtkaw2fyho"
REFRESH_TOKEN="v2.MTvuZpu.......sbiionEhtTw"
REFRESH_TOKEN="v1.MTvuZpu.......sbiionEhtTw"
```

!!!note
Expand All @@ -183,7 +177,7 @@ Use the raw token you obtained in the previous step [Request the raw token using

```
curl -s --request POST \
--url "https://portal.biganimal.com/api/v2/auth/token" \
--url "https://portal.biganimal.com/api/v1/auth/token" \
--header "content-type: application/json" \
--data "{\"token\":\"$RAW_ACCESS_TOKEN\"}"
```
Expand Down Expand Up @@ -217,7 +211,7 @@ To call the BigAnimal API, your application must pass the retrieved access token

```
curl --request GET \
--url "$AUDIENCE/v2/pg-types" \
--url "$AUDIENCE/v1/postgres-types" \
--header "authorization: Bearer $ACCESS_TOKEN" \
--header "content-type: application/json"
```
Expand Down Expand Up @@ -276,7 +270,7 @@ The response of this API call includes the `access_token`. For example:
"expires_in": 86400,
"scope": "openid offline_access",
"id_token": "eyJ...0NE",
"refresh_token": "v2.Mjv..._2pRs",
"refresh_token": "v1.Mjv..._2pRs",
"token_type": "Bearer"
}
```
Expand All @@ -285,7 +279,7 @@ Store the access token and refresh token in environment variables for future use

```
RAW_ACCESS_TOKEN="eyJhbGc.......1Qtkaw2fyho"
REFRESH_TOKEN="v2.MTvuZpu.......sbiionEhtTw"
REFRESH_TOKEN="v1.MTvuZpu.......sbiionEhtTw"
```

The token you obtain from this step is the raw-access token. You need to exchange this token for a BigAnimal token. See [Exchange for BigAnimal token](#exchange-the-biganimal-token-using-curl) for more information.
Expand Down Expand Up @@ -346,7 +340,7 @@ xxxxxxxxxx
To use the `get-token` script to refresh your token, use the script with the `--refresh <refresh_token>` option. For example:

```
./get-token.sh -o json --refresh v2.MVZ9_xxxxxxxx_FRs
./get-token.sh -o json --refresh v1.MVZ9_xxxxxxxx_FRs
{
"access_token": "xxxxxxxxxx",
"refresh_token": "xxxxxxxxxxxx",
Expand Down
Loading

0 comments on commit e556686

Please sign in to comment.