Skip to content

SAP HANA Cloud Alerts and Metrics tutorials #23062

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tutorials/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"SAP HANA Database Explorer.displaySapWebAnalyticsStartupNotification": false
}
Binary file modified tutorials/hana-cloud-alerts-autopilot/add-executor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-alerts-autopilot/build-event-trigger.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-alerts-autopilot/command-input.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-alerts-autopilot/command.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-alerts-autopilot/create-catalog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-alerts-autopilot/create-input.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-alerts-autopilot/edit-output-value.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-alerts-autopilot/execute-script.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-alerts-autopilot/execution-finished.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-alerts-autopilot/executions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-alerts-autopilot/executor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-alerts-autopilot/failed-execution.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-alerts-autopilot/getHANACloudDBDetails.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
114 changes: 63 additions & 51 deletions tutorials/hana-cloud-alerts-autopilot/hana-cloud-alerts-autopilot.md

Large diffs are not rendered by default.

Binary file modified tutorials/hana-cloud-alerts-autopilot/input.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-alerts-autopilot/output-defined.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-alerts-autopilot/provided-catalogues.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-alerts-autopilot/script-examples.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-alerts-autopilot/script-input.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tutorials/hana-cloud-alerts-autopilot/service-account.png
Binary file modified tutorials/hana-cloud-alerts-autopilot/trigger-command.png
Binary file modified tutorials/hana-cloud-alerts-custom/add-2nd-executor.png
Binary file modified tutorials/hana-cloud-alerts-custom/add-executor-sql.png
Binary file modified tutorials/hana-cloud-alerts-custom/add-executor.png
Binary file modified tutorials/hana-cloud-alerts-custom/additional-value.png
Binary file modified tutorials/hana-cloud-alerts-custom/automation-pilot.png
Binary file modified tutorials/hana-cloud-alerts-custom/bad-request.png
Binary file modified tutorials/hana-cloud-alerts-custom/command-with-input-keys.png
Binary file modified tutorials/hana-cloud-alerts-custom/conditional.png
Binary file modified tutorials/hana-cloud-alerts-custom/create-catalog.png
Binary file modified tutorials/hana-cloud-alerts-custom/create-command.png
Binary file modified tutorials/hana-cloud-alerts-custom/create-input-ans.png
Binary file modified tutorials/hana-cloud-alerts-custom/create-input-hc.png
Binary file modified tutorials/hana-cloud-alerts-custom/edit-output.png
Binary file modified tutorials/hana-cloud-alerts-custom/edit-parameters.png
Binary file modified tutorials/hana-cloud-alerts-custom/execution-output.png
100 changes: 51 additions & 49 deletions tutorials/hana-cloud-alerts-custom/hana-cloud-alerts-custom.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@ An SAP Automation Pilot command will be created to check if any maintenance item
![scenario](scenario.png)

>If you do not already have the `HOTEL.MAINTENANCE` table in an SAP HANA Cloud database, please create it now by following the first 2 steps in the [Create Database Objects with SAP HANA Database Explorer](hana-dbx-create-schema) tutorial.

>
>---

>
>If you do not have a subscription to the SAP Automation Pilot service, step 1 of the tutorial [Take Action Following a SAP HANA Cloud Database Alert with SAP Automation Pilot](hana-cloud-alerts-autopilot) provides details on how to so.

>
>---
>
>If you do not have an instance of the SAP Alert Notification service, see step 5 of the tutorial [Alerts in SAP HANA Database and Data Lake](hana-cloud-alerts).

>If you do not have an instance of the SAP Alert Notification service, step 5 of the tutorial [Alerts in SAP HANA Database and Data Lake](hana-cloud-alerts) provides details on how to do so.

---

