In order to make an inbound REST API call to SAP Landscape Management (LaMa), the JSON-format data needs to be built the right way. With the exception of provisioning, all other types of remote executions required the JSON-format data to be created by referencing the API guide and figuring out what should be included and excluded.

As of SP27, inbound REST API calls became much simpler to execute. Now the JSON-format data can be generated in LaMa for  system and host level operations, custom operations, operation templates, and custom processes. This JSON-format generated content can then be used in the external application or a REST client.

The JSON-format data contains the operation ID, given entities, and parameters required to perform the operation remotely using the SAP Landscape Management API. Depending on the operation, default parameters that were generated by SAP Landscape Management are also listed in a separate tab. Secure parameter values are replaced by asterisks (*) and should be filled out when making the remote REST API call.

Almost any operation that can be executed from the LaMa UI, can also be executed via a REST call. Remote Execution button/tab shows up at the summary screen after the user input roadmap and this is where you will see the generated JSON-format data.

Refer to this older blog for getting started with inbound REST API and then use the information in this new blog to experiment with various auto generated JSON-format data.

Lets now go through a couple of examples to show how it works.

Host Level Operation: Validate Host

Here we will perform an operation at the host level.

  • Go to Operations > Hosts screen
  • Select Operations > Other > Validate Host

 

  • On the next screen select Remote Execution

  • Note down the Remote Execution URL and also what method to use. In this case we are told to send a POST request

  • Click on the “Execution request” tab. Here you will see the JSON data that can be copied with the Copy option and pasted into a REST client such as Postman

  • Verify with Postman. Paste above into the Body and send the request

  • Check in LaMa that the operation executed

 

 

System Level Operation: Change Dynamic Profile Parameter

Here we will perform an operation at the System level.

  • Go to Operations > Systems screen
  • For the desired system, select Operations > Mass Operations > RFC > Change Dynamic Profile Parameter

  • In Parameters section on the right, enter Name of parameter (rdisp/rfc_max_login) and new value (100)
  • Click Remote Execution at the bottom of the screen

  • As in previous example, note down the remote execution URL and the method (POST in this case)
  • On the “Execution request” tab, copy the JSON data

  • As in the previous example, verify with a REST client such as Postman. Paste above into the Body and send the request

  • You can monitor the progress in the LaMa UI

 

Provisioning: System Copy

Here we will conduct a provisioning type remote execution and perform a system copy from a source A4H to target B4H.

  • Go to Provisioning > Systems screen
  • Select Provisioning > System Copy
  • Navigate through the roadmap by following the instructions on the screen
  • Change the parameters you want to include in the JSON-format data for remote execution.
  • When you reach the Summary screen, choose Remote Execution
  • As in previous examples, note down the remote execution URL and the method (POST in this case)
  • On the “Execution request” tab, copy the JSON data and fill out where any password is marked with asterisks (*) or #secure

  • The Parameters tab displays all parameters, including the parameters generated by LaMa that haven’t been changed in the roadmap. The data here is not needed for remote execution
  • As in the previous examples, verify with a REST client such as Postman. Paste above into the Body and send the request

  • You can monitor the progress in the LaMa UI

 

Conclusion

The blog has demonstrated how easy it is to make REST API calls to LaMa from an external application. There is no need to struggle with the JSON format and you only send data that is needed.

References

 

Sara Sampaio

Sara Sampaio

Author Since: March 10, 2022

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x