Skip to content

Commit

Permalink
Fixed all references to the old Bearer API key. Also, fixed reference…
Browse files Browse the repository at this point in the history
…s to api.mariadb.com
  • Loading branch information
jramnara committed Jun 6, 2024
1 parent 5476007 commit 54345ec
Show file tree
Hide file tree
Showing 12 changed files with 122 additions and 325 deletions.
52 changes: 27 additions & 25 deletions docs/Backup and Restore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ The following documentation describes the API for the SkySQL Backup Service. Thi

To authenticate with the API, do the following:

1. Go to MariaDB ID: <https://id.mariadb.com/account/api/> and generate an API key
2. Add the value from the token field to an environment variable $JWT_TOKEN
1. Go to SkySQL API Key management page: https://app.skysql.com/user-profile/api-keys and generate an API key

2. Export the value from the token field to an environment variable $API_KEY

3. Use it on subsequent request, e.g:

```bash
curl --request GET 'https://api.skysql.com/skybackup/v1/backups/schedules' \\
--header "Authorization: Bearer $JWT_TOKEN"
--header "X-API-Key: ${API_KEY}"
```

## Scheduling backups
Expand All @@ -63,7 +65,7 @@ To create a *full* backup you need to make the following API call:
curl --location 'https://api.skysql.com/skybackup/v1/backups/schedules' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $JWT_TOKEN' \
--header 'X-API-Key: ${API_KEY}' \
--data '{
"backup_type": "full",
"schedule": "once",
Expand Down Expand Up @@ -96,7 +98,7 @@ To set up an automatic periodic *full* backup at 3 am UTC, you need to make the
curl --location 'https://api.skysql.com/skybackup/v1/backups/schedules' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $JWT_TOKEN' \
--header 'X-API-Key: ${API_KEY}' \
--data '{
"backup_type": "full",
"schedule": "0 3 * * *",
Expand All @@ -118,7 +120,7 @@ To set up an one-time *incremental* backup, you need to make the following API c
curl --location 'https://api.skysql.com/skybackup/v1/backups/schedules' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $JWT_TOKEN' \
--header 'X-API-Key: ${API_KEY}' \
--data '{
"backup_type": "incremental",
"schedule": "once",
Expand All @@ -134,7 +136,7 @@ To set up an cron *incremental* backup, you need to make the following API call:
curl --location 'https://api.skysql.com/skybackup/v1/backups/schedules' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $JWT_TOKEN' \
--header 'X-API-Key: ${API_KEY}' \
--data '{
"backup_type": "incremental",
"schedule": "0 3 * * *",
Expand All @@ -152,7 +154,7 @@ To set up an one-time *binarylog* backup:
curl --location 'https://api.skysql.com/skybackup/v1/backups/schedules' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $JWT_TOKEN' \
--header 'X-API-Key: ${API_KEY}' \
--data '{
"backup_type": "binarylog",
"schedule": "once",
Expand All @@ -168,7 +170,7 @@ To set up an cron *incremental* backup:
curl --location 'https://api.skysql.com/skybackup/v1/backups/schedules' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $JWT_TOKEN' \
--header 'X-API-Key: ${API_KEY}' \
--data '{
"backup_type": "binarylog",
"schedule": "0 3 * * *",
Expand All @@ -186,7 +188,7 @@ To set up an one-time *dump* backup:
curl --location 'https://api.skysql.com/skybackup/v1/backups/schedules' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $JWT_TOKEN' \
--header 'X-API-Key: ${API_KEY}' \
--data '{
"backup_type": "dump",
"schedule": "once",
Expand All @@ -202,7 +204,7 @@ To set up an cron *dump* backup:
curl --location 'https://api.skysql.com/skybackup/v1/backups/schedules' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $JWT_TOKEN' \
--header 'X-API-Key: ${API_KEY}' \
--data '{
"backup_type": "dump",
"schedule": "0 3 * * *",
Expand All @@ -220,7 +222,7 @@ To set up an external storage backup, you need to make the following API call:
curl --location 'https://api.skysql.com/skybackup/v1/backups/schedules' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $JWT_TOKEN' \
--header 'X-API-Key: ${API_KEY}' \
--data '{
"backup_type": "full",
"schedule": "0 2 * * *",
Expand Down Expand Up @@ -268,7 +270,7 @@ To set up an external storage backup, you need to make the following API call:
curl --location '<https://api.skysql.com/skybackup/v1/backups/schedules>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $JWT_TOKEN' \
--header 'X-API-Key: ${API_KEY}' \
--data '{
"backup_type": "full",
"schedule": "0 2 ** *",
Expand All @@ -289,7 +291,7 @@ To get backup schedules inside the Organization :
```bash
curl --location '<https://api.skysql.com/skybackup/v1/backups/schedules>' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $JWT_TOKEN'
--header 'X-API-Key: ${API_KEY}'
```

#### Get all Backup Schedules per service
Expand All @@ -299,7 +301,7 @@ To get backup schedules for specific service :
```bash
curl --location '<https://api.skysql.com/skybackup/v1/backups/schedules?service_id=dbtgf28044362>' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $JWT_TOKEN'
--header 'X-API-Key: ${API_KEY}'
```

#### Get Backup Schedule by ID
Expand All @@ -309,7 +311,7 @@ To get specific backup schedule by id :
```bash
curl --location 'https://api.skysql.com/skybackup/v1/backups/schedules/200' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $JWT_TOKEN'
--header 'X-API-Key: ${API_KEY}'
```

#### Update Backup Schedule
Expand All @@ -321,7 +323,7 @@ To update specific backup schedule you need to make the following API call:
curl --location --request PATCH '<https://api.skysql.com/skybackup/v1/backups/schedules/215>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $JWT_TOKEN' \
--header 'X-API-Key: ${API_KEY}' \
--data '{
"schedule": "0 9 ** *"
}'
Expand All @@ -334,7 +336,7 @@ To delete a backup schedule you need to provide the backup schedule id. Example
```bash
curl --location --request DELETE 'https://api.skysql.com/skybackup/v1/backups/schedules/215' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $JWT_TOKEN'
--header 'X-API-Key: ${API_KEY}'
```

## Backup Status
Expand All @@ -348,7 +350,7 @@ Here is an example to fetch all the available Backups in your org:
```bash
curl --location 'https://api.skysql.com/skybackup/v1/backups' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $JWT_TOKEN'
--header 'X-API-Key: ${API_KEY}'
```

### List all backups by service
Expand All @@ -358,7 +360,7 @@ To list all backups available for your service :
```bash
curl --location 'https://api.skysql.com/skybackup/v1/backups?service_id=dbtgf28216706' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $JWT_TOKEN'
--header 'X-API-Key: ${API_KEY}'
```

The typical response of either of two calls should look like:
Expand Down Expand Up @@ -402,7 +404,7 @@ You can restore your database from the backup located in the default SkySQL mana
curl --location 'https://api.skysql.com/skybackup/v1/restores' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $JWT_TOKEN' \
--header 'X-API-Key: ${API_KEY}' \
--data '{
"key": "eda3b72460c8c0d9d61a7f01b6a22e32:dbtgf28216706:tx-filip-mdb-ms-0",
"service_id": "dbtgf28044362"
Expand All @@ -421,7 +423,7 @@ You can restore your data from external storage. Your external storage bucket da
curl --location 'https://api.skysql.com/skybackup/v1/backups/schedules' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $JWT_TOKEN' \
--header 'X-API-Key: ${API_KEY}' \
--data '{
"backup_type": "full",
"schedule": "0 2 * * *",
Expand Down Expand Up @@ -502,15 +504,15 @@ In order to get all Restores scheduled in the past you need to make api call:
```bash
curl --location 'https://api.skysql.com/skybackup/v1/restores' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $JWT_TOKEN'
--header 'X-API-Key: ${API_KEY}'
```
#### Get Restore by ID
```bash
curl --location 'https://api.skysql.com/skybackup/v1/restores/12' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $JWT_TOKEN'
--header 'X-API-Key: ${API_KEY}'
```
Typical response of those two apis should look like:
Expand Down Expand Up @@ -555,5 +557,5 @@ You can delete older completed restore schedules. To clean up your auditing hist
```bash
curl --location --request DELETE 'https://api.skysql.com/skybackup/v1/restores/12' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer $JWT_TOKEN'
--header 'X-API-Key: ${API_KEY}'
```
41 changes: 20 additions & 21 deletions docs/Quickstart/Launch DB using the REST API.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ This walkthrough explains how to launch database services and manage the lifecyc

### **Step 1: Generate API Key**

1. Go to the [Generate API Key](https://id.mariadb.com/account/api/generate-key) page.
2. Fill out the API key details:
- In the "Description" field, describe the purpose of the API key.
- In the "Expiration" field, specify how long this key will be valid. If you need to revoke the key before it expires, you can revoke it from the [API Keys](https://id.mariadb.com/account/api) page.
- In the "Scopes" field, select the "read" and "write" scopes under `SkySQL API: Databases`.
3. Click the "Generate API Key" button.
4. After the page refreshes, click the "Copy to clipboard" button to copy the API key.
5. Paste the API key somewhere safe and do not lose it.
6. Set the `SKYSQL_API_KEY` environment variable to the new API key value:
1. Go to SkySQL API Key management page: https://app.skysql.com/user-profile/api-keys and generate an API key

2. Export the value from the token field to an environment variable $API_KEY

```bash
$ export SKYSQL_API_KEY='... key data ...'
$ export API_KEY='... key data ...'
```

The `SKYSQL_API_KEY` environment variable will be used in the subsequent steps.
The `API_KEY` environment variable will be used in the subsequent steps.

Use it on subsequent request, e.g:
```bash
curl --request GET 'https://api.skysql.com/provisioning/v1/services' \\
--header "X-API-Key: $API_KEY"
```

!!! Note
You can use the Swagger docs site we host we try out the API OR
Expand All @@ -30,7 +30,7 @@ This walkthrough explains how to launch database services and manage the lifecyc

You can use the API Documentation [here](https://apidocs.skysql.com/) and directly try out the APIs in your browser.

All you need is to click ‘Authorize’ and type in `Bearer <supply your API key here>`
All you need is to click ‘Authorize’ and type in `<supply your API key here>`



Expand Down Expand Up @@ -107,7 +107,7 @@ This configuration is suitable for a quick test, but a more customized configura
```bash
curl -sS --location --request POST \
--header "Authorization: Bearer ${SKYSQL_API_KEY}" \
--header "X-API-Key: ${API_KEY}" \
--header "Accept: application/json" \
--header "Content-type: application/json" \
--data '@request-service.json' \
Expand All @@ -130,7 +130,7 @@ Before advancing, check the service state using the `[/provisioning/v1/services
```bash
curl -sS --location --request GET \
--header "Authorization: Bearer ${SKYSQL_API_KEY}" \
--header "X-API-Key: ${API_KEY}" \
--header "Accept: application/json" \
https://api.skysql.com/provisioning/v1/services/${SKYSQL_SERVICE} \
| tee response-state.json | jq .status
Expand Down Expand Up @@ -167,7 +167,7 @@ Obtain the connection credentials for the new SkySQL service by executing the fo
```bash
curl -sS --location --request GET \
--header "Authorization: Bearer ${SKYSQL_API_KEY}" \
--header "X-API-Key: ${API_KEY}" \
--header "Accept: application/json" \
--header "Content-type: application/json" \
https://api.skysql.com/provisioning/v1/services/${SKYSQL_SERVICE}/security/credentials \
Expand All @@ -192,15 +192,15 @@ The default username and password will not be available until the service state
### **Step 6: Connect**
Connect to the database using the host, port, and default credentials using the `[mariadb` client](https://mariadb.com/docs/skysql-dbaas/ref/mdb/cli/mariadb/):
Connect to the database using the host, port, and default credentials using the [mariadb client](https://mariadb.com/docs/server/connect/clients/mariadb-client/):
```bash
mariadb --host ${SKYSQL_FQDN} --port ${SKYSQL_PORT} \
--user ${SKYSQL_USERNAME} --password="${SKYSQL_PASSWORD}" \
--ssl-ca ~/Downloads/skysql_chain_2022.pem
--ssl-verify-server-cert
```
If you don't want the password to appear on the command-line, specify the `[--password` command-line option](https://mariadb.com/docs/skysql-dbaas/ref/mdb/cli/mariadb/password/) without an argument to be prompted for a password.
If you don't want the password to appear on the command-line, specify the [--password command-line option](https://mariadb.com/docs/skysql-dbaas/ref/mdb/cli/mariadb/password/) without an argument to be prompted for a password.
### **Step 7: Save Connection Information (Optional)**
Expand All @@ -215,7 +215,6 @@ host=${SKYSQL_FQDN}
port=${SKYSQL_PORT}
user=${SKYSQL_USERNAME}
password="${SKYSQL_PASSWORD}"
ssl-ca=${HOME}/Downloads/skysql_chain_2022.pem
EOF
```
Expand All @@ -225,7 +224,7 @@ EOF
$ chmod 600 ~/.my.cnf
```
2. When all the connection parameters are in your `~/.my.cnf` file, the `[mariadb` client](https://mariadb.com/docs/skysql-dbaas/ref/mdb/cli/mariadb/) can connect without specifying any command-line options:
2. When all the connection parameters are in your `~/.my.cnf` file, the mariadb client can connect without specifying any command-line options:
```bash
$ mariadb
Expand All @@ -235,4 +234,4 @@ EOF
## Resources
- [API Documentation](https://apidocs.skysql.com/)
- [API Reference Documentation](https://mariadb.com/docs/skysql-dbaas/ref/skynr/)
- [API Reference Documentation](../Reference%20Guide/REST%20API%20Reference.md)
12 changes: 6 additions & 6 deletions docs/Reference Guide/Instance Size Choices.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ To see the available database node instance sizes for a topology, use `curl` t

```bash
curl -sS --location \
--header "Authorization: Bearer ${SKYSQL_API_KEY}" \
'https://api.mariadb.com/provisioning/v1/sizes?architecture=amd64&service_type=transactional&provider=gcp&topology=es-replica&type=server' \
--header "X-API-Key: ${API_KEY}" \
'https://api.skysql.com/provisioning/v1/sizes?architecture=amd64&service_type=transactional&provider=gcp&topology=es-replica&type=server' \
| jq .
```

Expand Down Expand Up @@ -137,8 +137,8 @@ To see the default MaxScale instance size for a topology, cloud, and architectur

```bash
curl -sS --location \
--header "Authorization: Bearer ${SKYSQL_API_KEY}" \
'https://api.mariadb.com/provisioning/v1/sizes?provider=gcp&architecture=amd64&topology=es-replica' \
--header "X-API-Key: ${API_KEY}" \
'https://api.skysql.com/provisioning/v1/sizes?provider=gcp&architecture=amd64&topology=es-replica' \
| jq .
```

Expand Down Expand Up @@ -170,8 +170,8 @@ To see the available MaxScale node instance sizes for a topology, use `curl` t

```bash
curl -sS --location \
--header "Authorization: Bearer ${SKYSQL_API_KEY}" \
'https://api.mariadb.com/provisioning/v1/sizes?architecture=amd64&service_type=transactional&provider=gcp&topology=es-replica&type=proxy' \
--header "X-API-Key: ${API_KEY}" \
'https://api.skysql.com/provisioning/v1/sizes?architecture=amd64&service_type=transactional&provider=gcp&topology=es-replica&type=proxy' \
| jq .
```

Expand Down
Loading

0 comments on commit 54345ec

Please sign in to comment.