Using Morpheus CLI to Generate API Requests

The Morpheus CLI can be a great tool to create/update/delete resources in Morpheus from your workstation or server programmatically. The API can also be leveraged for completing the same tasks but creating a request from scratch can be tedious. Luckily, the CLI has a great way to get you started on API requests!

Appending --curl to a command will initiate a DRY RUN and not make any changes. This allows you fill in values in the CLI and get the output in a curl command format. See the example below for creating a new cloud called NewCloud, which will prompt us for inputs and output in the curl format:

A great advantage of using the CLI is you can enter ? when prompted for an input to see your available choices. This makes building your queries much quicker for testing.

Helpful Links
CLI Getting Started
CLI Adding Clouds
API Adding Clouds

2 Likes

If you utilize --scrub it’ll automatically *** your Bearer tokens when you showing example CLI calls :wink:

1 Like

well, I learned a new trick today! Thanks!

The CLI is great for preparing json payloads for executing API calls and automating Morpheus actions.

1 Like