Skip to content

Commit 6064ef2

Browse files
authored
Merge pull request #1907 from EnterpriseDB/release/2021-10-06
Release/2021-10-06
2 parents 5751c4a + b7cf87c commit 6064ef2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+232
-151
lines changed

product_docs/docs/edbcloud/beta/reference/index.mdx

Lines changed: 95 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,21 @@ The API reference documentation is available from the [EDB Cloud portal](https:/
88

99
To access the API, you need a token. The high-level steps to obtain a token are:
1010
1. [Query the authentication endpoint](#query-the-authentication-endpoint).
11-
2. [Request the device code](#request-the-device-code).
11+
2. [Request the device code](#request-the-device-code-using-curl).
1212
3. [Authorize as a user](#authorize-as-a-user).
13-
4. [Request the token](#request-the-token).
13+
4. [Request the token](#request-the-token-using-curl).
1414

1515

16+
EDB provides an optional script to simplify getting your device code and getting and refreshing your tokens. See [Using the `get-token` Script](#using-the-get-token-script) for details.
17+
1618

1719
## Query the Authentication Endpoint
1820

19-
Use the following command to get the information returned by the authentication endpoint that you need later:
21+
This call returns the information that either:
22+
23+
- you need later if you are using `curl` to request the device code and tokens, or
24+
- the `get-token` script uses to generate the tokens for you
25+
2026

2127
```
2228
curl https://portal.edbcloud.com/api/v1/auth/provider
@@ -32,19 +38,21 @@ The response returns the `clientId`, `issuerUri`, `scope`, and `audience`. For e
3238
}
3339
```
3440

35-
EDB recommends you store the output in environment variables to make including them in the following calls easier. For example,
41+
EDB recommends you store the output in environment variables to make including them in the following calls easier. For example:
3642

3743
```
3844
CLIENT_ID=pM8PRguGtW9yVnrsvrvpaPyyeS9fVvFh
3945
ISSUER_URL=https://auth.edbcloud.com
4046
SCOPE="openid profile email offline_access"
4147
AUDIENCE="https://portal.edbcloud.com/api"
4248
```
43-
The following example calls show use these environment variables.
44-
45-
## Request the Device code
49+
The following example calls use these environment variables.
4650

47-
Use the following call to get a device code:
51+
## Request the Device Code Using `curl`
52+
!!!note
53+
The `get-token` script executes this step. You don't need to make this call if you are using the script.
54+
!!!
55+
This call gets a device code:
4856
```
4957
curl --request POST \
5058
--url "$ISSUER_URL/oauth/device/code" \
@@ -56,7 +64,7 @@ curl --request POST \
5664

5765
The response returns:
5866

59-
- `device_code` - the unique code for the device. When you go to the `verification_uri` in your browser-based device, this code is bound to your session. You use this code in your [request for a token](#request-the-token).
67+
- `device_code` - the unique code for the device. When you go to the `verification_uri` in your browser-based device, this code is bound to your session. You use this code in your [request for a token](#request-the-token-using-curl).
6068
- `user_code` - the code you input at the `verification_uri` to authorize the device. You use this code when you [authorize yourself as a user](#authorize-as-a-user).
6169
- `verification_uri` - the URL you use to authorize your device.
6270
- `verification_uri_complete` - the complete URL you use to authorize the device. You can use this URL to embed the user code in your app's URL.
@@ -75,26 +83,31 @@ For example:
7583
}
7684
```
7785

78-
Store the device_code in an environment variable for future use. For example;
86+
Store the device code in an environment variable for future use. For example:
7987

8088
```
8189
DEVICE_CODE=KEOY2_5YjuVsRuIrrR-aq5gs
8290
```
8391

8492
## Authorize as a User
8593

94+
To authorize as a user:
95+
8696
1. Go to the `verification_uri` in your web browser, enter your `user_code`, and select **Continue**.
8797

88-
4. Select **Confirm** on the Device Confirmation dialog.
98+
2. Select **Confirm** on the Device Confirmation dialog.
8999

90-
5. Select **Continue with Microsoft Azure AD** on the EDB Cloud Welcome screen.
100+
3. Select **Continue with Microsoft Azure AD** on the EDB Cloud Welcome screen.
91101

92-
6. Log in with your Azure AD credentials.
102+
4. Log in with your Azure AD credentials.
93103

94104

95-
## Request the Token
105+
## Request the Token Using `curl`
106+
!!!note
107+
The `get-token` script executes this step. You don't need to make this call if you are using the script. See [Request Your Token Using `get-token`](#request-your-token-using-get-token).
108+
!!!
96109

97-
Use the `curl --request POST` command to request a token. For example,
110+
The `curl --request POST` call requests a token. For example:
98111
```
99112
curl --request POST \
100113
--url "$ISSUER_URL/oauth/token" \
@@ -121,17 +134,17 @@ For example:
121134
"token_type": "Bearer"
122135
}
123136
```
124-
Store the access_token and refresh_token in environment variables for future use. For example,
137+
Store the access token and refresh token in environment variables for future use. For example:
125138

126139
```
127140
ACCESS_TOKEN="eyJhbGc.......1Qtkaw2fyho"
128141
REFRESH_TOKEN="v1.MTvuZpu.......sbiionEhtTw"
129142
```
130143

131144
If not successful, you receive one of the following errors:
132-
- `authorization_pending` - continue polling using the suggested interval retrieved when you [requested the device code](#request-the-device-code).
145+
- `authorization_pending` - continue polling using the suggested interval retrieved when you [requested the device code](#request-the-device-code-using-curl).
133146

134-
- `slow_down` - slow down and use the suggested interval retrieved when you [requested the device code](#request-the-device-code). To avoid receiving this error due to network latency, you should start counting each interval after receipt of the last polling request's response.
147+
- `slow_down` - slow down and use the suggested interval retrieved when you [requested the device code](#request-the-device-code-using-curl). To avoid receiving this error due to network latency, you should start counting each interval after receipt of the last polling request's response.
135148
- `expired_token` - you have not authorized the device quickly enough, so the `device_code` has expired. Your application should notify you that it has expired and to restore it.
136149
- `access_denied`
137150

@@ -171,11 +184,16 @@ Example response:
171184
```
172185

173186

174-
## Refreshing your Token
187+
## Refresh your Token
188+
189+
You use the refresh token to get a new access token. Usually you need a new access token only after the previous one expires or when gaining access to a new resource for the first time. You shouldn't call the endpoint to get a new access token every time you call an API. There are rate limits that throttle the amount of requests to the endpoint that can be executed using the same token from the same IP.
175190

176-
You can use the refresh token to get a new access token. Usually you need a new access token only after the previous one expires or when gaining access to a new resource for the first time. You shouldn't call the endpoint to get a new access token every time you call an API. There are rate limits that throttle the amount of requests to the endpoint that can be executed using the same token from the same IP.
191+
### Refresh your Token Using `curl`
192+
!!!note
193+
The `get-token` script has an option to execute this step. See [Refresh the Token Using `get-token`](#refresh-the-token-using-get-token).
194+
!!!
177195

178-
To refresh your token, make a POST request to the `/oauth/token` endpoint in the Authentication API, using `grant_type=refresh_token`. For example:
196+
If you are not using the `get-token` script to refresh your token, make a POST request to the `/oauth/token` endpoint in the Authentication API, using `grant_type=refresh_token`. For example:
179197
```
180198
curl --request POST \
181199
--url "$ISSUER_URL/oauth/token" \
@@ -201,14 +219,69 @@ The response of this API call includes the `access_token`. For example:
201219
```
202220

203221
!!! Note
204-
You need to save the `refresh_token` retrieved from this response for the next refresh call. The `refresh_token` in the response when you originally [requested the token](#request-the-token) is obsoleted once it has been used.
222+
You need to save the refresh token retrieved from this response for the next refresh call. The refresh token in the response when you originally [requested the token](#request-the-token) is obsoleted once it has been used.
205223

206224

207225

226+
## Using the `get-token` Script
208227

209228

229+
To simplify the process of getting tokens, EDB provides the `get-token` script. You can download it [here](https://github.com/EnterpriseDB/cloud-utilities/tree/main/api).
210230

231+
To use the script, install the [jq command-line JSON processor](https://stedolan.github.io/jq/) specific to your OS.
211232

233+
Before running the script, [query the authentication endpoint](#query-the-authentication-endpoint).
212234

235+
### get-token Usage
213236

237+
```
238+
Usage:
239+
./get-token.sh [flags] [options]
240+
241+
flags:
242+
--format (-o) json | plain output format
243+
--refresh <refresh_token> [optional] query for tokens
244+
again using given <refresh_token>
245+
this revokes and rotates the refresh
246+
token. Please remember the newly
247+
returned refresh_token for the next use.
248+
249+
```
250+
251+
### Request Your Token Using `get-token`
252+
To use the `get-token` script to get your tokens, use the script without the `--refresh` option. For example:
253+
254+
```
255+
./get-token.sh -o plain
256+
Please login to
257+
https://edbcloud.us.auth0.com/activate?user_code=ZMNX-VVJT
258+
with your EDB Cloud account
259+
Have you finished the login successfully? (y/N) y
260+
261+
####### Access Token ################
262+
eyxxxxxxxxxxxxxx
263+
264+
####### Refresh Token ###############
265+
xxxxxxxxxx
266+
267+
####### ID Token ###############
268+
xxxxxxxxxxxx
269+
270+
##### Expires In Seconds ##########
271+
86400
272+
```
273+
### Refresh the Token Using `get-token`
274+
To use the `get-token` script to refresh your token, use the script with the `--refresh <refresh_token>` option. For example:
275+
276+
```
277+
./get-token.sh -o json --refresh v1.MVZ9_xxxxxxxx_FRs
278+
{
279+
"access_token": "xxxxxxxxxx",
280+
"refresh_token": "xxxxxxxxxxxx",
281+
"id_token": "xxxxxxxx",
282+
"scope": "openid profile email offline_access",
283+
"expires_in": 86400,
284+
"token_type": "Bearer"
285+
}
286+
```
214287

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ Follow the steps given below to install PgBouncer:
7777

7878
Where &lt;xx&gt; is the PgBouncer version you want to install.
7979

80-
To install PgBouncer 1.15 on CentOS 8, the command is:
80+
To install PgBouncer 1.16 on CentOS 8, the command is:
8181

8282
``` text
83-
dnf -y install edb-pgbouncer115
83+
dnf -y install edb-pgbouncer116
8484
```
8585

8686
When you install an RPM package that is signed by a source that is not recognized by your system, yum may ask for your permission to import the key to your local server. If prompted, and you are satisfied that the packages come from a trustworthy source, enter `y`, and press `Return` to continue.
@@ -169,10 +169,10 @@ Follow the steps given below to install PgBouncer:
169169

170170
Where &lt;xx&gt; is the PgBouncer version you want to install.
171171

172-
To install PgBouncer 1.15 on RHEL 8, the command is:
172+
To install PgBouncer 1.16 on RHEL 8, the command is:
173173

174174
``` text
175-
dnf -y install edb-pgbouncer115
175+
dnf -y install edb-pgbouncer116
176176
```
177177

178178
When you install an RPM package that is signed by a source that is not recognized by your system, yum may ask for your permission to import the key to your local server. If prompted, and you are satisfied that the packages come from a trustworthy source, enter `y`, and press `Return` to continue.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ The following steps will walk you through using the EnterpriseDB repository to i
6767

6868
Where *&lt;xx&gt;* is the PgBouncer version you want to install.
6969

70-
For example, to install the PgBouncer 1.15 package for EDB Advanced Server 13, execute the following command:
70+
For example, to install the PgBouncer 1.16 package for EDB Advanced Server 13, execute the following command:
7171

7272
``` text
73-
apt-get -y install edb-pgbouncer115
73+
apt-get -y install edb-pgbouncer116
7474
```
7575

7676
PgBouncer will be installed in the `/usr/edb/pgbouncer<x.x>` directory.

product_docs/docs/pgbouncer/1.15/01_installation/03_installing_pgbouncer_on_an_sles_host.mdx renamed to product_docs/docs/pgbouncer/1.16/01_installation/03_installing_pgbouncer_on_an_sles_host.mdx

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ legacyRedirectsGenerated:
99
<div id="installing_on_an_sles12_host" class="registered_link"></div>
1010

1111

12-
Perform the following steps to install PgBouncer on a SLES 12 SP4 host using the zypper package manager.
12+
Perform the following steps to install PgBouncer on a SLES 12 SP5 host using the zypper package manager.
1313

1414
1. Assume superuser privileges and use the following command to add the EnterpriseDB repository configuration file to your SLES host:
1515

@@ -35,29 +35,17 @@ Perform the following steps to install PgBouncer on a SLES 12 SP4 host using the
3535

3636
``` text
3737
SUSEConnect -r 'REGISTRATION_CODE' -e 'EMAIL'
38-
SUSEConnect -p PackageHub/12.4/x86_64
39-
SUSEConnect -p sle-sdk/12.4/x86_64
38+
SUSEConnect -p PackageHub/12.5/x86_64
39+
SUSEConnect -p sle-sdk/12.5/x86_64
4040
```
4141

42-
5. Install the following repository for PEM dependencies:
43-
44-
``` text
45-
zypper addrepo https://download.opensuse.org/repositories/Apache:/Modules/SLE_12_SP4/Apache:Modules.repo
46-
```
47-
48-
6. Refresh the metadata:
42+
5. Refresh the metadata:
4943

5044
``` text
5145
zypper refresh
5246
```
5347

54-
7. Install OpenJDK (version 1.8) for Java based components:
55-
56-
``` text
57-
zypper -n install java-1_8_0-openjdk
58-
```
59-
60-
8. Use the zypper utility to install PgBouncer.
48+
6. Use the zypper utility to install PgBouncer.
6149

6250
``` text
6351
zypper -n install edb-pgbouncer<xx>

product_docs/docs/pgbouncer/1.15/01_installation/04_installing_pgbouncer_on_a_windows_host.mdx renamed to product_docs/docs/pgbouncer/1.16/01_installation/04_installing_pgbouncer_on_a_windows_host.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ legacyRedirectsGenerated:
1010

1111
Graphical installers for PgBouncer are available via StackBuilder Plus (for Advanced Server hosts) or Stack Builder (for PostgreSQL hosts).
1212

13-
The following steps walk you through installing PgBouncer 1.15 by accessing StackBuilder Plus through Windows start menu
13+
The following steps walk you through installing PgBouncer 1.16 by accessing StackBuilder Plus through Windows start menu
1414

1515
1. Access StackBuilder Plus through the Windows start menu; on the `Welcome` window, select your Advanced Server installation from the drop-down list. Click `Next` to continue to the application selection page.
1616

1717
![The StackBuilder Plus Welcome window](../images/sbp_welcome.png)
1818

1919
Fig. 1: The StackBuilder Plus Welcome window
2020

21-
2. Expand the `Add-ons, tools and utilities` node, and check the box next to the `PgBouncer v1.15.0.1-1`. Click `Next` to continue.
21+
2. Expand the `Add-ons, tools and utilities` node, and check the box next to the `PgBouncer v1.16.0.1-1`. Click `Next` to continue.
2222

2323
![Expand Add-ons, Tools and Utilities](../images/add-ons.png)
2424

product_docs/docs/pgbouncer/1.15/01_installation/index.mdx renamed to product_docs/docs/pgbouncer/1.16/01_installation/index.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ The PgBouncer version is version-specific, but the documented and supported func
1717

1818
| **Pgpool Version** | **Advanced Server Version** | **Supported Platforms** |
1919
| ------------------ | ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
20+
| `PgBouncer 1.16` | PostgreSQL and Advanced Server 13 | RHEL/CentOS 7 - x86_64 and RHEL/CentOS 8 - x86_64 <br />RHEL/CentOS 7 - ppc64le <br />Debian 9x Stretch and Debian 10x Buster <br />Ubuntu 18.04 Bionic Beaver and Ubuntu 20.04 LTS Focal Fossa <br /> Windows 86 x64 Interactive Installer|
21+
| `PgBouncer 1.16` | PostgreSQL and Advanced Server 12 | RHEL/CentOS 7 - x86_64 and RHEL/CentOS 8 - x86_64 <br />RHEL/CentOS 7 - ppc64le <br />Debian 9x Stretch and Debian 10x Buster <br />Ubuntu 18.04 Bionic Beaver <br /> Windows 86 x64 Interactive Installer <br />SUSE Linux Enterprise Server 12 SP5|
22+
| `PgBouncer 1.16` | PostgreSQL and Advanced Server 11 | RHEL/CentOS 7 - x86_64 and RHEL/CentOS 8 - x86_64 <br />RHEL/CentOS 7 - ppc64le <br />Debian 9x Stretch <br />Ubuntu 18.04 Bionic Beaver <br /> Windows 86 x64 Interactive Installer <br />SUSE Linux Enterprise Server 12 SP5|
23+
| `PgBouncer 1.16` | PostgreSQL and Advanced Server 10 and 9.6 | RHEL/CentOS 7 - x86_64 <br />RHEL/CentOS 7 - ppc64le <br /> Windows 86 x64 Interactive Installer|
2024
| `PgBouncer 1.15` | PostgreSQL and Advanced Server 13 | RHEL/CentOS 7 - x86_64 and RHEL/CentOS 8 - x86_64 <br />RHEL/CentOS 7 - ppc64le <br />Debian 9x Stretch and Debian 10x Buster <br />Ubuntu 18.04 Bionic Beaver and Ubuntu 20.04 LTS Focal Fossa <br /> Windows 86 x64 Interactive Installer|
2125
| `PgBouncer 1.15` | PostgreSQL and Advanced Server 12 | RHEL/CentOS 7 - x86_64 and RHEL/CentOS 8 - x86_64 <br />RHEL/CentOS 7 - ppc64le <br />Debian 9x Stretch and Debian 10x Buster <br />Ubuntu 18.04 Bionic Beaver <br /> Windows 86 x64 Interactive Installer <br />SUSE Linux Enterprise Server 12 SP4|
2226
| `PgBouncer 1.15` | PostgreSQL and Advanced Server 11 | RHEL/CentOS 7 - x86_64 and RHEL/CentOS 8 - x86_64 <br />RHEL/CentOS 7 - ppc64le <br />Debian 9x Stretch <br />Ubuntu 18.04 Bionic Beaver <br /> Windows 86 x64 Interactive Installer <br />SUSE Linux Enterprise Server 12 SP4|
@@ -29,10 +33,6 @@ The PgBouncer version is version-specific, but the documented and supported func
2933
| `PgBouncer 1.9` | Advanced Server 11 | RHEL/CentOS 7 - x86_64 <br />RHEL/CentOS 7 - ppc64le <br />Debian 9x Stretch <br />Ubuntu 18.04 Bionic Beaver <br /> Windows 86 x64 Interactive Installer and Linux 86_64 Interactive Installer|
3034
| `PgBouncer 1.7` | Advanced Server 10 and 9.6 | RHEL/CentOS 7 - x86_64 <br />RHEL/CentOS 7 - ppc64le <br /> Windows 86 x64 Interactive Installer and Linux 86_64 Interactive Installer|
3135

32-
!!! Note
33-
34-
PgBouncer 1.15 is no longer supported on CentOS/RHEL/OL 6.x platforms. It is strongly recommended that EDB products running on these platforms be migrated to a supported platform.
35-
3636
<div class="toctree" maxdepth="3">
3737

3838
installing\_pgbouncer\_on\_a\_linux\_or\_centos\_host installing\_pgbouncer\_on\_a\_debian\_or\_ubuntu\_host installing\_pgbouncer\_on\_an\_sles\_host installing\_pgbouncer\_on\_a\_windows\_host

0 commit comments

Comments
 (0)