site24x7 / terraform-provider-site24x7

Terraform provider for Site24x7
MIT License
22 stars 33 forks source link

REST API transaction - Multiple Steps #230

Closed bmcgrath-pr closed 8 months ago

bmcgrath-pr commented 8 months ago

I have been attempting to utilize REST API Transaction Monitors and can successfully create a single step. I am however struggling to find within any documentation how to add multiple steps. Is there an example you can provide as I do believe this is possible but cannot figure it out without a little assistance. Thanks

bmcgrath-pr commented 8 months ago

For more clarity, see the below example code which will create a single step with display name "RestAPI Transaction Monitor" - How can we create two steps where the second step will have display name "RestAPI Transaction Monitor2"?

// Site24x7 Rest API Monitor API doc - https://www.site24x7.com/help/api/#rest-api-transaction resource "site24x7_rest_api_transaction_monitor" "rest_api_transaction_monitor_basic" { // (Required) Display name for the monitor display_name = "REST API Monitor - terraform"

// (Required) List of Steps details to be associated to the steps.

steps {

// (Required) Display name for the step
display_name = "RestAPI Transaction Monitor"

// (Required)  API request details related to this step.
step_details {

  // (Required) Domain address for the step.
  step_url = "https://www.example1.com"
}

} // (Optional) Name of the Location Profile that has to be associated with the monitor. // Either specify location_profile_id or location_profile_name. // If location_profile_id and location_profile_name are omitted, // the first profile returned by the /api/location_profiles endpoint // (https://www.site24x7.com/help/api/#list-of-all-location-profiles) will be // used. location_profile_name = "North America" }

jim-billy-zoho commented 8 months ago

@bmcgrath-pr We have updated the example for adding multiple steps. Can you please refer - https://github.com/site24x7/terraform-provider-site24x7/blob/ca1de0998b2cb6e534e970530a4da175822b3663/examples/rest_api_transaction_monitor_us.tf#L261

You have to add one more steps block


steps {
  // (Required) Display name for the step
  display_name = "RestAPI Transaction Monitor2"

  // (Required)  API request details related to this step.
  step_details {

    // (Required) Domain address for the step.
    step_url = "https://www.example1.com"
  }
}