Skip to content

Sha example #153

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 3 commits into from
Jun 9, 2025
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ After importing, you'll see a new catalog tile - **Automation Pilot Examples**.
|---------|-------------|
| [HTTP Request With OAuth Client Credentials](http-oauth-client-credentials) | Perform HTTP requests to endpoints requiring OAuth 2.0 authentication using client credentials |
| [HTTP Request via SAP Cloud Connector](http-cloud-connector) | Perform HTTP requests to internal endpoints via SAP Cloud Connector |
| [Execute a SAP Host Agent Operation via SAP Cloud Connector](sap-host-agent-via-cloud-connector) | Execute a SAP Host Agent Operation in an internal environment via SAP Cloud Connector |

### Scripting

Expand Down
55 changes: 55 additions & 0 deletions sap-host-agent-via-cloud-connector/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Execution of a SAP Host Agent operation via Automation Pilot and SAP Cloud Connector

Table of Contents

* [Description](#description)
* [Requirements](#requirements)
* [How to use](#how-to-use)
* [Expected result](#expected-result)

## Description

This example demonstrates how SAP Automation Pilot can perform HTTP requests in order to execute SAP Host Agent Operations via the [SAP Cloud Connector](https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/cloud-connector). Any HTTP-based protocol is supported, including OData, REST, and SOAP.

By leveraging the Cloud Connector, Automation Pilot can interact with systems that are not directly accessible from the public Internet, enabling secure automation scenarios across hybrid landscapes.

## Requirements

To use this example you'll need the following:

* **SAP Automation Pilot Tenant**: Access to an SAP Automation Pilot tenant - [help](https://help.sap.com/docs/automation-pilot/automation-pilot/initial-setup).
* **SAP Cloud Connector**: Connected to the same SAP BTP account as your Automation Pilot tenant - [help](https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/cloud-connector). [Here](https://help.sap.com/docs/automation-pilot/automation-pilot/what-is-sap-automation-pilot) you can find in which regions SAP Automation Pilot is available.
* **Configured Cloud Connector Mapping**: The internal HTTP endpoint for SAP Host Agent must be exposed via the Cloud Connector and accessible using a virtual hostname and port.

### Cloud Connector Setup Steps

1. **Expose access to the SAP Host Agent through the Cloud Connector**
Assign a virtual host and port to SAP Host Agent in the Cloud Connector admin console. This virtual host will be used to send requests from BTP (e.g., Automation Pilot) to the agent.
Standard **Internal HTTPS port** - *1129* and **URL Path** - */saphostagent/services/SAPHostControl*

2. **Verify Cloud Connector connection in BTP**
Once the Cloud Connector is successfully connected to your BTP subaccount and the system is exposed, you will see the Cloud Connector listed in your BTP subaccount cockpit.

## How to use

1. **Import the Example**:
* Copy the content of the provided file.
* Go to your SAP Automation Pilot tenant and navigate to `My Catalogs`.
* Click on `Import` in the upper right corner.
* Paste the catalog's content and import it.

2. **Trigger the Command**:
* Use the `RunOperationViaScc` command.
* Provide the neccessary values for the input keys:
* server - the virtual hostname as configured in the Cloud Connector
* arguments - the arguments that will be passed to the SAP Host Agent operation, in the format *{"argumentName": "argumentValue"}*
* sensitiveArguments – sensitive arguments that will be passed to the SAP Host Agent operation, in the same format as arguments
* name - the name of the SAP Host Agent operation
* user - the user used for authenticating to the system. Most commonly *sapadm*
* password - the user's password
* locationId - the Location ID of the Cloud Connector (or leave empty if not specified)
* Start the automation.

## Expected result

After execution, the command will trigger the specified SAP Host Agent operation via the Cloud Connector and wait for it to finish. The result from the operation will be returned as output.
Loading