Creating a datasource using CLI if-else control flow in EAP6.1.0 and above

Solution Unverified - Updated -

Issue

  • Is it possible to check using CLI if the dataSource exist or not?
  • Also is it possible to create a fresh datasource if the DataSource does not exist using the CLI if-else flow control ?
  • How to incorporate conditional logic in CLI scripts? Is it possible to incorporate conditional logic in CLI scripts? For example, a script that creates a data source might execute fine the first time but fail with a duplicate resource error if run again. How to make the scripts idempotent so that it would check and add data source only if it did not already exist.

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content