From 7a3db27ffdc28b6f19db8e5821d2d7ef1b4a783d Mon Sep 17 00:00:00 2001
From: Pedro Rocha Goncalves <47182547+pedro-te@users.noreply.github.com>
Date: Mon, 27 Feb 2023 11:48:40 +0000
Subject: [PATCH] BREAKING CHANGE: labels/groups attachment to tests/agents
updates (#125)
* BREAKING CHANGE: labels/groups attachment to tests/agents updates
Going forward it will no longer be possible to attach a label/group
to a test in any test resource. Test resources obtain the labels
linked to them via the API automatically (computed fields). Labels
are now linked to tests only in the label resource. This diverges
from what the ThousandEyes API allows, but is necessary considering
how terraform works, as it was previously possible to have a test
resource cancel out a label that is being added to it in a label
resource, because the test resource wasn't setting it.
* docs: fix account name description grammar
---
docs/resources/agent_to_agent.md | 57 +++++------
docs/resources/agent_to_server.md | 57 +++++------
docs/resources/bgp.md | 57 +++++------
docs/resources/dns_server.md | 57 +++++------
docs/resources/dns_trace.md | 57 +++++------
docs/resources/dnssec.md | 57 +++++------
docs/resources/ftp_server.md | 57 +++++------
docs/resources/http_server.md | 57 +++++------
docs/resources/label.md | 160 +-----------------------------
docs/resources/page_load.md | 57 +++++------
docs/resources/sip_server.md | 57 +++++------
docs/resources/voice.md | 57 +++++------
docs/resources/web_transaction.md | 57 +++++------
go.mod | 2 +-
go.sum | 4 +-
thousandeyes/resource_label.go | 16 ++-
thousandeyes/schemas.go | 39 +++++---
thousandeyes/util.go | 8 +-
18 files changed, 351 insertions(+), 562 deletions(-)
diff --git a/docs/resources/agent_to_agent.md b/docs/resources/agent_to_agent.md
index b1d0f57..612e374 100644
--- a/docs/resources/agent_to_agent.md
+++ b/docs/resources/agent_to_agent.md
@@ -47,7 +47,6 @@ resource "thousandeyes_agent_to_agent" "example_agent_to_agent_test" {
- `description` (String) A description of the alert rule. Defaults to an empty string.
- `dscp_id` (Number) The DSCP ID.
- `enabled` (Boolean) Enables or disables the test.
-- `groups` (Block Set, Deprecated) The array of label objects. (see [below for nested schema](#nestedblock--groups))
- `mss` (Number) The maximum segment size, in bytes. Value can be from 30 to 1400.
- `mtu_measurements` (Boolean) Measure MTU sizes on the network from agents to the target.
- `network_measurements` (Boolean) Set to 'true' to enable network measurements.
@@ -66,6 +65,7 @@ resource "thousandeyes_agent_to_agent" "example_agent_to_agent_test" {
- `created_by` (String) Created by user.
- `created_date` (String) The date of creation.
- `dscp` (String) The Differentiated Services Code Point (DSCP) label.
+- `groups` (Set of Object) The array of label objects. (see [below for nested schema](#nestedatt--groups))
- `id` (String) The ID of this resource.
- `live_share` (Boolean) Set to 'true' for a test shared with your account group, or to 'false' for a normal test.
- `modified_by` (String) Last modified by this user.
@@ -165,59 +165,52 @@ Optional:
- `network` (String) The name of the autonomous system in which the BGP monitor is found.
-
-### Nested Schema for `groups`
+
+### Nested Schema for `shared_with_accounts`
Required:
-- `group_id` (Number) The unique ID of the label.
-
-Optional:
-
-- `agents` (Block List) Define the ThousandEyes agents to use. (see [below for nested schema](#nestedblock--groups--agents))
-- `name` (String) The name of the label.
-- `tests` (Block List) The list of tests. (see [below for nested schema](#nestedblock--groups--tests))
-- `type` (String) [tests, agents, endpoint_tests, or endpoint_agents] The type of label.
+- `aid` (Number) The account group ID.
Read-Only:
-- `builtin` (Boolean) Shows whether you are using built-in (true) labels or user-created (false) labels. Built-in labels are read-only.
+- `name` (String) Account name.
-
-### Nested Schema for `groups.agents`
-Optional:
-
-- `agent_id` (Number) The unique ThousandEyes agent ID.
-
-
-
-### Nested Schema for `groups.tests`
+
+### Nested Schema for `api_links`
-Optional:
+Read-Only:
-- `test_id` (Number) The unique ID of the test.
+- `href` (String)
+- `rel` (String)
+
+### Nested Schema for `groups`
-
-### Nested Schema for `shared_with_accounts`
+Read-Only:
-Required:
+- `agents` (List of Object) (see [below for nested schema](#nestedobjatt--groups--agents))
+- `builtin` (Boolean)
+- `group_id` (Number)
+- `name` (String)
+- `tests` (List of Object) (see [below for nested schema](#nestedobjatt--groups--tests))
+- `type` (String)
-- `aid` (Number) The account group ID.
+
+### Nested Schema for `groups.agents`
Read-Only:
-- `name` (String) The name of account.
+- `agent_id` (Number)
-
-### Nested Schema for `api_links`
+
+### Nested Schema for `groups.tests`
Read-Only:
-- `href` (String)
-- `rel` (String)
+- `test_id` (Number)
diff --git a/docs/resources/agent_to_server.md b/docs/resources/agent_to_server.md
index 7945bec..1456c1c 100644
--- a/docs/resources/agent_to_server.md
+++ b/docs/resources/agent_to_server.md
@@ -45,7 +45,6 @@ resource "thousandeyes_agent_to_server" "example_agent_to_server_test" {
- `bgp_monitors` (Block List) The array of BGP monitor object IDs. The monitorIDs can be sourced from the /bgp-monitors endpoint. (see [below for nested schema](#nestedblock--bgp_monitors))
- `description` (String) A description of the alert rule. Defaults to an empty string.
- `enabled` (Boolean) Enables or disables the test.
-- `groups` (Block Set, Deprecated) The array of label objects. (see [below for nested schema](#nestedblock--groups))
- `mtu_measurements` (Boolean) Measure MTU sizes on the network from agents to the target.
- `network_measurements` (Boolean) Set to 'true' to enable network measurements.
- `num_path_traces` (Number) The number of path traces.
@@ -61,6 +60,7 @@ resource "thousandeyes_agent_to_server" "example_agent_to_server_test" {
- `api_links` (List of Object) Self links to the endpoint to pull test metadata, and data links to the endpoint for test data. Read-only, and shows rel and href elements. (see [below for nested schema](#nestedatt--api_links))
- `created_by` (String) Created by user.
- `created_date` (String) The date of creation.
+- `groups` (Set of Object) The array of label objects. (see [below for nested schema](#nestedatt--groups))
- `id` (String) The ID of this resource.
- `live_share` (Boolean) Set to 'true' for a test shared with your account group, or to 'false' for a normal test.
- `modified_by` (String) Last modified by this user.
@@ -160,59 +160,52 @@ Optional:
- `network` (String) The name of the autonomous system in which the BGP monitor is found.
-
-### Nested Schema for `groups`
+
+### Nested Schema for `shared_with_accounts`
Required:
-- `group_id` (Number) The unique ID of the label.
-
-Optional:
-
-- `agents` (Block List) Define the ThousandEyes agents to use. (see [below for nested schema](#nestedblock--groups--agents))
-- `name` (String) The name of the label.
-- `tests` (Block List) The list of tests. (see [below for nested schema](#nestedblock--groups--tests))
-- `type` (String) [tests, agents, endpoint_tests, or endpoint_agents] The type of label.
+- `aid` (Number) The account group ID.
Read-Only:
-- `builtin` (Boolean) Shows whether you are using built-in (true) labels or user-created (false) labels. Built-in labels are read-only.
+- `name` (String) Account name.
-
-### Nested Schema for `groups.agents`
-Optional:
-
-- `agent_id` (Number) The unique ThousandEyes agent ID.
-
-
-
-### Nested Schema for `groups.tests`
+
+### Nested Schema for `api_links`
-Optional:
+Read-Only:
-- `test_id` (Number) The unique ID of the test.
+- `href` (String)
+- `rel` (String)
+
+### Nested Schema for `groups`
-
-### Nested Schema for `shared_with_accounts`
+Read-Only:
-Required:
+- `agents` (List of Object) (see [below for nested schema](#nestedobjatt--groups--agents))
+- `builtin` (Boolean)
+- `group_id` (Number)
+- `name` (String)
+- `tests` (List of Object) (see [below for nested schema](#nestedobjatt--groups--tests))
+- `type` (String)
-- `aid` (Number) The account group ID.
+
+### Nested Schema for `groups.agents`
Read-Only:
-- `name` (String) The name of account.
+- `agent_id` (Number)
-
-### Nested Schema for `api_links`
+
+### Nested Schema for `groups.tests`
Read-Only:
-- `href` (String)
-- `rel` (String)
+- `test_id` (Number)
diff --git a/docs/resources/bgp.md b/docs/resources/bgp.md
index e04d506..2ee9c54 100644
--- a/docs/resources/bgp.md
+++ b/docs/resources/bgp.md
@@ -35,7 +35,6 @@ resource "thousandeyes_bgp" "example_bgp_test" {
- `bgp_monitors` (Block List) The array of BGP monitor object IDs. The monitorIDs can be sourced from the /bgp-monitors endpoint. (see [below for nested schema](#nestedblock--bgp_monitors))
- `description` (String) A description of the alert rule. Defaults to an empty string.
- `enabled` (Boolean) Enables or disables the test.
-- `groups` (Block Set, Deprecated) The array of label objects. (see [below for nested schema](#nestedblock--groups))
- `include_covered_prefixes` (Boolean) Include queries for subprefixes detected under this prefix.
- `shared_with_accounts` (Block List) [“serverName”: “fqdn of server”] The array of DNS Server objects. (see [below for nested schema](#nestedblock--shared_with_accounts))
- `use_public_bgp` (Boolean) Enable to automatically add all available Public BGP Monitors to the test.
@@ -45,6 +44,7 @@ resource "thousandeyes_bgp" "example_bgp_test" {
- `api_links` (List of Object) Self links to the endpoint to pull test metadata, and data links to the endpoint for test data. Read-only, and shows rel and href elements. (see [below for nested schema](#nestedatt--api_links))
- `created_by` (String) Created by user.
- `created_date` (String) The date of creation.
+- `groups` (Set of Object) The array of label objects. (see [below for nested schema](#nestedatt--groups))
- `id` (String) The ID of this resource.
- `live_share` (Boolean) Set to 'true' for a test shared with your account group, or to 'false' for a normal test.
- `modified_by` (String) Last modified by this user.
@@ -76,59 +76,52 @@ Optional:
- `network` (String) The name of the autonomous system in which the BGP monitor is found.
-
-### Nested Schema for `groups`
+
+### Nested Schema for `shared_with_accounts`
Required:
-- `group_id` (Number) The unique ID of the label.
-
-Optional:
-
-- `agents` (Block List) Define the ThousandEyes agents to use. (see [below for nested schema](#nestedblock--groups--agents))
-- `name` (String) The name of the label.
-- `tests` (Block List) The list of tests. (see [below for nested schema](#nestedblock--groups--tests))
-- `type` (String) [tests, agents, endpoint_tests, or endpoint_agents] The type of label.
+- `aid` (Number) The account group ID.
Read-Only:
-- `builtin` (Boolean) Shows whether you are using built-in (true) labels or user-created (false) labels. Built-in labels are read-only.
-
-
-### Nested Schema for `groups.agents`
-
-Optional:
-
-- `agent_id` (Number) The unique ThousandEyes agent ID.
+- `name` (String) Account name.
-
-### Nested Schema for `groups.tests`
+
+### Nested Schema for `api_links`
-Optional:
+Read-Only:
-- `test_id` (Number) The unique ID of the test.
+- `href` (String)
+- `rel` (String)
+
+### Nested Schema for `groups`
-
-### Nested Schema for `shared_with_accounts`
+Read-Only:
-Required:
+- `agents` (List of Object) (see [below for nested schema](#nestedobjatt--groups--agents))
+- `builtin` (Boolean)
+- `group_id` (Number)
+- `name` (String)
+- `tests` (List of Object) (see [below for nested schema](#nestedobjatt--groups--tests))
+- `type` (String)
-- `aid` (Number) The account group ID.
+
+### Nested Schema for `groups.agents`
Read-Only:
-- `name` (String) The name of account.
+- `agent_id` (Number)
-
-### Nested Schema for `api_links`
+
+### Nested Schema for `groups.tests`
Read-Only:
-- `href` (String)
-- `rel` (String)
+- `test_id` (Number)
diff --git a/docs/resources/dns_server.md b/docs/resources/dns_server.md
index 39a5752..d1b2dea 100644
--- a/docs/resources/dns_server.md
+++ b/docs/resources/dns_server.md
@@ -49,7 +49,6 @@ resource "thousandeyes_dns_server" "example_dns_server_test" {
- `description` (String) A description of the alert rule. Defaults to an empty string.
- `dns_transport_protocol` (String) [UDP or TCP] The DNS transport protocol used for DNS requests. Defaults to UDP.
- `enabled` (Boolean) Enables or disables the test.
-- `groups` (Block Set, Deprecated) The array of label objects. (see [below for nested schema](#nestedblock--groups))
- `mtu_measurements` (Boolean) Measure MTU sizes on the network from agents to the target.
- `network_measurements` (Boolean) Set to 'true' to enable network measurements.
- `num_path_traces` (Number) The number of path traces.
@@ -65,6 +64,7 @@ resource "thousandeyes_dns_server" "example_dns_server_test" {
- `api_links` (List of Object) Self links to the endpoint to pull test metadata, and data links to the endpoint for test data. Read-only, and shows rel and href elements. (see [below for nested schema](#nestedatt--api_links))
- `created_by` (String) Created by user.
- `created_date` (String) The date of creation.
+- `groups` (Set of Object) The array of label objects. (see [below for nested schema](#nestedatt--groups))
- `id` (String) The ID of this resource.
- `live_share` (Boolean) Set to 'true' for a test shared with your account group, or to 'false' for a normal test.
- `modified_by` (String) Last modified by this user.
@@ -173,59 +173,52 @@ Optional:
- `network` (String) The name of the autonomous system in which the BGP monitor is found.
-
-### Nested Schema for `groups`
+
+### Nested Schema for `shared_with_accounts`
Required:
-- `group_id` (Number) The unique ID of the label.
-
-Optional:
-
-- `agents` (Block List) Define the ThousandEyes agents to use. (see [below for nested schema](#nestedblock--groups--agents))
-- `name` (String) The name of the label.
-- `tests` (Block List) The list of tests. (see [below for nested schema](#nestedblock--groups--tests))
-- `type` (String) [tests, agents, endpoint_tests, or endpoint_agents] The type of label.
+- `aid` (Number) The account group ID.
Read-Only:
-- `builtin` (Boolean) Shows whether you are using built-in (true) labels or user-created (false) labels. Built-in labels are read-only.
+- `name` (String) Account name.
-
-### Nested Schema for `groups.agents`
-Optional:
-
-- `agent_id` (Number) The unique ThousandEyes agent ID.
-
-
-
-### Nested Schema for `groups.tests`
+
+### Nested Schema for `api_links`
-Optional:
+Read-Only:
-- `test_id` (Number) The unique ID of the test.
+- `href` (String)
+- `rel` (String)
+
+### Nested Schema for `groups`
-
-### Nested Schema for `shared_with_accounts`
+Read-Only:
-Required:
+- `agents` (List of Object) (see [below for nested schema](#nestedobjatt--groups--agents))
+- `builtin` (Boolean)
+- `group_id` (Number)
+- `name` (String)
+- `tests` (List of Object) (see [below for nested schema](#nestedobjatt--groups--tests))
+- `type` (String)
-- `aid` (Number) The account group ID.
+
+### Nested Schema for `groups.agents`
Read-Only:
-- `name` (String) The name of account.
+- `agent_id` (Number)
-
-### Nested Schema for `api_links`
+
+### Nested Schema for `groups.tests`
Read-Only:
-- `href` (String)
-- `rel` (String)
+- `test_id` (Number)
diff --git a/docs/resources/dns_trace.md b/docs/resources/dns_trace.md
index 794f730..f9239be 100644
--- a/docs/resources/dns_trace.md
+++ b/docs/resources/dns_trace.md
@@ -27,7 +27,6 @@ This resource provides users with the ability to create a DNS trace test. This t
- `description` (String) A description of the alert rule. Defaults to an empty string.
- `dns_transport_protocol` (String) [UDP or TCP] The DNS transport protocol used for DNS requests. Defaults to UDP.
- `enabled` (Boolean) Enables or disables the test.
-- `groups` (Block Set, Deprecated) The array of label objects. (see [below for nested schema](#nestedblock--groups))
- `shared_with_accounts` (Block List) [“serverName”: “fqdn of server”] The array of DNS Server objects. (see [below for nested schema](#nestedblock--shared_with_accounts))
### Read-Only
@@ -35,6 +34,7 @@ This resource provides users with the ability to create a DNS trace test. This t
- `api_links` (List of Object) Self links to the endpoint to pull test metadata, and data links to the endpoint for test data. Read-only, and shows rel and href elements. (see [below for nested schema](#nestedatt--api_links))
- `created_by` (String) Created by user.
- `created_date` (String) The date of creation.
+- `groups` (Set of Object) The array of label objects. (see [below for nested schema](#nestedatt--groups))
- `id` (String) The ID of this resource.
- `live_share` (Boolean) Set to 'true' for a test shared with your account group, or to 'false' for a normal test.
- `modified_by` (String) Last modified by this user.
@@ -119,59 +119,52 @@ Optional:
- `rule_id` (Number) The unique ID of the alert rule.
-
-### Nested Schema for `groups`
+
+### Nested Schema for `shared_with_accounts`
Required:
-- `group_id` (Number) The unique ID of the label.
-
-Optional:
-
-- `agents` (Block List) Define the ThousandEyes agents to use. (see [below for nested schema](#nestedblock--groups--agents))
-- `name` (String) The name of the label.
-- `tests` (Block List) The list of tests. (see [below for nested schema](#nestedblock--groups--tests))
-- `type` (String) [tests, agents, endpoint_tests, or endpoint_agents] The type of label.
+- `aid` (Number) The account group ID.
Read-Only:
-- `builtin` (Boolean) Shows whether you are using built-in (true) labels or user-created (false) labels. Built-in labels are read-only.
+- `name` (String) Account name.
-
-### Nested Schema for `groups.agents`
-Optional:
-
-- `agent_id` (Number) The unique ThousandEyes agent ID.
-
-
-
-### Nested Schema for `groups.tests`
+
+### Nested Schema for `api_links`
-Optional:
+Read-Only:
-- `test_id` (Number) The unique ID of the test.
+- `href` (String)
+- `rel` (String)
+
+### Nested Schema for `groups`
-
-### Nested Schema for `shared_with_accounts`
+Read-Only:
-Required:
+- `agents` (List of Object) (see [below for nested schema](#nestedobjatt--groups--agents))
+- `builtin` (Boolean)
+- `group_id` (Number)
+- `name` (String)
+- `tests` (List of Object) (see [below for nested schema](#nestedobjatt--groups--tests))
+- `type` (String)
-- `aid` (Number) The account group ID.
+
+### Nested Schema for `groups.agents`
Read-Only:
-- `name` (String) The name of account.
+- `agent_id` (Number)
-
-### Nested Schema for `api_links`
+
+### Nested Schema for `groups.tests`
Read-Only:
-- `href` (String)
-- `rel` (String)
+- `test_id` (Number)
diff --git a/docs/resources/dnssec.md b/docs/resources/dnssec.md
index 384315e..57e8de1 100644
--- a/docs/resources/dnssec.md
+++ b/docs/resources/dnssec.md
@@ -26,7 +26,6 @@ This resource allows you to create a DNSSEC test. This test type verifies the di
- `alerts_enabled` (Boolean) Set to 'true' to enable alerts, or 'false' to disable alerts. The default value is 'true'.
- `description` (String) A description of the alert rule. Defaults to an empty string.
- `enabled` (Boolean) Enables or disables the test.
-- `groups` (Block Set, Deprecated) The array of label objects. (see [below for nested schema](#nestedblock--groups))
- `shared_with_accounts` (Block List) [“serverName”: “fqdn of server”] The array of DNS Server objects. (see [below for nested schema](#nestedblock--shared_with_accounts))
### Read-Only
@@ -34,6 +33,7 @@ This resource allows you to create a DNSSEC test. This test type verifies the di
- `api_links` (List of Object) Self links to the endpoint to pull test metadata, and data links to the endpoint for test data. Read-only, and shows rel and href elements. (see [below for nested schema](#nestedatt--api_links))
- `created_by` (String) Created by user.
- `created_date` (String) The date of creation.
+- `groups` (Set of Object) The array of label objects. (see [below for nested schema](#nestedatt--groups))
- `id` (String) The ID of this resource.
- `live_share` (Boolean) Set to 'true' for a test shared with your account group, or to 'false' for a normal test.
- `modified_by` (String) Last modified by this user.
@@ -118,59 +118,52 @@ Optional:
- `rule_id` (Number) The unique ID of the alert rule.
-
-### Nested Schema for `groups`
+
+### Nested Schema for `shared_with_accounts`
Required:
-- `group_id` (Number) The unique ID of the label.
-
-Optional:
-
-- `agents` (Block List) Define the ThousandEyes agents to use. (see [below for nested schema](#nestedblock--groups--agents))
-- `name` (String) The name of the label.
-- `tests` (Block List) The list of tests. (see [below for nested schema](#nestedblock--groups--tests))
-- `type` (String) [tests, agents, endpoint_tests, or endpoint_agents] The type of label.
+- `aid` (Number) The account group ID.
Read-Only:
-- `builtin` (Boolean) Shows whether you are using built-in (true) labels or user-created (false) labels. Built-in labels are read-only.
+- `name` (String) Account name.
-
-### Nested Schema for `groups.agents`
-Optional:
-
-- `agent_id` (Number) The unique ThousandEyes agent ID.
-
-
-
-### Nested Schema for `groups.tests`
+
+### Nested Schema for `api_links`
-Optional:
+Read-Only:
-- `test_id` (Number) The unique ID of the test.
+- `href` (String)
+- `rel` (String)
+
+### Nested Schema for `groups`
-
-### Nested Schema for `shared_with_accounts`
+Read-Only:
-Required:
+- `agents` (List of Object) (see [below for nested schema](#nestedobjatt--groups--agents))
+- `builtin` (Boolean)
+- `group_id` (Number)
+- `name` (String)
+- `tests` (List of Object) (see [below for nested schema](#nestedobjatt--groups--tests))
+- `type` (String)
-- `aid` (Number) The account group ID.
+
+### Nested Schema for `groups.agents`
Read-Only:
-- `name` (String) The name of account.
+- `agent_id` (Number)
-
-### Nested Schema for `api_links`
+
+### Nested Schema for `groups.tests`
Read-Only:
-- `href` (String)
-- `rel` (String)
+- `test_id` (Number)
diff --git a/docs/resources/ftp_server.md b/docs/resources/ftp_server.md
index d0d990d..776331d 100644
--- a/docs/resources/ftp_server.md
+++ b/docs/resources/ftp_server.md
@@ -33,7 +33,6 @@ This resource allows you to create an FTP server test. This test type verifies t
- `enabled` (Boolean) Enables or disables the test.
- `ftp_target_time` (Number) The target time for operation completion. Specified in milliseconds.
- `ftp_time_limit` (Number) Set the time limit for the test (in seconds). FTP tests default to 10s.
-- `groups` (Block Set, Deprecated) The array of label objects. (see [below for nested schema](#nestedblock--groups))
- `mtu_measurements` (Boolean) Measure MTU sizes on the network from agents to the target.
- `network_measurements` (Boolean) Set to 'true' to enable network measurements.
- `num_path_traces` (Number) The number of path traces.
@@ -49,6 +48,7 @@ This resource allows you to create an FTP server test. This test type verifies t
- `api_links` (List of Object) Self links to the endpoint to pull test metadata, and data links to the endpoint for test data. Read-only, and shows rel and href elements. (see [below for nested schema](#nestedatt--api_links))
- `created_by` (String) Created by user.
- `created_date` (String) The date of creation.
+- `groups` (Set of Object) The array of label objects. (see [below for nested schema](#nestedatt--groups))
- `id` (String) The ID of this resource.
- `live_share` (Boolean) Set to 'true' for a test shared with your account group, or to 'false' for a normal test.
- `modified_by` (String) Last modified by this user.
@@ -133,59 +133,52 @@ Optional:
- `rule_id` (Number) The unique ID of the alert rule.
-
-### Nested Schema for `groups`
+
+### Nested Schema for `shared_with_accounts`
Required:
-- `group_id` (Number) The unique ID of the label.
-
-Optional:
-
-- `agents` (Block List) Define the ThousandEyes agents to use. (see [below for nested schema](#nestedblock--groups--agents))
-- `name` (String) The name of the label.
-- `tests` (Block List) The list of tests. (see [below for nested schema](#nestedblock--groups--tests))
-- `type` (String) [tests, agents, endpoint_tests, or endpoint_agents] The type of label.
+- `aid` (Number) The account group ID.
Read-Only:
-- `builtin` (Boolean) Shows whether you are using built-in (true) labels or user-created (false) labels. Built-in labels are read-only.
+- `name` (String) Account name.
-
-### Nested Schema for `groups.agents`
-Optional:
-
-- `agent_id` (Number) The unique ThousandEyes agent ID.
-
-
-
-### Nested Schema for `groups.tests`
+
+### Nested Schema for `api_links`
-Optional:
+Read-Only:
-- `test_id` (Number) The unique ID of the test.
+- `href` (String)
+- `rel` (String)
+
+### Nested Schema for `groups`
-
-### Nested Schema for `shared_with_accounts`
+Read-Only:
-Required:
+- `agents` (List of Object) (see [below for nested schema](#nestedobjatt--groups--agents))
+- `builtin` (Boolean)
+- `group_id` (Number)
+- `name` (String)
+- `tests` (List of Object) (see [below for nested schema](#nestedobjatt--groups--tests))
+- `type` (String)
-- `aid` (Number) The account group ID.
+
+### Nested Schema for `groups.agents`
Read-Only:
-- `name` (String) The name of account.
+- `agent_id` (Number)
-
-### Nested Schema for `api_links`
+
+### Nested Schema for `groups.tests`
Read-Only:
-- `href` (String)
-- `rel` (String)
+- `test_id` (Number)
diff --git a/docs/resources/http_server.md b/docs/resources/http_server.md
index b477457..06cfec8 100644
--- a/docs/resources/http_server.md
+++ b/docs/resources/http_server.md
@@ -51,7 +51,6 @@ resource "thousandeyes_http_server" "example_http_server_test" {
- `download_limit` (Number) Specify the maximum number of bytes to download from the target object.
- `enabled` (Boolean) Enables or disables the test.
- `follow_redirects` (Boolean) Follow HTTP/301 or HTTP/302 redirect directives. Defaults to 'true'.
-- `groups` (Block Set, Deprecated) The array of label objects. (see [below for nested schema](#nestedblock--groups))
- `headers` (List of String) ["header: value", "header2: value"] The array of header strings.
- `http_target_time` (Number) The target time for HTTP server completion, specified in milliseconds.
- `http_time_limit` (Number) The target time for HTTP server limits, specified in seconds.
@@ -76,6 +75,7 @@ resource "thousandeyes_http_server" "example_http_server_test" {
- `api_links` (List of Object) Self links to the endpoint to pull test metadata, and data links to the endpoint for test data. Read-only, and shows rel and href elements. (see [below for nested schema](#nestedatt--api_links))
- `created_by` (String) Created by user.
- `created_date` (String) The date of creation.
+- `groups` (Set of Object) The array of label objects. (see [below for nested schema](#nestedatt--groups))
- `id` (String) The ID of this resource.
- `live_share` (Boolean) Set to 'true' for a test shared with your account group, or to 'false' for a normal test.
- `modified_by` (String) Last modified by this user.
@@ -176,59 +176,52 @@ Optional:
- `network` (String) The name of the autonomous system in which the BGP monitor is found.
-
-### Nested Schema for `groups`
+
+### Nested Schema for `shared_with_accounts`
Required:
-- `group_id` (Number) The unique ID of the label.
-
-Optional:
-
-- `agents` (Block List) Define the ThousandEyes agents to use. (see [below for nested schema](#nestedblock--groups--agents))
-- `name` (String) The name of the label.
-- `tests` (Block List) The list of tests. (see [below for nested schema](#nestedblock--groups--tests))
-- `type` (String) [tests, agents, endpoint_tests, or endpoint_agents] The type of label.
+- `aid` (Number) The account group ID.
Read-Only:
-- `builtin` (Boolean) Shows whether you are using built-in (true) labels or user-created (false) labels. Built-in labels are read-only.
+- `name` (String) Account name.
-
-### Nested Schema for `groups.agents`
-Optional:
-
-- `agent_id` (Number) The unique ThousandEyes agent ID.
-
-
-
-### Nested Schema for `groups.tests`
+
+### Nested Schema for `api_links`
-Optional:
+Read-Only:
-- `test_id` (Number) The unique ID of the test.
+- `href` (String)
+- `rel` (String)
+
+### Nested Schema for `groups`
-
-### Nested Schema for `shared_with_accounts`
+Read-Only:
-Required:
+- `agents` (List of Object) (see [below for nested schema](#nestedobjatt--groups--agents))
+- `builtin` (Boolean)
+- `group_id` (Number)
+- `name` (String)
+- `tests` (List of Object) (see [below for nested schema](#nestedobjatt--groups--tests))
+- `type` (String)
-- `aid` (Number) The account group ID.
+
+### Nested Schema for `groups.agents`
Read-Only:
-- `name` (String) The name of account.
+- `agent_id` (Number)
-
-### Nested Schema for `api_links`
+
+### Nested Schema for `groups.tests`
Read-Only:
-- `href` (String)
-- `rel` (String)
+- `test_id` (Number)
diff --git a/docs/resources/label.md b/docs/resources/label.md
index 6bffdf3..d9a14b3 100644
--- a/docs/resources/label.md
+++ b/docs/resources/label.md
@@ -20,8 +20,8 @@ This resource allows you to create labels for ThousandEyes agents and test group
### Optional
-- `agents` (Block List) The list of agents to use. (see [below for nested schema](#nestedblock--agents))
-- `tests` (Block List) The list of included tests. (see [below for nested schema](#nestedblock--tests))
+- `agents` (Block Set) The list of agents to use. (see [below for nested schema](#nestedblock--agents))
+- `tests` (Block Set) The list of included tests. (see [below for nested schema](#nestedblock--tests))
### Read-Only
@@ -32,7 +32,7 @@ This resource allows you to create labels for ThousandEyes agents and test group
### Nested Schema for `agents`
-Optional:
+Required:
- `agent_id` (Number) The list of unique agent IDs that the label is applied to.
@@ -42,158 +42,6 @@ Optional:
Required:
-- `agents` (Block Set, Min: 1) The list of ThousandEyes agents to use. (see [below for nested schema](#nestedblock--tests--agents))
-- `test_name` (String) The name of the test.
-
-Optional:
-
-- `alert_rules` (Block Set) Gets the ruleId from the /alert-rules endpoint. If alertsEnabled is set to 'true' and alertRules is not included in a creation/update query, the applicable defaults will be used. (see [below for nested schema](#nestedblock--tests--alert_rules))
-- `alerts_enabled` (Boolean) Set to 'true' to enable alerts, or 'false' to disable alerts. The default value is 'true'.
-- `description` (String) A description of the alert rule. Defaults to an empty string.
-- `enabled` (Boolean) Enables or disables the test.
-- `groups` (Block Set, Deprecated) The array of label objects. (see [below for nested schema](#nestedblock--tests--groups))
-- `shared_with_accounts` (Block List) [“serverName”: “fqdn of server”] The array of DNS Server objects. (see [below for nested schema](#nestedblock--tests--shared_with_accounts))
-
-Read-Only:
-
-- `api_links` (List of Object) Self links to the endpoint to pull test metadata, and data links to the endpoint for test data. Read-only, and shows rel and href elements. (see [below for nested schema](#nestedatt--tests--api_links))
-- `created_by` (String) Created by user.
-- `created_date` (String) The date of creation.
-- `modified_by` (String) Last modified by this user.
-- `modified_date` (String) The date the test was last modified. Shown in UTC.
-- `saved_event` (Boolean) Set to 'true' for a saved event, or to 'false' for a normal test.
-- `test_id` (Number) The unique ID of the test.
-- `type` (String) The type of test.
-
-
-### Nested Schema for `tests.agents`
-
-Optional:
-
-- `agent_id` (Number) The unique ID for the ThousandEyes agent.
-- `agent_name` (String) The name of the agent.
-- `agent_state` (String) Defines whether the agent's status is online, offline, or disabled.
-- `cluster_members` (Block List) Detailed information about each cluster member, shown as an array. This field is not shown for Enterprise Agents in standalone mode, or for Cloud Agents. (see [below for nested schema](#nestedblock--tests--agents--cluster_members))
-- `country_id` (String) The two-digit ISO country code of the agent.
-- `created_date` (String) The date the agent was created. Expressed in UTC (yyyy-MM-dd hh:mm:ss).
-- `enabled` (Boolean) Shows whether the agent is enabled or disabled.
-- `error_details` (Block List) If one or more errors present in the agent, the error details are shown for each as an array. (see [below for nested schema](#nestedblock--tests--agents--error_details))
-- `groups` (Block Set) An array of label objects. (see [below for nested schema](#nestedblock--tests--agents--groups))
-- `hostname` (String) Fully qualified domain name of the agent.
-- `ip_addresses` (List of String) An array of the ipAddress entries.
-- `ipv6_policy` (String) [FORCE_IPV4, PREFER_IPV6 or FORCE_IPV6] The IP version policy.
-- `keep_browser_cache` (Boolean) Defines whether the browser cache should be kept. Either 1 for enabled or 0 for disabled.
-- `last_seen` (String) The last time the agent connected with ThousandEyes. Shown in UTC (yyyy-MM-dd hh:mm:ss).
-- `location` (String) The location of the agent.
-- `network` (String) The name of the autonomous system in which the agent is found.
-- `prefix` (String) The network prefix, expressed in CIDR format.
-- `target_for_tests` (String) The target IP address or domain name representing the test destination when the agent is acting as a test target in an agent-to-agent test.
-- `utilization` (Number) Shows the overall utilization percentage.
-- `verify_ssl_certificate` (Boolean) Shows whether the SSL certificate needs to be verified. 1 for enabled and 0 for disabled.
-
-Read-Only:
-
-- `agent_type` (String) The type of ThousandEyes agent. Default value is enterprise.
-
-
-### Nested Schema for `tests.agents.cluster_members`
-
-Optional:
-
-- `agent_state` (String) Defines whether the agent's status is online, offline, or disabled.
-- `ip_addresses` (List of String) The array of ipAddress entries.
-- `last_seen` (String) The last time the agent connected with ThousandEyes. Uses UTC (yyyy-MM-dd hh:mm:ss).
-- `member_id` (Number) The unique ID of the cluster member.
-- `name` (String) The name of the cluster member.
-- `network` (String) The name of the autonomous system in which the Enterprise Agent is found (Enterprise Agents only).
-- `prefix` (String) The network prefix, in CIDR format (Enterprise Agents only).
-- `public_ip_addresses` (List of String) The array of public ipAddress entries.
-- `target_for_tests` (String) The target IP address or domain name. Represents the test's destination when the agent is acting as a test target in an agent-to-agent test.
-- `utilization` (Number) Shows the overall utilization percentage of a cluster member.
-
-
-
-### Nested Schema for `tests.agents.error_details`
-
-Optional:
-
-- `code` (String) [AGENT_VERSION_OUTDATED, APPLIANCE_VERSION_OUTDATED, BROWSERBOT_VERSION_OUTDATED, CLOCK_OFFSET, NAT_TRAVERSAL_ERROR, OS_END_OF_INSTALLATION_SUPPORT, OS_END_OF_SUPPORT, or OS_END_OF_LIFE] The error code.
-- `description` (String) A detailed explanation of the error code.
-
-
-
-### Nested Schema for `tests.agents.groups`
-
-Optional:
-
-- `builtin` (Boolean) Shows whether you are using built-in (1) labels or user-created (2) labels. Built-in labels are read-only.
-- `group_id` (Number) The unique ID of the label. This number is negative for built-in labels. Query the /groups/{id} endpoint to see a list of agents/tests with this label.
-- `name` (String) The name of the label.
-- `type` (String) [tests, agents, endpoint_tests or endpoint_agents] The type of label.
-
-
-
-
-### Nested Schema for `tests.alert_rules`
-
-Optional:
-
-- `rule_id` (Number) The unique ID of the alert rule.
-
-
-
-### Nested Schema for `tests.groups`
-
-Required:
-
-- `group_id` (Number) The unique ID of the label.
-
-Optional:
-
-- `agents` (Block List) Define the ThousandEyes agents to use. (see [below for nested schema](#nestedblock--tests--groups--agents))
-- `name` (String) The name of the label.
-- `tests` (Block List) The list of tests. (see [below for nested schema](#nestedblock--tests--groups--tests))
-- `type` (String) [tests, agents, endpoint_tests, or endpoint_agents] The type of label.
-
-Read-Only:
-
-- `builtin` (Boolean) Shows whether you are using built-in (true) labels or user-created (false) labels. Built-in labels are read-only.
-
-
-### Nested Schema for `tests.groups.agents`
-
-Optional:
-
-- `agent_id` (Number) The unique ThousandEyes agent ID.
-
-
-
-### Nested Schema for `tests.groups.tests`
-
-Optional:
-
-- `test_id` (Number) The unique ID of the test.
-
-
-
-
-### Nested Schema for `tests.shared_with_accounts`
-
-Required:
-
-- `aid` (Number) The account group ID.
-
-Read-Only:
-
-- `name` (String) The name of account.
-
-
-
-### Nested Schema for `tests.api_links`
-
-Read-Only:
-
-- `href` (String)
-- `rel` (String)
+- `test_id` (Number) The list of unique test IDs.
diff --git a/docs/resources/page_load.md b/docs/resources/page_load.md
index 80646ae..8df2361 100644
--- a/docs/resources/page_load.md
+++ b/docs/resources/page_load.md
@@ -49,7 +49,6 @@ resource "thousandeyes_page_load" "test" {
- `description` (String) A description of the alert rule. Defaults to an empty string.
- `enabled` (Boolean) Enables or disables the test.
- `follow_redirects` (Boolean) Follow HTTP/301 or HTTP/302 redirect directives. Defaults to 'true'.
-- `groups` (Block Set, Deprecated) The array of label objects. (see [below for nested schema](#nestedblock--groups))
- `http_target_time` (Number) The target time for HTTP server completion, specified in milliseconds.
- `http_time_limit` (Number) The target time for HTTP server limits, specified in seconds.
- `http_version` (Number) Set to 2 for the default HTTP version (prefer HTTP/2), or 1 for HTTP/1.1 only.
@@ -77,6 +76,7 @@ resource "thousandeyes_page_load" "test" {
- `api_links` (List of Object) Self links to the endpoint to pull test metadata, and data links to the endpoint for test data. Read-only, and shows rel and href elements. (see [below for nested schema](#nestedatt--api_links))
- `created_by` (String) Created by user.
- `created_date` (String) The date of creation.
+- `groups` (Set of Object) The array of label objects. (see [below for nested schema](#nestedatt--groups))
- `id` (String) The ID of this resource.
- `live_share` (Boolean) Set to 'true' for a test shared with your account group, or to 'false' for a normal test.
- `modified_by` (String) Last modified by this user.
@@ -177,59 +177,52 @@ Optional:
- `network` (String) The name of the autonomous system in which the BGP monitor is found.
-
-### Nested Schema for `groups`
+
+### Nested Schema for `shared_with_accounts`
Required:
-- `group_id` (Number) The unique ID of the label.
-
-Optional:
-
-- `agents` (Block List) Define the ThousandEyes agents to use. (see [below for nested schema](#nestedblock--groups--agents))
-- `name` (String) The name of the label.
-- `tests` (Block List) The list of tests. (see [below for nested schema](#nestedblock--groups--tests))
-- `type` (String) [tests, agents, endpoint_tests, or endpoint_agents] The type of label.
+- `aid` (Number) The account group ID.
Read-Only:
-- `builtin` (Boolean) Shows whether you are using built-in (true) labels or user-created (false) labels. Built-in labels are read-only.
+- `name` (String) Account name.
-
-### Nested Schema for `groups.agents`
-Optional:
-
-- `agent_id` (Number) The unique ThousandEyes agent ID.
-
-
-
-### Nested Schema for `groups.tests`
+
+### Nested Schema for `api_links`
-Optional:
+Read-Only:
-- `test_id` (Number) The unique ID of the test.
+- `href` (String)
+- `rel` (String)
+
+### Nested Schema for `groups`
-
-### Nested Schema for `shared_with_accounts`
+Read-Only:
-Required:
+- `agents` (List of Object) (see [below for nested schema](#nestedobjatt--groups--agents))
+- `builtin` (Boolean)
+- `group_id` (Number)
+- `name` (String)
+- `tests` (List of Object) (see [below for nested schema](#nestedobjatt--groups--tests))
+- `type` (String)
-- `aid` (Number) The account group ID.
+
+### Nested Schema for `groups.agents`
Read-Only:
-- `name` (String) The name of account.
+- `agent_id` (Number)
-
-### Nested Schema for `api_links`
+
+### Nested Schema for `groups.tests`
Read-Only:
-- `href` (String)
-- `rel` (String)
+- `test_id` (Number)
diff --git a/docs/resources/sip_server.md b/docs/resources/sip_server.md
index da73c2b..06c2700 100644
--- a/docs/resources/sip_server.md
+++ b/docs/resources/sip_server.md
@@ -47,7 +47,6 @@ resource "thousandeyes_sip_server" "example_sip_server_test" {
- `bgp_measurements` (Boolean) Enable BGP measurements. Set to true for enabled, false for disabled.
- `description` (String) A description of the alert rule. Defaults to an empty string.
- `enabled` (Boolean) Enables or disables the test.
-- `groups` (Block Set, Deprecated) The array of label objects. (see [below for nested schema](#nestedblock--groups))
- `mtu_measurements` (Boolean) Measure MTU sizes on the network from agents to the target.
- `network_measurements` (Boolean) Set to 'true' to enable network measurements.
- `num_path_traces` (Number) The number of path traces.
@@ -65,6 +64,7 @@ resource "thousandeyes_sip_server" "example_sip_server_test" {
- `api_links` (List of Object) Self links to the endpoint to pull test metadata, and data links to the endpoint for test data. Read-only, and shows rel and href elements. (see [below for nested schema](#nestedatt--api_links))
- `created_by` (String) Created by user.
- `created_date` (String) The date of creation.
+- `groups` (Set of Object) The array of label objects. (see [below for nested schema](#nestedatt--groups))
- `id` (String) The ID of this resource.
- `live_share` (Boolean) Set to 'true' for a test shared with your account group, or to 'false' for a normal test.
- `modified_by` (String) Last modified by this user.
@@ -166,59 +166,52 @@ Optional:
- `rule_id` (Number) The unique ID of the alert rule.
-
-### Nested Schema for `groups`
+
+### Nested Schema for `shared_with_accounts`
Required:
-- `group_id` (Number) The unique ID of the label.
-
-Optional:
-
-- `agents` (Block List) Define the ThousandEyes agents to use. (see [below for nested schema](#nestedblock--groups--agents))
-- `name` (String) The name of the label.
-- `tests` (Block List) The list of tests. (see [below for nested schema](#nestedblock--groups--tests))
-- `type` (String) [tests, agents, endpoint_tests, or endpoint_agents] The type of label.
+- `aid` (Number) The account group ID.
Read-Only:
-- `builtin` (Boolean) Shows whether you are using built-in (true) labels or user-created (false) labels. Built-in labels are read-only.
+- `name` (String) Account name.
-
-### Nested Schema for `groups.agents`
-Optional:
-
-- `agent_id` (Number) The unique ThousandEyes agent ID.
-
-
-
-### Nested Schema for `groups.tests`
+
+### Nested Schema for `api_links`
-Optional:
+Read-Only:
-- `test_id` (Number) The unique ID of the test.
+- `href` (String)
+- `rel` (String)
+
+### Nested Schema for `groups`
-
-### Nested Schema for `shared_with_accounts`
+Read-Only:
-Required:
+- `agents` (List of Object) (see [below for nested schema](#nestedobjatt--groups--agents))
+- `builtin` (Boolean)
+- `group_id` (Number)
+- `name` (String)
+- `tests` (List of Object) (see [below for nested schema](#nestedobjatt--groups--tests))
+- `type` (String)
-- `aid` (Number) The account group ID.
+
+### Nested Schema for `groups.agents`
Read-Only:
-- `name` (String) The name of account.
+- `agent_id` (Number)
-
-### Nested Schema for `api_links`
+
+### Nested Schema for `groups.tests`
Read-Only:
-- `href` (String)
-- `rel` (String)
+- `test_id` (Number)
diff --git a/docs/resources/voice.md b/docs/resources/voice.md
index aab4660..c977ece 100644
--- a/docs/resources/voice.md
+++ b/docs/resources/voice.md
@@ -48,7 +48,6 @@ resource "thousandeyes_voice" "example_voice_test" {
- `dscp_id` (Number) The DSCP ID.
- `duration` (Number) The duration of the test, in seconds (5 to 30).
- `enabled` (Boolean) Enables or disables the test.
-- `groups` (Block Set, Deprecated) The array of label objects. (see [below for nested schema](#nestedblock--groups))
- `jitter_buffer` (Number) The de-jitter buffer size, in seconds (0 to 150).
- `mtu_measurements` (Boolean) Measure MTU sizes on the network from agents to the target.
- `num_path_traces` (Number) The number of path traces.
@@ -62,6 +61,7 @@ resource "thousandeyes_voice" "example_voice_test" {
- `created_by` (String) Created by user.
- `created_date` (String) The date of creation.
- `dscp` (String) The Differentiated Services Code Point (DSCP) label.
+- `groups` (Set of Object) The array of label objects. (see [below for nested schema](#nestedatt--groups))
- `id` (String) The ID of this resource.
- `live_share` (Boolean) Set to 'true' for a test shared with your account group, or to 'false' for a normal test.
- `modified_by` (String) Last modified by this user.
@@ -161,59 +161,52 @@ Optional:
- `network` (String) The name of the autonomous system in which the BGP monitor is found.
-
-### Nested Schema for `groups`
+
+### Nested Schema for `shared_with_accounts`
Required:
-- `group_id` (Number) The unique ID of the label.
-
-Optional:
-
-- `agents` (Block List) Define the ThousandEyes agents to use. (see [below for nested schema](#nestedblock--groups--agents))
-- `name` (String) The name of the label.
-- `tests` (Block List) The list of tests. (see [below for nested schema](#nestedblock--groups--tests))
-- `type` (String) [tests, agents, endpoint_tests, or endpoint_agents] The type of label.
+- `aid` (Number) The account group ID.
Read-Only:
-- `builtin` (Boolean) Shows whether you are using built-in (true) labels or user-created (false) labels. Built-in labels are read-only.
+- `name` (String) Account name.
-
-### Nested Schema for `groups.agents`
-Optional:
-
-- `agent_id` (Number) The unique ThousandEyes agent ID.
-
-
-
-### Nested Schema for `groups.tests`
+
+### Nested Schema for `api_links`
-Optional:
+Read-Only:
-- `test_id` (Number) The unique ID of the test.
+- `href` (String)
+- `rel` (String)
+
+### Nested Schema for `groups`
-
-### Nested Schema for `shared_with_accounts`
+Read-Only:
-Required:
+- `agents` (List of Object) (see [below for nested schema](#nestedobjatt--groups--agents))
+- `builtin` (Boolean)
+- `group_id` (Number)
+- `name` (String)
+- `tests` (List of Object) (see [below for nested schema](#nestedobjatt--groups--tests))
+- `type` (String)
-- `aid` (Number) The account group ID.
+
+### Nested Schema for `groups.agents`
Read-Only:
-- `name` (String) The name of account.
+- `agent_id` (Number)
-
-### Nested Schema for `api_links`
+
+### Nested Schema for `groups.tests`
Read-Only:
-- `href` (String)
-- `rel` (String)
+- `test_id` (Number)
diff --git a/docs/resources/web_transaction.md b/docs/resources/web_transaction.md
index e8cfd80..264bfa4 100644
--- a/docs/resources/web_transaction.md
+++ b/docs/resources/web_transaction.md
@@ -33,7 +33,6 @@ This resource allows users to create a transaction test. This test type is a scr
- `description` (String) A description of the alert rule. Defaults to an empty string.
- `desired_status_code` (String) The valid HTTP response code you’re interested in retrieving.
- `enabled` (Boolean) Enables or disables the test.
-- `groups` (Block Set, Deprecated) The array of label objects. (see [below for nested schema](#nestedblock--groups))
- `http_target_time` (Number) The target time for HTTP server completion, specified in milliseconds.
- `http_time_limit` (Number) The target time for HTTP server limits, specified in seconds.
- `http_version` (Number) Set to 2 for the default HTTP version (prefer HTTP/2), or 1 for HTTP/1.1 only.
@@ -60,6 +59,7 @@ This resource allows users to create a transaction test. This test type is a scr
- `api_links` (List of Object) Self links to the endpoint to pull test metadata, and data links to the endpoint for test data. Read-only, and shows rel and href elements. (see [below for nested schema](#nestedatt--api_links))
- `created_by` (String) Created by user.
- `created_date` (String) The date of creation.
+- `groups` (Set of Object) The array of label objects. (see [below for nested schema](#nestedatt--groups))
- `id` (String) The ID of this resource.
- `live_share` (Boolean) Set to 'true' for a test shared with your account group, or to 'false' for a normal test.
- `modified_by` (String) Last modified by this user.
@@ -144,59 +144,52 @@ Optional:
- `rule_id` (Number) The unique ID of the alert rule.
-
-### Nested Schema for `groups`
+
+### Nested Schema for `shared_with_accounts`
Required:
-- `group_id` (Number) The unique ID of the label.
-
-Optional:
-
-- `agents` (Block List) Define the ThousandEyes agents to use. (see [below for nested schema](#nestedblock--groups--agents))
-- `name` (String) The name of the label.
-- `tests` (Block List) The list of tests. (see [below for nested schema](#nestedblock--groups--tests))
-- `type` (String) [tests, agents, endpoint_tests, or endpoint_agents] The type of label.
+- `aid` (Number) The account group ID.
Read-Only:
-- `builtin` (Boolean) Shows whether you are using built-in (true) labels or user-created (false) labels. Built-in labels are read-only.
+- `name` (String) Account name.
-
-### Nested Schema for `groups.agents`
-Optional:
-
-- `agent_id` (Number) The unique ThousandEyes agent ID.
-
-
-
-### Nested Schema for `groups.tests`
+
+### Nested Schema for `api_links`
-Optional:
+Read-Only:
-- `test_id` (Number) The unique ID of the test.
+- `href` (String)
+- `rel` (String)
+
+### Nested Schema for `groups`
-
-### Nested Schema for `shared_with_accounts`
+Read-Only:
-Required:
+- `agents` (List of Object) (see [below for nested schema](#nestedobjatt--groups--agents))
+- `builtin` (Boolean)
+- `group_id` (Number)
+- `name` (String)
+- `tests` (List of Object) (see [below for nested schema](#nestedobjatt--groups--tests))
+- `type` (String)
-- `aid` (Number) The account group ID.
+
+### Nested Schema for `groups.agents`
Read-Only:
-- `name` (String) The name of account.
+- `agent_id` (Number)
-
-### Nested Schema for `api_links`
+
+### Nested Schema for `groups.tests`
Read-Only:
-- `href` (String)
-- `rel` (String)
+- `test_id` (Number)
diff --git a/go.mod b/go.mod
index 0cae60a..83e4390 100644
--- a/go.mod
+++ b/go.mod
@@ -5,7 +5,7 @@ go 1.17
require (
github.com/hashicorp/terraform-plugin-docs v0.9.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.17.0
- github.com/thousandeyes/thousandeyes-sdk-go/v2 v2.3.0
+ github.com/thousandeyes/thousandeyes-sdk-go/v2 v2.3.1
)
require (
diff --git a/go.sum b/go.sum
index 0bb5650..24ddee2 100644
--- a/go.sum
+++ b/go.sum
@@ -260,8 +260,8 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s=
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
-github.com/thousandeyes/thousandeyes-sdk-go/v2 v2.3.0 h1:uEkpjBj1KaSzNgaeh1MWT7cUEdAq43NjP0pZKtJvsmk=
-github.com/thousandeyes/thousandeyes-sdk-go/v2 v2.3.0/go.mod h1:XQouPCy3dIp81Xzkp9bqu6vg7fmE4QQpA6REsLVTDdE=
+github.com/thousandeyes/thousandeyes-sdk-go/v2 v2.3.1 h1:HQkRv1P/NudrtbXWNdCGO/EVxcAdKwMfQYRODcBRaqU=
+github.com/thousandeyes/thousandeyes-sdk-go/v2 v2.3.1/go.mod h1:XQouPCy3dIp81Xzkp9bqu6vg7fmE4QQpA6REsLVTDdE=
github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI=
github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
diff --git a/thousandeyes/resource_label.go b/thousandeyes/resource_label.go
index dc57b2c..e2614e9 100644
--- a/thousandeyes/resource_label.go
+++ b/thousandeyes/resource_label.go
@@ -22,9 +22,8 @@ func resourceGroupLabel() *schema.Resource {
}
resource.Schema["type"] = schemas["type-label"]
resource.Schema["agents"] = schemas["agents-label"]
- resource.Schema["tests"].Elem = &schema.Resource{
- Schema: ResourceSchemaBuild(thousandeyes.GenericTest{}, schemas, nil),
- }
+ resource.Schema["tests"] = schemas["tests-label"]
+
return &resource
}
@@ -47,10 +46,21 @@ func resourceGroupLabelRead(d *schema.ResourceData, m interface{}) error {
}
}
remote.Tests = &testIDs
+
+ agentIDs := []thousandeyes.Agent{}
+ if remote.Agents != nil {
+ for _, v := range *remote.Agents {
+ agent := thousandeyes.Agent{AgentID: v.AgentID}
+ agentIDs = append(agentIDs, agent)
+ }
+ }
+ remote.Agents = &agentIDs
+
err = ResourceRead(d, remote)
if err != nil {
return err
}
+
return nil
}
diff --git a/thousandeyes/schemas.go b/thousandeyes/schemas.go
index fc8aa34..91a1090 100644
--- a/thousandeyes/schemas.go
+++ b/thousandeyes/schemas.go
@@ -264,7 +264,7 @@ var schemas = map[string]*schema.Schema{
},
},
"agents-label": {
- Type: schema.TypeList,
+ Type: schema.TypeSet,
Description: "The list of agents to use.",
Optional: true,
Elem: &schema.Resource{
@@ -272,7 +272,7 @@ var schemas = map[string]*schema.Schema{
"agent_id": {
Type: schema.TypeInt,
Description: "The list of unique agent IDs that the label is applied to.",
- Optional: true,
+ Required: true,
},
},
},
@@ -593,8 +593,7 @@ var schemas = map[string]*schema.Schema{
"groups": {
Type: schema.TypeSet,
Description: "The array of label objects.",
- Optional: true,
- Deprecated: "This attribute will become a computed attribute. Use thousandeyes_label to link labels to tests",
+ Computed: true,
Elem: &schema.Resource{
// Schema definition here is to support group objects returned from
// reads of test resources.
@@ -603,13 +602,13 @@ var schemas = map[string]*schema.Schema{
// See `agents-label` rather than `agents`
Type: schema.TypeList,
Description: "Define the ThousandEyes agents to use.",
- Optional: true,
+ Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"agent_id": {
Type: schema.TypeInt,
Description: "The unique ThousandEyes agent ID.",
- Optional: true,
+ Computed: true,
},
},
},
@@ -622,24 +621,23 @@ var schemas = map[string]*schema.Schema{
"group_id": {
Type: schema.TypeInt,
Description: "The unique ID of the label.",
- Required: true,
+ Computed: true,
},
"name": {
Type: schema.TypeString,
Description: "The name of the label.",
- Optional: true,
- Default: "",
+ Computed: true,
},
"tests": {
Type: schema.TypeList,
Description: "The list of tests.",
- Optional: true,
+ Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"test_id": {
Type: schema.TypeInt,
Description: "The unique ID of the test.",
- Optional: true,
+ Computed: true,
},
},
},
@@ -648,8 +646,7 @@ var schemas = map[string]*schema.Schema{
// See `type-label` rather than `type`
Type: schema.TypeString,
Description: "[tests, agents, endpoint_tests, or endpoint_agents] The type of label.",
- Optional: true,
- Default: "",
+ Computed: true,
},
},
},
@@ -1002,7 +999,7 @@ var schemas = map[string]*schema.Schema{
},
"name": {
Type: schema.TypeString,
- Description: "The name of account.",
+ Description: "Account name.",
Computed: true,
},
},
@@ -1137,6 +1134,20 @@ var schemas = map[string]*schema.Schema{
},
},
},
+ "tests-label": {
+ Type: schema.TypeSet,
+ Description: "The list of included tests.",
+ Optional: true,
+ Elem: &schema.Resource{
+ Schema: map[string]*schema.Schema{
+ "test_id": {
+ Type: schema.TypeInt,
+ Description: "The list of unique test IDs.",
+ Required: true,
+ },
+ },
+ },
+ },
"time_limit": {
Type: schema.TypeInt,
Description: "The time limit for the transaction. The default value is 30s.",
diff --git a/thousandeyes/util.go b/thousandeyes/util.go
index 8ec98e4..f5f6f7e 100644
--- a/thousandeyes/util.go
+++ b/thousandeyes/util.go
@@ -345,9 +345,13 @@ func FixReadValues(m interface{}, name string) (interface{}, error) {
}
}
- // Remove tests.
case "tests":
- m = nil
+ for i, v := range m.([]interface{}) {
+ test := v.(map[string]interface{})
+ m.([]interface{})[i] = map[string]interface{}{
+ "test_id": test["test_id"],
+ }
+ }
}
return m, nil