Expand All @@ -54,8 +55,8 @@ This step will create a catalog, an input, and a command in the SAP Automation P
| Label | Value |
| -------- | ----- |
| Name | `CustNotif` |
| Display name | Custom Notifications |
| Description | A user catalog which will hold inputs and commands demonstrating how to perform a custom notification |
| Display name | `Custom Notifications` |
| Description | `A user catalog which will hold inputs and commands demonstrating how to perform a custom notification` |

2. Create an input to store the connection details for an SAP HANA Cloud database.

Expand All @@ -65,22 +66,22 @@ This step will create a catalog, an input, and a command in the SAP Automation P

| Label | Value |
| -------- | ----- |
| Catalog | Custom Notifications |
| Catalog | `Custom Notifications` |
| Name | `SAPHANADB` |
| Description | Contains the details to connect to a specific SAP HANA Cloud database |
| Description | `Contains the details to connect to a specific SAP HANA Cloud database` |

3. Add the following keys to the input.

![input with keys](input-hc.png)

| Key Name | Type | Sensitive | Description | Value |
| -------- | ----- | --- | --- | --- |
| host | String | no | Host value for a SAP HANA Cloud database | Copy the SQL Endpoint from SAP HANA Cloud Central and strip off :443 |
| port | String | no | Port value for a SAP HANA Cloud database | 443 |
| user | String | no | The user ID to connect the database | USER1 |
| password | String | yes | The password to connect the database | Password1 |
| host | String | no | Host value for a SAP HANA Cloud database | *Copy the SQL Endpoint from SAP HANA Cloud Central and remove :443* |
| port | String | no | Port value for a SAP HANA Cloud database | `443` |
| user | String | no | The user ID to connect the database | `USER1` |
| password | String | yes | The password to connect the database | `Password1` |

>Storing values in an input enables the values to be reused across different commands and if a value needs to be updated, it only has to be updated in one place.
>Storing values in an input enables the values to be reused across different commands. If a value needs to be updated, it only has to be updated in one place.

4. Create a command.

Expand All @@ -90,9 +91,9 @@ This step will create a catalog, an input, and a command in the SAP Automation P

| Label | Value |
| -------- | ----- |
| Catalog | Custom Notifications |
| Catalog | `Custom Notifications` |
| Name | `CheckMaintenanceItems` |
| Description | Perform a check to see if there are any unassigned maintenance items |
| Description | `Perform a check to see if there are any unassigned maintenance items` |

