HTTP Trigger

Overview

The HTTP Trigger is to execute an operation job by sending an HTTP POST request to designated URL, which was specified by Cloud Automator.
The benefit of this feature is user can execute the job very easily.

HTTP Tigger does not require to specify conditions when creating a job.
The URL and access token will be issued after creating job using HTTP Trigger. You can check at job detail page.

The job is executed by sending a POST request to the specified URL with an access token in the Authorization header.
As shown in the execution sample, you can send an HTTP POST request from curl command so you can use this feature by integrating with other system, like SQS Trigger.

Setting example

  1. Here, the example shows how to register an operation job to start EC2 instance in the test environment by using HTTP Trigger.
    SnapCrab_NoName_2020-4-3_14-54-36_No-00.png
  2. Select the group which job will be associated
    SnapCrab_NoName_2020-4-3_14-55-27_No-00.png
  3.  Select "HTTP Trigger" from the Trigger selection
    SnapCrab_NoName_2020-4-3_14-56-53_No-00.png
  4. Select the execution action
    SnapCrab_NoName_2020-4-3_14-57-6_No-00.png
  5. Select the target AWS account which action will be executed 
    SnapCrab_NoName_2020-4-3_14-57-33_No-00.png
  6. Select the method of specifying the action parameters. For the detail, please see here.
    SnapCrab_NoName_2020-4-3_15-0-33_No-00.png
  7. If you selected "Specifiyng parameters before job creation" in the previous step, please configure action parameters.
    SnapCrab_NoName_2020-4-3_15-25-31_No-00.png
  8. Select post-processing when the job succeed/fail.
    SnapCrab_NoName_2020-4-3_15-26-25_No-00.png
  9.  Enter name of the job then click "Confirm" to generate the job.
    SnapCrab_NoName_2020-4-3_15-26-45_No-00.png
  10. Once job creation is completed successfully, the detail screen of the created operation job will be opened. 
    SnapCrab_NoName_2020-4-3_15-27-5_No-00.png
  11. You can confirm that the necessary information for HTTP request is displayed.
    SnapCrab_NoName_2020-4-3_15-27-20_No-00.png

Operation check

  1. Access to operation job detail screen
    _________SnapCrab_NoName_2020-4-3_16-1-25_No-00.png
  2. The execution sample by the curl command is showing so copy and execute the job.
    _____SnapCrab_NoName_2020-4-3_15-27-20_No-00.png
    $ curl https://manager.cloudautomator.com/trigger/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx \
    > -X POST \
    > -H "Authorization: CAAuth xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
    > -H "Content-Length: 0"
    {"result":"ok","trigger_job_id":12345}
  3. Verify job's execution log.
    __________SnapCrab_NoName_2020-4-3_16-1-25_No-00.png
  4. Verify most recent log detail.
    ___________SnapCrab_NoName_2020-4-3_16-3-59_No-00.png
  5. Verify log status
    SnapCrab_NoName_2020-4-3_16-4-11_No-00.png

About POST request response

When executing POST request, be sure to check the status code of response and the response body to make sure that job exectuion has started.

When successful (job execution has started)

If the request is successful and job exection started, tge status code of "200" is retured and following response body in JSON is returned.

{
"result": "ok",
"trigger_job_id": 12345
}

※ The "trigger_job_id" value is actually the ID of the job which started its execution

When failed (job execution has not started)

If the request has failed and the job execution didn't start, the status code value of "500", "503" or "404" (other than "200") will be returned.
When status code was "5xx", please wait a little and try again.
When status code was "4xx", please check URL and access token value are correct.

Note

If the URL and access token are disclosed to other people, the job may be executed.Please handle it with care.
If there is a possibleility that the URL and access token were compromised, you can change the URL and access token to different values by using "Update" botton in the operaetion job detail screen.

SnapCrab_NoName_2020-4-3_15-27-20_No-00.png

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request