From f971f6793c2377077097d5f29c3c965397d97ca9 Mon Sep 17 00:00:00 2001 From: vikashkuma Date: Tue, 12 Mar 2024 10:09:16 +0530 Subject: [PATCH 1/2] labels added --- catchpoint/resource_playwright_test_type.go | 1 - catchpoint/resource_puppeteer_test_type.go | 20 ++++++++++++++++++++ docs/examples/Create test/puppeteer_test.tf | 13 +++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/catchpoint/resource_playwright_test_type.go b/catchpoint/resource_playwright_test_type.go index 6a4b2b0..39b1ec5 100644 --- a/catchpoint/resource_playwright_test_type.go +++ b/catchpoint/resource_playwright_test_type.go @@ -1061,7 +1061,6 @@ func resourcePlaywrightTestCreate(d *schema.ResourceData, m interface{}) error { } log.Printf("[DEBUG] Creating test: " + test_name) - log.Printf("[DEBUG] jsonStr : %#v", jsonStr) respBody, respStatus, testId, err := createTest(api_token, jsonStr) if err != nil { log.Fatal(err) diff --git a/catchpoint/resource_puppeteer_test_type.go b/catchpoint/resource_puppeteer_test_type.go index fba3864..f82ab50 100644 --- a/catchpoint/resource_puppeteer_test_type.go +++ b/catchpoint/resource_puppeteer_test_type.go @@ -111,6 +111,26 @@ func resourcePuppeteerTestType() *schema.Resource { Optional: true, Description: "Optional. Test status: active or inactive", }, + "label": { + Type: schema.TypeSet, + Optional: true, + Description: "Optional. Label with key, values pair", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "key": { + Type: schema.TypeString, + Required: true, + }, + "values": { + Type: schema.TypeList, + Required: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, "thresholds": { Type: schema.TypeSet, Optional: true, diff --git a/docs/examples/Create test/puppeteer_test.tf b/docs/examples/Create test/puppeteer_test.tf index b45b7ff..74f3a2c 100644 --- a/docs/examples/Create test/puppeteer_test.tf +++ b/docs/examples/Create test/puppeteer_test.tf @@ -16,6 +16,19 @@ resource "puppeteer_test" "test" { additional_monitor="ping icmp" } + request_settings { + authentication { + authentication_type = "basic" + password_ids = [2332] + } + token_ids = [1096] + http_request_headers { + user_agent { + value = "vikash" + } + } + } + alert_settings { alert_rule { alert_type="timing" From 46c91bd20787ef01f5910db2fa9eb7a6ac279d1e Mon Sep 17 00:00:00 2001 From: vikashkuma Date: Tue, 12 Mar 2024 10:13:46 +0530 Subject: [PATCH 2/2] labels added --- docs/examples/Create test/puppeteer_test.tf | 5 +++++ docs/resources/puppeteer_test.md | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/docs/examples/Create test/puppeteer_test.tf b/docs/examples/Create test/puppeteer_test.tf index 74f3a2c..bad43ab 100644 --- a/docs/examples/Create test/puppeteer_test.tf +++ b/docs/examples/Create test/puppeteer_test.tf @@ -16,6 +16,11 @@ resource "puppeteer_test" "test" { additional_monitor="ping icmp" } + label { + key="label1" + values=["v1","v2"] + } + request_settings { authentication { authentication_type = "basic" diff --git a/docs/resources/puppeteer_test.md b/docs/resources/puppeteer_test.md index 69b1241..84fcd3c 100644 --- a/docs/resources/puppeteer_test.md +++ b/docs/resources/puppeteer_test.md @@ -33,6 +33,7 @@ description: |- - `folder_id` (Number) Optional. The Folder under which the Test will be created - `gateway_address_or_host` (String) Host/IP to use for network troubleshooting and monitoring - `insights` (Block Set, Max: 1) Optional. Used for overriding the insights section (see [below for nested schema](#nestedblock--insights)) +- `label` (Block Set) Optional. Label with key, values pair (see [below for nested schema](#nestedblock--label)) - `monitor` (String) The monitor to use for the puppeteer Test. Supported: 'chrome' - `request_settings` (Block Set, Max: 1) Optional. Used for overriding authentication and HTTP request headers (see [below for nested schema](#nestedblock--request_settings)) - `schedule_settings` (Block Set, Max: 1) Optional. Used for overriding the schedule section (see [below for nested schema](#nestedblock--schedule_settings)) @@ -162,6 +163,15 @@ Optional: - `tracepoint_ids` (List of Number) Optional. Tracepoint ids in a list + +### Nested Schema for `label` + +Required: + +- `key` (String) +- `values` (List of String) + + ### Nested Schema for `request_settings`