5. In the newly created command, select input and add an [additional value](https://help.sap.com/docs/AUTOMATION_PILOT/de3900c419f5492a8802274c17e07049/f70c599222084a13a13cbd69263d3f44.html) which is the `SAPHANADB` input.

Expand All @@ -103,7 +104,7 @@ This step will create a catalog, an input, and a command in the SAP Automation P
| Label | Value |
| -------- | ----- |
| Alias | `scriptInput` |
| Value Type | Input |
| Value Type | `Input` |
| Input | `SAPHANADB` |

>An alternative method of passing parameters to the command uses the input keys in the contract section. This is shown in step 4.
Expand All @@ -117,27 +118,27 @@ This step will create a catalog, an input, and a command in the SAP Automation P
| Label | Value |
| -------- | ----- |
| Name | `checkResult` |
| Type | string |
| Sensitive | No |
| Description | JSON string of the result |
| Type | `string` |
| Sensitive | `No` |
| Description | `JSON string of the result` |

7. Under Configuration, add an executor.

![Add executor](add-executor.png)

Click on Here and specify the values below.
Click on **Here** and specify the values below.

![Add an executor](query-db.png)

| Label | Value |
| -------- | ----- |
| Command | `scripts-sapcp:ExecuteScript:2` |
| Alias | `QueryDB` |
| `Automap` Parameters | `true` |
| Automap Parameters | `true` |

> :2 indicates that this is version 2 of the command.

> `Automap` parameters is not used in this tutorial so its value can be enabled or disabled.
> `Automap parameters` is not used in this tutorial, so its value can be enabled or disabled.

8. Select `QueryDB` and then press the edit parameters button.

Expand Down Expand Up @@ -175,11 +176,11 @@ This step will create a catalog, an input, and a command in the SAP Automation P

![Output value](manual-trigger-command-hello.png)

>A quick way to return to the command after executing it is to on the link shown below.
>A quick way to return to the command after executing it is to click on the link shown below.

>![Return to command](return-to-command.png)

At this point, a command has been created and executed. In the next 2 steps, two different techniques of executing SQL against an SAP HANA Cloud database will be shown.
At this point, a command has been created and executed. In the next two steps, two different techniques of executing SQL against an SAP HANA Cloud database will be shown.


### Perform a query using the ExecuteHanaCloudSqlStatement command
Expand All @@ -199,7 +200,7 @@ This step will add an additional executor to the command that can connect to a S
| -------- | ----- |
| Command | `sql-sapcp:ExecuteHanaCloudSqlStatement:1` |
| Alias | `SQLStatement` |
| `Automap` Parameters | `true` |
| Automap Parameters | `true` |

2. Select `SQLStatement` and then press the edit parameters button.

Expand All @@ -221,9 +222,9 @@ This step will add an additional executor to the command that can connect to a S

| Key | Value |
| -------- | ----- |
| Type | Basic Authentication |
| User | $(.scriptInput.user) |
| Password | $(.scriptInput.password) |
| Type | `Basic Authentication` |
| User | `$(.scriptInput.user)` |
| Password | `$(.scriptInput.password)` |

Notice that the user or password inputs provide autocompletion after `$(.` is entered.

Expand All @@ -235,11 +236,11 @@ This step will add an additional executor to the command that can connect to a S

| Key | Value |
| -------- | ----- |
| Result Row Format: | Object |
| Result Row Format: | `Object` |
| Result Transformer | `toArray[0]` |


6. Select `QueryDB` and then press the edit parameters button.
6. Select `QueryDB`. Then press the edit parameters button.

![edit QueryDB](edit-querydb.png)

Expand All @@ -257,7 +258,7 @@ This step will add an additional executor to the command that can connect to a S
print(rows)
```

Under STDIN, specify `$(.SQLStatement.output.result)` so that the output of the previous step can be accessed in the Python code.
Under STDIN, specify `$(.scriptInput.password)` so that the output of the previous step can be accessed in the Python code.

![STDIN](stdin.png)

Expand All @@ -270,14 +271,14 @@ This step will add an additional executor to the command that can connect to a S

![Output value](manual-trigger-command-sql.png)

In the above step, it was demonstrated how the provided [SQL Statement](https://help.sap.com/docs/AUTOMATION_PILOT/de3900c419f5492a8802274c17e07049/024ff1ff1c46465f838c6faf655a9f0a.html) command can be used. It's output was passed into a Python command where the result could be further processed. In the next step, an example is shown how to execute SQL statements directly in the Python command.
The above step demonstrates how the provided [SQL Statement](https://help.sap.com/docs/AUTOMATION_PILOT/de3900c419f5492a8802274c17e07049/024ff1ff1c46465f838c6faf655a9f0a.html) command can be used. Its output was passed into a Python command, where the result could be further processed. The next step is an example to execute SQL statements directly in the Python command.



### Perform a query using hdbcli in a Python script


This step will demonstrate how SQL queries can be made directly in Python rather than using a separate executor
This step will demonstrate how SQL queries can be made directly in Python rather than using a separate executor.

1. Optionally delete the executor `SQLStatement`.

Expand Down Expand Up @@ -353,7 +354,7 @@ This step will demonstrate how SQL queries can be made directly in Python rather
A second executer will be added in this step. It will take the output returned from `QueryDB` and forward it to the SAP Alert Notification Service.


1. In the SAP Alert Notification Service, create a basic service key. The service key will provide the URL and credentials for the SAP Automation Pilot to send notifications to the SAP Alert Notification Service.
1. In the SAP Alert Notification Service, create a basic service key named `BasicANSServiceKey`. The service key will provide the URL and credentials for the SAP Automation Pilot to send notifications to the SAP Alert Notification Service.

![Create an ANS service key](create-service-key.png)

Expand All @@ -371,9 +372,9 @@ A second executer will be added in this step. It will take the output returned

| Label | Value |
| -------- | ----- |
| Catalog | Custom Notifications |
| Catalog | `Custom Notifications` |
| Name | `ANSUserInput` |
| Description | Basic credentials (`client_id` and `secret_key`) used to access the SAP Automation Pilot |
| Description | `Basic credentials (client_id and secret_key) used to access the SAP Automation Pilot` |

3. Add two keys to the input.

Expand Down Expand Up @@ -407,7 +408,7 @@ A second executer will be added in this step. It will take the output returned
| ----- | ----- |
| Command | `monitoring-sapcp:SendAlertNotificationServiceEvent:1` |
| Alias | `SendNotification` |
| `Automap` Parameters | `true` |
| Automap Parameters | `true` |

6. Edit the parameters of the just added executor.

Expand All @@ -419,14 +420,14 @@ A second executer will be added in this step. It will take the output returned

| Label | Value |
| ----- | ----- |
| data | $(.QueryDB.output.output[0]) |
| password | $(.execution.input.ANSClientSecret) |
| `url` | value from ANS service key + `/cf/producer/v1/resource-events` |
| user | $(.execution.input.ANSClientID) |
| data | `$(.QueryDB.output.output[0])` |
| password | `$(.execution.input.ANSClientSecret)` |
| url | *value from ANS service key* `/cf/producer/v1/resource-events` |
| user | `$(.execution.input.ANSClientID)` |

7. Trigger the command which will fail. Additional inputs are not needed.

![trigger the command](trigger.png)
![trigger the command](manual-trigger-command.png)

Examine the reason for the failure.

Expand All @@ -436,7 +437,7 @@ A second executer will be added in this step. It will take the output returned

8. Edit the parameters of the `QueryDB` executor.

Replace the script with the content below which will generate a JSON string that is in the correct format for the SAP Alert Notification Service producer API. The address value will need to be updated to reflect your SAP HANA Cloud instance.
Replace the script with the content below. This will generate a JSON string in the correct format for the SAP Alert Notification Service producer API.

```Python
#!/usr/bin/env python3
Expand Down Expand Up @@ -495,11 +496,12 @@ The following instructions use the SAP Alert Notification Service to send an ema
| Label | Value |
| ----- | ----- |
| Name | `Unassigned-Maintenance-Items` |
| Condition | `eventType is Equal To Unassigned_Maint_EVENT` |
| Condition | `eventType` is Equal To `Unassigned_Maint_EVENT` |
| Description | `There are items in the table HOTEL.MAINTENANCE that are not assigned.` |

![create condition details](create-condition-details.png)

>A further condition could be added to only send an email when the severity equals WARNING. When the severity is INFO, there were no unassigned maintenance items.
>A further condition could be added to send an email only when the severity equals WARNING. When the severity is INFO, there were no unassigned maintenance items.

>---

Expand All @@ -521,19 +523,19 @@ The following instructions use the SAP Alert Notification Service to send an ema

![email action details](create-action-email-details.png)

Scroll to the Advanced Action Properties section.
Scroll to the Additional Properties section.

![advanced action details](create-action-email-details-advanced.png)

Specify the values below.

| Label | Value |
| ----- | ----- |
| Email Address | your email address |
| Email Address | *your email address* |
| Subject Template | `{severity} {eventType}` |
| Payload Template | `Body: {subject}` |

5. A confirmation token will be sent to the email address. Click on the provided link or copy that value and use it to confirm the action as shown in the next sub-step.
5. A confirmation token will be sent to the email address. Click on the provided link or copy confirmation token and use it to confirm the action as shown in the next sub-step.

![email with confirmation token](ans-sub-action-type-email-confirm0.png)

Expand Down Expand Up @@ -582,7 +584,7 @@ In this step, the command will be scheduled to run once a week.
| -------- | ----- |
| Command | `CheckMaintenanceItems` |
| Schedule | `Weekly`|
| Days | `Monday`|
| Weekdays | `Monday`|
| Hours | `12`|
| Minutes | `0`|

Expand Down
Binary file modified tutorials/hana-cloud-alerts-custom/input-ans.png
Binary file modified tutorials/hana-cloud-alerts-custom/input-hc.png
Binary file modified tutorials/hana-cloud-alerts-custom/manual-trigger-command.png
Binary file modified tutorials/hana-cloud-alerts-custom/output-key.png
Binary file modified tutorials/hana-cloud-alerts-custom/query-db-parameters.png
Binary file modified tutorials/hana-cloud-alerts-custom/return-to-command.png
Binary file modified tutorials/hana-cloud-alerts-custom/schedule.png
Binary file modified tutorials/hana-cloud-alerts-custom/scheduled.png
Binary file modified tutorials/hana-cloud-alerts-custom/successful-request.png
Binary file modified tutorials/hana-cloud-alerts-rest-api/HANA-Cloud-service.png
Binary file modified tutorials/hana-cloud-alerts-rest-api/REST-client-install.png
Binary file modified tutorials/hana-cloud-alerts-rest-api/access_token.png
Binary file modified tutorials/hana-cloud-alerts-rest-api/create-service-key.png
28 changes: 14 additions & 14 deletions tutorials/hana-cloud-alerts-rest-api/hana-cloud-alerts-rest-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ primary_tag: software-product>sap-hana-cloud
---

# Access SAP HANA Cloud Alerts and Metrics using a REST API
<!-- description --> Learn how to access details of triggered alerts, as well as how to access the list of available database metrics and values of a specified metric using a REST API.
<!-- description --> Learn how to access details of triggered alerts, a list of available database metrics, and values of a specified metric using a REST API.

## Prerequisites
- Access to an SAP HANA Cloud trial or production instance with a version of 2021 QRC 3 or higher.
- Access to an SAP HANA Cloud free tier, trial or production instance.
- A tool such as the REST Client extension for Visual Studio Code enabling the calling of a REST API.

## You will learn
Expand Down Expand Up @@ -66,11 +66,11 @@ There are multiple tools that enable making calls to a REST API such as Postman,

4. Add the REST Client extension from Marketplace after opening the extensions view.

<!-- border -->![Install Rest client ](REST-client-install.png)
![Install Rest client ](REST-client-install.png)

5. Try calling the sample REST APIs by clicking on the blue text `Send Request`.

<!-- border -->![send request](send-request.png)
![send request](send-request.png)

The results should appear in another pane. An example result is shown below.

Expand All @@ -87,9 +87,9 @@ The following steps are required to create a bearer token that will be used in s

![HANA Cloud instance](HANA-Cloud-service.png)

Create a service key if one does not exist.
Create a service binding if one does not exist.

<!-- border -->![Create service key](create-service-key.png)
![Create service key](create-service-key.png)

When creating a service key, a JSON file or parameters section is not needed and can be left empty.

Expand All @@ -103,18 +103,18 @@ The following steps are required to create a bearer token that will be used in s
#REST Client variables -------------------

#From first part of host. Example shown below
@serviceInstance = 3a2ef55e-4214-4bd9-adfc-f547d8e2d384
@serviceInstance = f2a41f04-3eb7-441b-875f-df9e3fe6d8c2

@oauth = oauth/token?grant_type=client_credentials

#From the uaa.url field. Example value shown below
@uaa_url = https://79d1acd2trial.authentication.us10.hana.ondemand.com
@uaa_url = https://tracy-wai-ie3a8mut.authentication.us30.hana.ondemand.com

#From the clientid field. Example value shown below.
@clientid = sb-3a2ef55e-4214-4bd9-adfc-f547d8e2d384-89aa!b24182|hct-us10-apigateway-hana-cloud!b7169
@clientid = sb-f2a41f04-3eb7-441b-875f-df9e3fe6d8c2-6414!b5208|hc-us30-apigateway-hana-cloud!b2649

#From the clientsecret field. Example value shown below.
@clientsecret = 05Zmy6084dtzX8iUuO4+1ce0C/c=
@clientsecret = 381b11e9-29c4-44ed-b609-2c937dcfa5c1$z8euxr_CXT2L9Wb_RRWaOtNxM5ZvhUbyBQp7ZvLS7Wc=

#Provides start and end timestamps for alerts or metrics using REST Client plugin's dynamic variables
@startTSAlerts = {{$datetime iso8601 -4 d}}
Expand Down Expand Up @@ -142,15 +142,15 @@ The following steps are required to create a bearer token that will be used in s
### Retrieve triggered alerts


The following instructions will show a few examples of how to view the list of triggered SAP HANA Cloud, SAP HANA database alerts. If there are no alerts returned, the tutorial, [Alerts in SAP HANA Database and Data Lake](hana-cloud-alerts) provides examples of how to generate a few alerts including a test alert.
The following instructions will show a few examples of how to view the list of triggered SAP HANA Cloud, SAP HANA database alerts. If there are no alerts returned, visit the [Alerts in SAP HANA Database and Data Lake](hana-cloud-alerts) tutorial to see examples of how to generate a few alerts, including a test alert.

1. Add the following variables to the end of the REST Client variables section of the `AlertsAndMetrics.http` file and update the highlighted value from your service key.
1. Add the following variables to the end of the REST Client variables section of the `AlertsAndMetrics.http` file. Update the highlighted value from your service key.

```HTTP[4]
@gateway_url = https://api.gateway.orchestration

#From host, part after instanceID.hana
@host = trial-us10.hanacloud.ondemand.com
@host = prod-us30.hanacloud.ondemand.com
```

2. Add the following calls to the bottom of the `AlertsAndMetrics.http` file after the line with ###.
Expand Down Expand Up @@ -256,7 +256,7 @@ The following instructions will show a few examples of how to view metrics throu

2. Try out the definitions call to get a list of the available metrics

<!-- border -->![Result of request to show the available metrics](metrics-list.png)
![Result of request to show the available metrics](metrics-list.png)

A few of the returned values are explained below:

Expand Down
Binary file modified tutorials/hana-cloud-alerts-rest-api/metrics-list.png
Binary file modified tutorials/hana-cloud-alerts-rest-api/send-request.png
Binary file modified tutorials/hana-cloud-alerts-rest-api/view-service-key.png
Binary file modified tutorials/hana-cloud-alerts/add-data-lake.png
Binary file modified tutorials/hana-cloud-alerts/alert-defintions-cockpit.png
Binary file added tutorials/hana-cloud-alerts/alert-threshold.png
Binary file modified tutorials/hana-cloud-alerts/alerts-app-cockpit.png
Binary file added tutorials/hana-cloud-alerts/alerts-hcc.png
Binary file modified tutorials/hana-cloud-alerts/ans-open.png
Binary file modified tutorials/hana-cloud-alerts/ans-sub.png
Binary file modified tutorials/hana-cloud-alerts/ans.png
Binary file modified tutorials/hana-cloud-alerts/cockpit-monitoring.png
Binary file modified tutorials/hana-cloud-alerts/create-action-email-details.png
Binary file modified tutorials/hana-cloud-alerts/create-action.png
Binary file modified tutorials/hana-cloud-alerts/create-condition-dl.png
Binary file modified tutorials/hana-cloud-alerts/create-condition.png
Binary file modified tutorials/hana-cloud-alerts/dl-properties.png
Binary file modified tutorials/hana-cloud-alerts/entitlements.png
Loading