From 24f28aa709fcb1f732f155f40fe1c2ec308c69c3 Mon Sep 17 00:00:00 2001 From: Brandon <79970283+brandon-piner-aruba@users.noreply.github.com> Date: Thu, 28 Nov 2024 13:17:19 +0200 Subject: [PATCH] feat: rename provider from uxi to hpeuxi (#145) * renamed provider to hpeuxi * for Ash * fmt * docs update * lil change --------- Co-authored-by: brandon --- Justfile | 4 +- README.md | 14 +- docs/data-sources/agent.md | 6 +- docs/data-sources/agent_group_assignment.md | 6 +- docs/data-sources/group.md | 6 +- docs/data-sources/network_group_assignment.md | 6 +- docs/data-sources/sensor.md | 6 +- docs/data-sources/sensor_group_assignment.md | 6 +- docs/data-sources/service_test.md | 6 +- .../service_test_group_assignment.md | 6 +- docs/data-sources/wired_network.md | 6 +- docs/data-sources/wireless_network.md | 6 +- docs/index.md | 6 +- docs/resources/agent.md | 10 +- docs/resources/agent_group_assignment.md | 14 +- docs/resources/group.md | 20 +- docs/resources/network_group_assignment.md | 14 +- docs/resources/sensor.md | 10 +- docs/resources/sensor_group_assignment.md | 14 +- docs/resources/service_test.md | 10 +- .../service_test_group_assignment.md | 14 +- docs/resources/wired_network.md | 10 +- docs/resources/wireless_network.md | 10 +- .../data-source.tf | 2 +- .../data-source.tf | 2 +- .../data-source.tf | 2 +- .../data-source.tf | 2 +- .../data-source.tf | 2 +- .../data-source.tf | 2 +- .../data-source.tf | 2 +- .../data-source.tf | 2 +- .../data-source.tf | 2 +- .../data-source.tf | 2 +- examples/provider/provider.tf | 2 +- .../{uxi_agent => hpeuxi_agent}/import.sh | 4 +- .../{uxi_agent => hpeuxi_agent}/resource.tf | 2 +- .../import.sh | 4 +- .../hpeuxi_agent_group_assignment/resource.tf | 4 + .../{uxi_group => hpeuxi_group}/import.sh | 8 +- .../{uxi_group => hpeuxi_group}/resource.tf | 6 +- .../hpeuxi_network_group_assignment/import.sh | 8 + .../resource.tf | 4 + .../{uxi_sensor => hpeuxi_sensor}/import.sh | 4 +- .../{uxi_sensor => hpeuxi_sensor}/resource.tf | 2 +- .../hpeuxi_sensor_group_assignment/import.sh | 8 + .../resource.tf | 4 + .../import.sh | 4 +- .../resource.tf | 2 +- .../import.sh | 8 + .../resource.tf | 4 + .../import.sh | 4 +- .../resource.tf | 2 +- .../import.sh | 4 +- .../resource.tf | 2 +- .../uxi_agent_group_assignment/resource.tf | 4 - .../uxi_network_group_assignment/import.sh | 8 - .../uxi_network_group_assignment/resource.tf | 4 - .../uxi_sensor_group_assignment/import.sh | 8 - .../uxi_sensor_group_assignment/resource.tf | 4 - .../import.sh | 8 - .../resource.tf | 4 - internal/provider/provider.go | 34 ++-- .../provider/resources/data_source_agent.go | 2 +- .../data_source_agent_group_assignment.go | 2 +- .../provider/resources/data_source_group.go | 2 +- .../data_source_network_group_assignment.go | 2 +- .../provider/resources/data_source_sensor.go | 2 +- .../data_source_sensor_group_assignment.go | 2 +- .../provider/resources/data_source_service.go | 2 +- ...ta_source_service_test_group_assignment.go | 2 +- .../resources/data_source_wired_network.go | 2 +- .../resources/data_source_wireless_network.go | 2 +- internal/provider/resources/resource_agent.go | 6 +- .../resource_agent_group_assignment.go | 6 +- internal/provider/resources/resource_group.go | 10 +- .../resource_network_group_assignment.go | 6 +- .../provider/resources/resource_sensor.go | 4 +- .../resource_sensor_group_assignment.go | 6 +- .../provider/resources/resource_service.go | 2 +- .../resource_service_group_assignment.go | 6 +- .../resources/resource_wired_network.go | 2 +- .../resources/resource_wireless_network.go | 2 +- .../agent_group_assignment_test.go | 18 +- test/live/datasources/agent_test.go | 4 +- test/live/datasources/group_test.go | 16 +- .../network_group_assignment_test.go | 18 +- .../sensor_group_assignment_test.go | 18 +- test/live/datasources/sensor_test.go | 4 +- test/live/datasources/service_test.go | 4 +- .../service_test_group_assignment_test.go | 18 +- test/live/datasources/wired_network_test.go | 4 +- .../live/datasources/wireless_network_test.go | 4 +- test/live/provider/provider.go | 4 +- .../resources/agent_group_assignment_test.go | 40 ++-- test/live/resources/agent_test.go | 16 +- test/live/resources/group_test.go | 74 ++++---- .../network_group_assignment_test.go | 96 +++++----- .../resources/sensor_group_assignment_test.go | 44 ++--- test/live/resources/sensor_test.go | 20 +- test/live/resources/service_test.go | 14 +- .../service_test_group_assignment_test.go | 46 ++--- test/live/resources/wired_network_test.go | 14 +- test/live/resources/wireless_network_test.go | 14 +- .../agent_group_assignment_test.go | 16 +- test/mocked/datasources/agent_test.go | 12 +- test/mocked/datasources/group_test.go | 14 +- .../network_group_assignment_test.go | 16 +- .../sensor_group_assignment_test.go | 16 +- test/mocked/datasources/sensor_test.go | 12 +- test/mocked/datasources/service_test.go | 12 +- .../service_test_group_assignment_test.go | 16 +- test/mocked/datasources/wired_network_test.go | 12 +- .../datasources/wireless_network_test.go | 12 +- test/mocked/provider/provider.go | 4 +- .../resources/agent_group_assignment_test.go | 118 ++++++------ test/mocked/resources/agent_test.go | 40 ++-- test/mocked/resources/group_test.go | 66 +++---- .../network_group_assignment_test.go | 172 +++++++++--------- .../resources/sensor_group_assignment_test.go | 126 ++++++------- test/mocked/resources/sensor_test.go | 46 ++--- test/mocked/resources/service_test.go | 30 +-- .../service_test_group_assignment_test.go | 124 ++++++------- test/mocked/resources/wired_network_test.go | 30 +-- .../mocked/resources/wireless_network_test.go | 30 +-- 124 files changed, 940 insertions(+), 938 deletions(-) rename examples/data-sources/{uxi_agent => hpeuxi_agent}/data-source.tf (68%) rename examples/data-sources/{uxi_agent_group_assignment => hpeuxi_agent_group_assignment}/data-source.tf (61%) rename examples/data-sources/{uxi_group => hpeuxi_group}/data-source.tf (72%) rename examples/data-sources/{uxi_network_group_assignment => hpeuxi_network_group_assignment}/data-source.tf (60%) rename examples/data-sources/{uxi_sensor => hpeuxi_sensor}/data-source.tf (67%) rename examples/data-sources/{uxi_sensor_group_assignment => hpeuxi_sensor_group_assignment}/data-source.tf (61%) rename examples/data-sources/{uxi_service_test => hpeuxi_service_test}/data-source.tf (64%) rename examples/data-sources/{uxi_service_test_group_assignment => hpeuxi_service_test_group_assignment}/data-source.tf (59%) rename examples/data-sources/{uxi_wired_network => hpeuxi_wired_network}/data-source.tf (64%) rename examples/data-sources/{uxi_wireless_network => hpeuxi_wireless_network}/data-source.tf (63%) rename examples/resources/{uxi_agent => hpeuxi_agent}/import.sh (57%) rename examples/resources/{uxi_agent => hpeuxi_agent}/resource.tf (67%) rename examples/resources/{uxi_agent_group_assignment => hpeuxi_agent_group_assignment}/import.sh (50%) create mode 100644 examples/resources/hpeuxi_agent_group_assignment/resource.tf rename examples/resources/{uxi_group => hpeuxi_group}/import.sh (61%) rename examples/resources/{uxi_group => hpeuxi_group}/resource.tf (59%) create mode 100644 examples/resources/hpeuxi_network_group_assignment/import.sh create mode 100644 examples/resources/hpeuxi_network_group_assignment/resource.tf rename examples/resources/{uxi_sensor => hpeuxi_sensor}/import.sh (56%) rename examples/resources/{uxi_sensor => hpeuxi_sensor}/resource.tf (83%) create mode 100644 examples/resources/hpeuxi_sensor_group_assignment/import.sh create mode 100644 examples/resources/hpeuxi_sensor_group_assignment/resource.tf rename examples/resources/{uxi_service_test => hpeuxi_service_test}/import.sh (53%) rename examples/resources/{uxi_service_test => hpeuxi_service_test}/resource.tf (70%) create mode 100644 examples/resources/hpeuxi_service_test_group_assignment/import.sh create mode 100644 examples/resources/hpeuxi_service_test_group_assignment/resource.tf rename examples/resources/{uxi_wired_network => hpeuxi_wired_network}/import.sh (53%) rename examples/resources/{uxi_wired_network => hpeuxi_wired_network}/resource.tf (70%) rename examples/resources/{uxi_wireless_network => hpeuxi_wireless_network}/import.sh (52%) rename examples/resources/{uxi_wireless_network => hpeuxi_wireless_network}/resource.tf (68%) delete mode 100644 examples/resources/uxi_agent_group_assignment/resource.tf delete mode 100644 examples/resources/uxi_network_group_assignment/import.sh delete mode 100644 examples/resources/uxi_network_group_assignment/resource.tf delete mode 100644 examples/resources/uxi_sensor_group_assignment/import.sh delete mode 100644 examples/resources/uxi_sensor_group_assignment/resource.tf delete mode 100644 examples/resources/uxi_service_test_group_assignment/import.sh delete mode 100644 examples/resources/uxi_service_test_group_assignment/resource.tf diff --git a/Justfile b/Justfile index 905f44a3..908cd111 100644 --- a/Justfile +++ b/Justfile @@ -87,11 +87,11 @@ test-provider +ARGS='': TF_ACC=1 go test -v ./test/mocked/... -race -covermode=atomic -coverprofile=.coverage {{ ARGS }} generate-provider-docs: - cd {{ TOOLS_PROVIDER_DIR }} && go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs generate --provider-dir ../. --provider-name uxi + cd {{ TOOLS_PROVIDER_DIR }} && go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs generate --provider-dir ../. --provider-name hpeuxi sed -i.backup '/subcategory: ""/d' docs/index.md && rm docs/index.md.backup validate-provider-docs: - cd {{ TOOLS_PROVIDER_DIR }} && go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs validate --provider-dir ../. --provider-name uxi + cd {{ TOOLS_PROVIDER_DIR }} && go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs validate --provider-dir ../. --provider-name hpeuxi coverage-provider: go tool cover -html=.coverage -o=.coverage.html diff --git a/README.md b/README.md index ccc190df..037c74dc 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Create a Terraform file in your working directory, and reference the desired pro ```terraform terraform { required_providers { - uxi = { + hpeuxi = { source = "aruba-uxi/hpeuxi" version = ">= 0.0.0-pre.alpha.3" } @@ -60,12 +60,12 @@ terraform { } # create a group -resource "uxi_group" "my_group" { +resource "hpeuxi_group" "my_group" { name = "level_1" } # import a sensor -resource "uxi_sensor" "my_sensor" { +resource "hpeuxi_sensor" "my_sensor" { name = "my_sensor_name" lifecycle { @@ -74,14 +74,14 @@ resource "uxi_sensor" "my_sensor" { } import { - to = uxi_sensor.my_sensor + to = hpeuxi_sensor.my_sensor id = "my_sensor_id" } # assign the sensor to a group -resource "uxi_sensor_group_assignment" "my_uxi_sensor_group_assignment" { - sensor_id = uxi_sensor.my_sensor.id - group_id = uxi_group.my_group.id +resource "hpeuxi_sensor_group_assignment" "my_uxi_sensor_group_assignment" { + sensor_id = hpeuxi_sensor.my_sensor.id + group_id = hpeuxi_group.my_group.id } ``` diff --git a/docs/data-sources/agent.md b/docs/data-sources/agent.md index 8124d189..cfb4f050 100644 --- a/docs/data-sources/agent.md +++ b/docs/data-sources/agent.md @@ -1,12 +1,12 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "uxi_agent Data Source - uxi" +page_title: "hpeuxi_agent Data Source - hpeuxi" subcategory: "" description: |- Retrieves a specific agent. --- -# uxi_agent (Data Source) +# hpeuxi_agent (Data Source) Retrieves a specific agent. @@ -14,7 +14,7 @@ Retrieves a specific agent. ```terraform # Retrieve data for an agent -data "uxi_agent" "my_agent" { +data "hpeuxi_agent" "my_agent" { filter = { id = "" } diff --git a/docs/data-sources/agent_group_assignment.md b/docs/data-sources/agent_group_assignment.md index 76d12737..39ee32a2 100644 --- a/docs/data-sources/agent_group_assignment.md +++ b/docs/data-sources/agent_group_assignment.md @@ -1,12 +1,12 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "uxi_agent_group_assignment Data Source - uxi" +page_title: "hpeuxi_agent_group_assignment Data Source - hpeuxi" subcategory: "" description: |- Retrieves a specific agent group assignment. --- -# uxi_agent_group_assignment (Data Source) +# hpeuxi_agent_group_assignment (Data Source) Retrieves a specific agent group assignment. @@ -14,7 +14,7 @@ Retrieves a specific agent group assignment. ```terraform # Retrieve data for an agent group assignment -data "uxi_agent_group_assignment" "my_agent_group_assignment" { +data "hpeuxi_agent_group_assignment" "my_agent_group_assignment" { filter = { id = "" } diff --git a/docs/data-sources/group.md b/docs/data-sources/group.md index f097d97d..e35a9773 100644 --- a/docs/data-sources/group.md +++ b/docs/data-sources/group.md @@ -1,12 +1,12 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "uxi_group Data Source - uxi" +page_title: "hpeuxi_group Data Source - hpeuxi" subcategory: "" description: |- Retrieves a specific group. --- -# uxi_group (Data Source) +# hpeuxi_group (Data Source) Retrieves a specific group. @@ -14,7 +14,7 @@ Retrieves a specific group. ```terraform # Retrieve data for level 1 group -data "uxi_group" "level_1" { +data "hpeuxi_group" "level_1" { filter = { id = "" } diff --git a/docs/data-sources/network_group_assignment.md b/docs/data-sources/network_group_assignment.md index 8d3adca2..a192c78b 100644 --- a/docs/data-sources/network_group_assignment.md +++ b/docs/data-sources/network_group_assignment.md @@ -1,12 +1,12 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "uxi_network_group_assignment Data Source - uxi" +page_title: "hpeuxi_network_group_assignment Data Source - hpeuxi" subcategory: "" description: |- Retrieves a specific network group assignment. --- -# uxi_network_group_assignment (Data Source) +# hpeuxi_network_group_assignment (Data Source) Retrieves a specific network group assignment. @@ -14,7 +14,7 @@ Retrieves a specific network group assignment. ```terraform # Retrieve data for a network group assignment -data "uxi_network_group_assignment" "my_network_group_assignment" { +data "hpeuxi_network_group_assignment" "my_network_group_assignment" { filter = { id = "" } diff --git a/docs/data-sources/sensor.md b/docs/data-sources/sensor.md index a10f634f..78bf7a75 100644 --- a/docs/data-sources/sensor.md +++ b/docs/data-sources/sensor.md @@ -1,12 +1,12 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "uxi_sensor Data Source - uxi" +page_title: "hpeuxi_sensor Data Source - hpeuxi" subcategory: "" description: |- Retrieves a specific sensor. --- -# uxi_sensor (Data Source) +# hpeuxi_sensor (Data Source) Retrieves a specific sensor. @@ -14,7 +14,7 @@ Retrieves a specific sensor. ```terraform # Retrieve data for a sensor -data "uxi_sensor" "my_sensor" { +data "hpeuxi_sensor" "my_sensor" { filter = { id = "" } diff --git a/docs/data-sources/sensor_group_assignment.md b/docs/data-sources/sensor_group_assignment.md index 6a3b3002..aea80ff4 100644 --- a/docs/data-sources/sensor_group_assignment.md +++ b/docs/data-sources/sensor_group_assignment.md @@ -1,12 +1,12 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "uxi_sensor_group_assignment Data Source - uxi" +page_title: "hpeuxi_sensor_group_assignment Data Source - hpeuxi" subcategory: "" description: |- Retrieves a specific sensor group assignment. --- -# uxi_sensor_group_assignment (Data Source) +# hpeuxi_sensor_group_assignment (Data Source) Retrieves a specific sensor group assignment. @@ -14,7 +14,7 @@ Retrieves a specific sensor group assignment. ```terraform # Retrieve data for a sensor group assignment -data "uxi_sensor_group_assignment" "my_sensor_group_assignment" { +data "hpeuxi_sensor_group_assignment" "my_sensor_group_assignment" { filter = { id = "" } diff --git a/docs/data-sources/service_test.md b/docs/data-sources/service_test.md index ea54fe33..67b69737 100644 --- a/docs/data-sources/service_test.md +++ b/docs/data-sources/service_test.md @@ -1,12 +1,12 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "uxi_service_test Data Source - uxi" +page_title: "hpeuxi_service_test Data Source - hpeuxi" subcategory: "" description: |- Retrieves a specific service test. --- -# uxi_service_test (Data Source) +# hpeuxi_service_test (Data Source) Retrieves a specific service test. @@ -14,7 +14,7 @@ Retrieves a specific service test. ```terraform # Retrieve data for a service test -data "uxi_service_test" "my_service_test" { +data "hpeuxi_service_test" "my_service_test" { filter = { id = "" } diff --git a/docs/data-sources/service_test_group_assignment.md b/docs/data-sources/service_test_group_assignment.md index 199236bc..4c629015 100644 --- a/docs/data-sources/service_test_group_assignment.md +++ b/docs/data-sources/service_test_group_assignment.md @@ -1,12 +1,12 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "uxi_service_test_group_assignment Data Source - uxi" +page_title: "hpeuxi_service_test_group_assignment Data Source - hpeuxi" subcategory: "" description: |- Retrieves a specific service test group assignment. --- -# uxi_service_test_group_assignment (Data Source) +# hpeuxi_service_test_group_assignment (Data Source) Retrieves a specific service test group assignment. @@ -14,7 +14,7 @@ Retrieves a specific service test group assignment. ```terraform # Retrieve data for a service test group assignment -data "uxi_service_test_group_assignment" "my_service_test_group_assignment" { +data "hpeuxi_service_test_group_assignment" "my_service_test_group_assignment" { filter = { id = "" } diff --git a/docs/data-sources/wired_network.md b/docs/data-sources/wired_network.md index 98064210..f9033787 100644 --- a/docs/data-sources/wired_network.md +++ b/docs/data-sources/wired_network.md @@ -1,12 +1,12 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "uxi_wired_network Data Source - uxi" +page_title: "hpeuxi_wired_network Data Source - hpeuxi" subcategory: "" description: |- Retrieves a specific wired network. --- -# uxi_wired_network (Data Source) +# hpeuxi_wired_network (Data Source) Retrieves a specific wired network. @@ -14,7 +14,7 @@ Retrieves a specific wired network. ```terraform # Retrieve data for a wired network -data "uxi_wired_network" "my_wired_network" { +data "hpeuxi_wired_network" "my_wired_network" { filter = { id = "" } diff --git a/docs/data-sources/wireless_network.md b/docs/data-sources/wireless_network.md index 737c6a73..b175219e 100644 --- a/docs/data-sources/wireless_network.md +++ b/docs/data-sources/wireless_network.md @@ -1,12 +1,12 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "uxi_wireless_network Data Source - uxi" +page_title: "hpeuxi_wireless_network Data Source - hpeuxi" subcategory: "" description: |- Retrieves a specific wireless network. --- -# uxi_wireless_network (Data Source) +# hpeuxi_wireless_network (Data Source) Retrieves a specific wireless network. @@ -14,7 +14,7 @@ Retrieves a specific wireless network. ```terraform # Retrieve data for a wireless network -data "uxi_wireless_network" "my_wireless_network" { +data "hpeuxi_wireless_network" "my_wireless_network" { filter = { id = "" } diff --git a/docs/index.md b/docs/index.md index c5711746..7a5d0661 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,18 +1,18 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "uxi Provider" +page_title: "hpeuxi Provider" description: |- Interact with HPE Aruba Network UXI Configuration. --- -# uxi Provider +# hpeuxi Provider Interact with HPE Aruba Network UXI Configuration. ## Example Usage ```terraform -provider "uxi" { +provider "hpeuxi" { client_id = "your_greenlake_uxi_client_id" client_secret = "your_greenlake_uxi_client_secret" } diff --git a/docs/resources/agent.md b/docs/resources/agent.md index 19472f78..0d6ac94f 100644 --- a/docs/resources/agent.md +++ b/docs/resources/agent.md @@ -1,19 +1,19 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "uxi_agent Resource - uxi" +page_title: "hpeuxi_agent Resource - hpeuxi" subcategory: "" description: |- Manages an agent. --- -# uxi_agent (Resource) +# hpeuxi_agent (Resource) Manages an agent. ## Example Usage ```terraform -resource "uxi_agent" "my_agent" { +resource "hpeuxi_agent" "my_agent" { name = "name" notes = "notes" pcap_mode = "light" @@ -46,11 +46,11 @@ Import is supported using the following syntax: ```shell # Import agent using its ID -terraform import uxi_agent.my_agent +terraform import hpeuxi_agent.my_agent # Import agent using its ID with an import block import { - to = uxi_agent.my_agent + to = hpeuxi_agent.my_agent id = "" } ``` diff --git a/docs/resources/agent_group_assignment.md b/docs/resources/agent_group_assignment.md index 8d531d27..e4a732c2 100644 --- a/docs/resources/agent_group_assignment.md +++ b/docs/resources/agent_group_assignment.md @@ -1,21 +1,21 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "uxi_agent_group_assignment Resource - uxi" +page_title: "hpeuxi_agent_group_assignment Resource - hpeuxi" subcategory: "" description: |- Manages an agent group assignment. --- -# uxi_agent_group_assignment (Resource) +# hpeuxi_agent_group_assignment (Resource) Manages an agent group assignment. ## Example Usage ```terraform -resource "uxi_agent_group_assignment" "my_agent_group_assignment" { - agent_id = uxi_agent.my_agent.id - group_id = uxi_group.my_group.id +resource "hpeuxi_agent_group_assignment" "my_agent_group_assignment" { + agent_id = hpeuxi_agent.my_agent.id + group_id = hpeuxi_group.my_group.id } ``` @@ -37,11 +37,11 @@ Import is supported using the following syntax: ```shell # Import an agent group assignment using its ID -terraform import uxi_agent_group_assignment.my_agent_group_assignment +terraform import hpeuxi_agent_group_assignment.my_agent_group_assignment # Import an agent group assignment using its ID with an import block import { - to = uxi_agent_group_assignment.my_agent_group_assignment + to = hpeuxi_agent_group_assignment.my_agent_group_assignment id = "" } ``` diff --git a/docs/resources/group.md b/docs/resources/group.md index d52d3592..69507355 100644 --- a/docs/resources/group.md +++ b/docs/resources/group.md @@ -1,12 +1,12 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "uxi_group Resource - uxi" +page_title: "hpeuxi_group Resource - hpeuxi" subcategory: "" description: |- Manages a group. --- -# uxi_group (Resource) +# hpeuxi_group (Resource) Manages a group. @@ -14,14 +14,14 @@ Manages a group. ```terraform # Create level 1 group attached to the root node -resource "uxi_group" "level_1" { +resource "hpeuxi_group" "level_1" { name = "Parent Group" } # Create level 2 group attached to level 1 group -resource "uxi_group" "level_2" { +resource "hpeuxi_group" "level_2" { name = "Child Group" - parent_group_id = uxi_group.level_1.id + parent_group_id = hpeuxi_group.level_1.id } ``` @@ -34,7 +34,7 @@ resource "uxi_group" "level_2" { ### Optional -- `parent_group_id` (String) The identifier of the parent of this group. Use uxi_group resource or datasource id for this attribute. Alternatively leave blank to set group to highest level configurable node. +- `parent_group_id` (String) The identifier of the parent of this group. Use hpeuxi_group resource or datasource id for this attribute. Alternatively leave blank to set group to highest level configurable node. ### Read-Only @@ -46,20 +46,20 @@ Import is supported using the following syntax: ```shell # Import level 1 group using its ID -terraform import uxi_group.level_1 +terraform import hpeuxi_group.level_1 # Import level 1 group using its ID with an import block import { - to = uxi_group.level_1 + to = hpeuxi_group.level_1 id = "level_1_id" } # Import level 2 group using its ID -terraform import uxi_group.level_2 +terraform import hpeuxi_group.level_2 # Import level 2 group using its ID with an import block import { - to = uxi_group.level_2 + to = hpeuxi_group.level_2 id = "level_2_id" } ``` diff --git a/docs/resources/network_group_assignment.md b/docs/resources/network_group_assignment.md index 9101cc06..7095a402 100644 --- a/docs/resources/network_group_assignment.md +++ b/docs/resources/network_group_assignment.md @@ -1,21 +1,21 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "uxi_network_group_assignment Resource - uxi" +page_title: "hpeuxi_network_group_assignment Resource - hpeuxi" subcategory: "" description: |- Manages a network group assignment. --- -# uxi_network_group_assignment (Resource) +# hpeuxi_network_group_assignment (Resource) Manages a network group assignment. ## Example Usage ```terraform -resource "uxi_network_group_assignment" "my_network_group_assignment" { - network_id = uxi_wired_network.my_network.id - group_id = uxi_group.my_group.id +resource "hpeuxi_network_group_assignment" "my_network_group_assignment" { + network_id = hpeuxi_wired_network.my_network.id + group_id = hpeuxi_group.my_group.id } ``` @@ -37,11 +37,11 @@ Import is supported using the following syntax: ```shell # Import network group assignment using its ID -terraform import uxi_network_group_assignment.my_network_group_assignment +terraform import hpeuxi_network_group_assignment.my_network_group_assignment # Import network group assignment using its ID with an import block import { - to = uxi_network_group_assignment.my_network_group_assignment + to = hpeuxi_network_group_assignment.my_network_group_assignment id = "" } ``` diff --git a/docs/resources/sensor.md b/docs/resources/sensor.md index ab4d2257..aee01dca 100644 --- a/docs/resources/sensor.md +++ b/docs/resources/sensor.md @@ -1,19 +1,19 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "uxi_sensor Resource - uxi" +page_title: "hpeuxi_sensor Resource - hpeuxi" subcategory: "" description: |- Manages a sensor. --- -# uxi_sensor (Resource) +# hpeuxi_sensor (Resource) Manages a sensor. ## Example Usage ```terraform -resource "uxi_sensor" "my_sensor" { +resource "hpeuxi_sensor" "my_sensor" { name = "name" address_note = "Example 3rd Floor" notes = "notes" @@ -55,11 +55,11 @@ Import is supported using the following syntax: ```shell # Import sensor using its ID -terraform import uxi_sensor.my_sensor +terraform import hpeuxi_sensor.my_sensor # Import sensor using its ID with an import block import { - to = uxi_sensor.my_sensor + to = hpeuxi_sensor.my_sensor id = "" } ``` diff --git a/docs/resources/sensor_group_assignment.md b/docs/resources/sensor_group_assignment.md index 89b39fb6..9cc91270 100644 --- a/docs/resources/sensor_group_assignment.md +++ b/docs/resources/sensor_group_assignment.md @@ -1,21 +1,21 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "uxi_sensor_group_assignment Resource - uxi" +page_title: "hpeuxi_sensor_group_assignment Resource - hpeuxi" subcategory: "" description: |- Manages a sensor group assignment. --- -# uxi_sensor_group_assignment (Resource) +# hpeuxi_sensor_group_assignment (Resource) Manages a sensor group assignment. ## Example Usage ```terraform -resource "uxi_sensor_group_assignment" "my_sensor_group_assignment" { - sensor_id = uxi_sensor.my_sensor.id - group_id = uxi_group.my_group.id +resource "hpeuxi_sensor_group_assignment" "my_sensor_group_assignment" { + sensor_id = hpeuxi_sensor.my_sensor.id + group_id = hpeuxi_group.my_group.id } ``` @@ -37,11 +37,11 @@ Import is supported using the following syntax: ```shell # Import sensor group assignment using its ID -terraform import uxi_sensor_group_assignment.my_sensor_group_assignment +terraform import hpeuxi_sensor_group_assignment.my_sensor_group_assignment # Import sensor group assignment using its ID with an import block import { - to = uxi_sensor_group_assignment.my_sensor_group_assignment + to = hpeuxi_sensor_group_assignment.my_sensor_group_assignment id = "" } ``` diff --git a/docs/resources/service_test.md b/docs/resources/service_test.md index b07fd890..3829e9f6 100644 --- a/docs/resources/service_test.md +++ b/docs/resources/service_test.md @@ -1,19 +1,19 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "uxi_service_test Resource - uxi" +page_title: "hpeuxi_service_test Resource - hpeuxi" subcategory: "" description: |- Manages a service test. --- -# uxi_service_test (Resource) +# hpeuxi_service_test (Resource) Manages a service test. ## Example Usage ```terraform -resource "uxi_service_test" "my_service_test" { +resource "hpeuxi_service_test" "my_service_test" { name = "name" # Deleting of service tests is not supported yet @@ -44,11 +44,11 @@ Import is supported using the following syntax: ```shell # Import a service test using its ID -terraform import uxi_service_test.my_service_test +terraform import hpeuxi_service_test.my_service_test # Import a service test using its ID with an import block import { - to = uxi_service_test.my_service_test + to = hpeuxi_service_test.my_service_test id = "" } ``` diff --git a/docs/resources/service_test_group_assignment.md b/docs/resources/service_test_group_assignment.md index b7255460..9072354b 100644 --- a/docs/resources/service_test_group_assignment.md +++ b/docs/resources/service_test_group_assignment.md @@ -1,21 +1,21 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "uxi_service_test_group_assignment Resource - uxi" +page_title: "hpeuxi_service_test_group_assignment Resource - hpeuxi" subcategory: "" description: |- Manages a service test group assignment. --- -# uxi_service_test_group_assignment (Resource) +# hpeuxi_service_test_group_assignment (Resource) Manages a service test group assignment. ## Example Usage ```terraform -resource "uxi_service_test_group_assignment" "my_service_test_group_assignment" { - service_test_id = uxi_service_test.my_service_test.id - group_id = uxi_group.my_group.id +resource "hpeuxi_service_test_group_assignment" "my_service_test_group_assignment" { + service_test_id = hpeuxi_service_test.my_service_test.id + group_id = hpeuxi_group.my_group.id } ``` @@ -37,11 +37,11 @@ Import is supported using the following syntax: ```shell # Import service test group assignment using its ID -terraform import uxi_service_test_group_assignment.my_service_test_group_assignment +terraform import hpeuxi_service_test_group_assignment.my_service_test_group_assignment # Import service test group assignment using its ID with an import block import { - to = uxi_service_test_group_assignment.my_service_test_group_assignment + to = hpeuxi_service_test_group_assignment.my_service_test_group_assignment id = "" } ``` diff --git a/docs/resources/wired_network.md b/docs/resources/wired_network.md index 6d68893f..6824c65d 100644 --- a/docs/resources/wired_network.md +++ b/docs/resources/wired_network.md @@ -1,19 +1,19 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "uxi_wired_network Resource - uxi" +page_title: "hpeuxi_wired_network Resource - hpeuxi" subcategory: "" description: |- Manages a wired network. --- -# uxi_wired_network (Resource) +# hpeuxi_wired_network (Resource) Manages a wired network. ## Example Usage ```terraform -resource "uxi_wired_network" "my_wired_network" { +resource "hpeuxi_wired_network" "my_wired_network" { name = "name" # Deleting of wired networks is not supported yet @@ -47,11 +47,11 @@ Import is supported using the following syntax: ```shell # Import a wired network using its ID -terraform import uxi_wired_network.my_wired_network +terraform import hpeuxi_wired_network.my_wired_network # Import a wired network using its ID with an import block import { - to = uxi_wired_network.my_wired_network + to = hpeuxi_wired_network.my_wired_network id = "" } ``` diff --git a/docs/resources/wireless_network.md b/docs/resources/wireless_network.md index f364e2e4..68039084 100644 --- a/docs/resources/wireless_network.md +++ b/docs/resources/wireless_network.md @@ -1,19 +1,19 @@ --- # generated by https://github.com/hashicorp/terraform-plugin-docs -page_title: "uxi_wireless_network Resource - uxi" +page_title: "hpeuxi_wireless_network Resource - hpeuxi" subcategory: "" description: |- Manages a wireless network. --- -# uxi_wireless_network (Resource) +# hpeuxi_wireless_network (Resource) Manages a wireless network. ## Example Usage ```terraform -resource "uxi_wireless_network" "my_wireless_network" { +resource "hpeuxi_wireless_network" "my_wireless_network" { name = "name" # Deleting of wireless networks is not supported yet @@ -49,11 +49,11 @@ Import is supported using the following syntax: ```shell # Import a wireless network using its ID -terraform import uxi_wireless_network.my_wireless_network +terraform import hpeuxi_wireless_network.my_wireless_network # Import a wireless network using its ID with an import block import { - to = uxi_wireless_network.my_wireless_network + to = hpeuxi_wireless_network.my_wireless_network id = "" } ``` diff --git a/examples/data-sources/uxi_agent/data-source.tf b/examples/data-sources/hpeuxi_agent/data-source.tf similarity index 68% rename from examples/data-sources/uxi_agent/data-source.tf rename to examples/data-sources/hpeuxi_agent/data-source.tf index 3eff1948..91741c22 100644 --- a/examples/data-sources/uxi_agent/data-source.tf +++ b/examples/data-sources/hpeuxi_agent/data-source.tf @@ -1,5 +1,5 @@ # Retrieve data for an agent -data "uxi_agent" "my_agent" { +data "hpeuxi_agent" "my_agent" { filter = { id = "" } diff --git a/examples/data-sources/uxi_agent_group_assignment/data-source.tf b/examples/data-sources/hpeuxi_agent_group_assignment/data-source.tf similarity index 61% rename from examples/data-sources/uxi_agent_group_assignment/data-source.tf rename to examples/data-sources/hpeuxi_agent_group_assignment/data-source.tf index ed505400..320158f0 100644 --- a/examples/data-sources/uxi_agent_group_assignment/data-source.tf +++ b/examples/data-sources/hpeuxi_agent_group_assignment/data-source.tf @@ -1,5 +1,5 @@ # Retrieve data for an agent group assignment -data "uxi_agent_group_assignment" "my_agent_group_assignment" { +data "hpeuxi_agent_group_assignment" "my_agent_group_assignment" { filter = { id = "" } diff --git a/examples/data-sources/uxi_group/data-source.tf b/examples/data-sources/hpeuxi_group/data-source.tf similarity index 72% rename from examples/data-sources/uxi_group/data-source.tf rename to examples/data-sources/hpeuxi_group/data-source.tf index a41df5da..a39a015d 100644 --- a/examples/data-sources/uxi_group/data-source.tf +++ b/examples/data-sources/hpeuxi_group/data-source.tf @@ -1,5 +1,5 @@ # Retrieve data for level 1 group -data "uxi_group" "level_1" { +data "hpeuxi_group" "level_1" { filter = { id = "" } diff --git a/examples/data-sources/uxi_network_group_assignment/data-source.tf b/examples/data-sources/hpeuxi_network_group_assignment/data-source.tf similarity index 60% rename from examples/data-sources/uxi_network_group_assignment/data-source.tf rename to examples/data-sources/hpeuxi_network_group_assignment/data-source.tf index 32989b43..6f05c451 100644 --- a/examples/data-sources/uxi_network_group_assignment/data-source.tf +++ b/examples/data-sources/hpeuxi_network_group_assignment/data-source.tf @@ -1,5 +1,5 @@ # Retrieve data for a network group assignment -data "uxi_network_group_assignment" "my_network_group_assignment" { +data "hpeuxi_network_group_assignment" "my_network_group_assignment" { filter = { id = "" } diff --git a/examples/data-sources/uxi_sensor/data-source.tf b/examples/data-sources/hpeuxi_sensor/data-source.tf similarity index 67% rename from examples/data-sources/uxi_sensor/data-source.tf rename to examples/data-sources/hpeuxi_sensor/data-source.tf index 7b898672..8ab48deb 100644 --- a/examples/data-sources/uxi_sensor/data-source.tf +++ b/examples/data-sources/hpeuxi_sensor/data-source.tf @@ -1,5 +1,5 @@ # Retrieve data for a sensor -data "uxi_sensor" "my_sensor" { +data "hpeuxi_sensor" "my_sensor" { filter = { id = "" } diff --git a/examples/data-sources/uxi_sensor_group_assignment/data-source.tf b/examples/data-sources/hpeuxi_sensor_group_assignment/data-source.tf similarity index 61% rename from examples/data-sources/uxi_sensor_group_assignment/data-source.tf rename to examples/data-sources/hpeuxi_sensor_group_assignment/data-source.tf index 93984a6f..1df5171a 100644 --- a/examples/data-sources/uxi_sensor_group_assignment/data-source.tf +++ b/examples/data-sources/hpeuxi_sensor_group_assignment/data-source.tf @@ -1,5 +1,5 @@ # Retrieve data for a sensor group assignment -data "uxi_sensor_group_assignment" "my_sensor_group_assignment" { +data "hpeuxi_sensor_group_assignment" "my_sensor_group_assignment" { filter = { id = "" } diff --git a/examples/data-sources/uxi_service_test/data-source.tf b/examples/data-sources/hpeuxi_service_test/data-source.tf similarity index 64% rename from examples/data-sources/uxi_service_test/data-source.tf rename to examples/data-sources/hpeuxi_service_test/data-source.tf index 7de0e1cc..2d2c8074 100644 --- a/examples/data-sources/uxi_service_test/data-source.tf +++ b/examples/data-sources/hpeuxi_service_test/data-source.tf @@ -1,5 +1,5 @@ # Retrieve data for a service test -data "uxi_service_test" "my_service_test" { +data "hpeuxi_service_test" "my_service_test" { filter = { id = "" } diff --git a/examples/data-sources/uxi_service_test_group_assignment/data-source.tf b/examples/data-sources/hpeuxi_service_test_group_assignment/data-source.tf similarity index 59% rename from examples/data-sources/uxi_service_test_group_assignment/data-source.tf rename to examples/data-sources/hpeuxi_service_test_group_assignment/data-source.tf index 17d49e2a..c57ec32a 100644 --- a/examples/data-sources/uxi_service_test_group_assignment/data-source.tf +++ b/examples/data-sources/hpeuxi_service_test_group_assignment/data-source.tf @@ -1,5 +1,5 @@ # Retrieve data for a service test group assignment -data "uxi_service_test_group_assignment" "my_service_test_group_assignment" { +data "hpeuxi_service_test_group_assignment" "my_service_test_group_assignment" { filter = { id = "" } diff --git a/examples/data-sources/uxi_wired_network/data-source.tf b/examples/data-sources/hpeuxi_wired_network/data-source.tf similarity index 64% rename from examples/data-sources/uxi_wired_network/data-source.tf rename to examples/data-sources/hpeuxi_wired_network/data-source.tf index e6cabb9f..dda0142a 100644 --- a/examples/data-sources/uxi_wired_network/data-source.tf +++ b/examples/data-sources/hpeuxi_wired_network/data-source.tf @@ -1,5 +1,5 @@ # Retrieve data for a wired network -data "uxi_wired_network" "my_wired_network" { +data "hpeuxi_wired_network" "my_wired_network" { filter = { id = "" } diff --git a/examples/data-sources/uxi_wireless_network/data-source.tf b/examples/data-sources/hpeuxi_wireless_network/data-source.tf similarity index 63% rename from examples/data-sources/uxi_wireless_network/data-source.tf rename to examples/data-sources/hpeuxi_wireless_network/data-source.tf index b4a06a98..7b3cf48d 100644 --- a/examples/data-sources/uxi_wireless_network/data-source.tf +++ b/examples/data-sources/hpeuxi_wireless_network/data-source.tf @@ -1,5 +1,5 @@ # Retrieve data for a wireless network -data "uxi_wireless_network" "my_wireless_network" { +data "hpeuxi_wireless_network" "my_wireless_network" { filter = { id = "" } diff --git a/examples/provider/provider.tf b/examples/provider/provider.tf index 4fbb597a..97f05be3 100644 --- a/examples/provider/provider.tf +++ b/examples/provider/provider.tf @@ -1,4 +1,4 @@ -provider "uxi" { +provider "hpeuxi" { client_id = "your_greenlake_uxi_client_id" client_secret = "your_greenlake_uxi_client_secret" } diff --git a/examples/resources/uxi_agent/import.sh b/examples/resources/hpeuxi_agent/import.sh similarity index 57% rename from examples/resources/uxi_agent/import.sh rename to examples/resources/hpeuxi_agent/import.sh index de0af057..c029d09f 100644 --- a/examples/resources/uxi_agent/import.sh +++ b/examples/resources/hpeuxi_agent/import.sh @@ -1,8 +1,8 @@ # Import agent using its ID -terraform import uxi_agent.my_agent +terraform import hpeuxi_agent.my_agent # Import agent using its ID with an import block import { - to = uxi_agent.my_agent + to = hpeuxi_agent.my_agent id = "" } diff --git a/examples/resources/uxi_agent/resource.tf b/examples/resources/hpeuxi_agent/resource.tf similarity index 67% rename from examples/resources/uxi_agent/resource.tf rename to examples/resources/hpeuxi_agent/resource.tf index 2b2df721..14b1e389 100644 --- a/examples/resources/uxi_agent/resource.tf +++ b/examples/resources/hpeuxi_agent/resource.tf @@ -1,4 +1,4 @@ -resource "uxi_agent" "my_agent" { +resource "hpeuxi_agent" "my_agent" { name = "name" notes = "notes" pcap_mode = "light" diff --git a/examples/resources/uxi_agent_group_assignment/import.sh b/examples/resources/hpeuxi_agent_group_assignment/import.sh similarity index 50% rename from examples/resources/uxi_agent_group_assignment/import.sh rename to examples/resources/hpeuxi_agent_group_assignment/import.sh index 940e66d5..766492f9 100644 --- a/examples/resources/uxi_agent_group_assignment/import.sh +++ b/examples/resources/hpeuxi_agent_group_assignment/import.sh @@ -1,8 +1,8 @@ # Import an agent group assignment using its ID -terraform import uxi_agent_group_assignment.my_agent_group_assignment +terraform import hpeuxi_agent_group_assignment.my_agent_group_assignment # Import an agent group assignment using its ID with an import block import { - to = uxi_agent_group_assignment.my_agent_group_assignment + to = hpeuxi_agent_group_assignment.my_agent_group_assignment id = "" } diff --git a/examples/resources/hpeuxi_agent_group_assignment/resource.tf b/examples/resources/hpeuxi_agent_group_assignment/resource.tf new file mode 100644 index 00000000..784f5e28 --- /dev/null +++ b/examples/resources/hpeuxi_agent_group_assignment/resource.tf @@ -0,0 +1,4 @@ +resource "hpeuxi_agent_group_assignment" "my_agent_group_assignment" { + agent_id = hpeuxi_agent.my_agent.id + group_id = hpeuxi_group.my_group.id +} diff --git a/examples/resources/uxi_group/import.sh b/examples/resources/hpeuxi_group/import.sh similarity index 61% rename from examples/resources/uxi_group/import.sh rename to examples/resources/hpeuxi_group/import.sh index 1f77dfb6..94c60f2a 100644 --- a/examples/resources/uxi_group/import.sh +++ b/examples/resources/hpeuxi_group/import.sh @@ -1,17 +1,17 @@ # Import level 1 group using its ID -terraform import uxi_group.level_1 +terraform import hpeuxi_group.level_1 # Import level 1 group using its ID with an import block import { - to = uxi_group.level_1 + to = hpeuxi_group.level_1 id = "level_1_id" } # Import level 2 group using its ID -terraform import uxi_group.level_2 +terraform import hpeuxi_group.level_2 # Import level 2 group using its ID with an import block import { - to = uxi_group.level_2 + to = hpeuxi_group.level_2 id = "level_2_id" } diff --git a/examples/resources/uxi_group/resource.tf b/examples/resources/hpeuxi_group/resource.tf similarity index 59% rename from examples/resources/uxi_group/resource.tf rename to examples/resources/hpeuxi_group/resource.tf index 67793274..a8fcfdb0 100644 --- a/examples/resources/uxi_group/resource.tf +++ b/examples/resources/hpeuxi_group/resource.tf @@ -1,10 +1,10 @@ # Create level 1 group attached to the root node -resource "uxi_group" "level_1" { +resource "hpeuxi_group" "level_1" { name = "Parent Group" } # Create level 2 group attached to level 1 group -resource "uxi_group" "level_2" { +resource "hpeuxi_group" "level_2" { name = "Child Group" - parent_group_id = uxi_group.level_1.id + parent_group_id = hpeuxi_group.level_1.id } diff --git a/examples/resources/hpeuxi_network_group_assignment/import.sh b/examples/resources/hpeuxi_network_group_assignment/import.sh new file mode 100644 index 00000000..bebe9c84 --- /dev/null +++ b/examples/resources/hpeuxi_network_group_assignment/import.sh @@ -0,0 +1,8 @@ +# Import network group assignment using its ID +terraform import hpeuxi_network_group_assignment.my_network_group_assignment + +# Import network group assignment using its ID with an import block +import { + to = hpeuxi_network_group_assignment.my_network_group_assignment + id = "" +} diff --git a/examples/resources/hpeuxi_network_group_assignment/resource.tf b/examples/resources/hpeuxi_network_group_assignment/resource.tf new file mode 100644 index 00000000..1433abad --- /dev/null +++ b/examples/resources/hpeuxi_network_group_assignment/resource.tf @@ -0,0 +1,4 @@ +resource "hpeuxi_network_group_assignment" "my_network_group_assignment" { + network_id = hpeuxi_wired_network.my_network.id + group_id = hpeuxi_group.my_group.id +} diff --git a/examples/resources/uxi_sensor/import.sh b/examples/resources/hpeuxi_sensor/import.sh similarity index 56% rename from examples/resources/uxi_sensor/import.sh rename to examples/resources/hpeuxi_sensor/import.sh index 159af3b1..24702415 100644 --- a/examples/resources/uxi_sensor/import.sh +++ b/examples/resources/hpeuxi_sensor/import.sh @@ -1,8 +1,8 @@ # Import sensor using its ID -terraform import uxi_sensor.my_sensor +terraform import hpeuxi_sensor.my_sensor # Import sensor using its ID with an import block import { - to = uxi_sensor.my_sensor + to = hpeuxi_sensor.my_sensor id = "" } diff --git a/examples/resources/uxi_sensor/resource.tf b/examples/resources/hpeuxi_sensor/resource.tf similarity index 83% rename from examples/resources/uxi_sensor/resource.tf rename to examples/resources/hpeuxi_sensor/resource.tf index ffb27797..8e2569f2 100644 --- a/examples/resources/uxi_sensor/resource.tf +++ b/examples/resources/hpeuxi_sensor/resource.tf @@ -1,4 +1,4 @@ -resource "uxi_sensor" "my_sensor" { +resource "hpeuxi_sensor" "my_sensor" { name = "name" address_note = "Example 3rd Floor" notes = "notes" diff --git a/examples/resources/hpeuxi_sensor_group_assignment/import.sh b/examples/resources/hpeuxi_sensor_group_assignment/import.sh new file mode 100644 index 00000000..9af296a2 --- /dev/null +++ b/examples/resources/hpeuxi_sensor_group_assignment/import.sh @@ -0,0 +1,8 @@ +# Import sensor group assignment using its ID +terraform import hpeuxi_sensor_group_assignment.my_sensor_group_assignment + +# Import sensor group assignment using its ID with an import block +import { + to = hpeuxi_sensor_group_assignment.my_sensor_group_assignment + id = "" +} diff --git a/examples/resources/hpeuxi_sensor_group_assignment/resource.tf b/examples/resources/hpeuxi_sensor_group_assignment/resource.tf new file mode 100644 index 00000000..f8ba57d4 --- /dev/null +++ b/examples/resources/hpeuxi_sensor_group_assignment/resource.tf @@ -0,0 +1,4 @@ +resource "hpeuxi_sensor_group_assignment" "my_sensor_group_assignment" { + sensor_id = hpeuxi_sensor.my_sensor.id + group_id = hpeuxi_group.my_group.id +} diff --git a/examples/resources/uxi_service_test/import.sh b/examples/resources/hpeuxi_service_test/import.sh similarity index 53% rename from examples/resources/uxi_service_test/import.sh rename to examples/resources/hpeuxi_service_test/import.sh index edc39975..a66d0e81 100644 --- a/examples/resources/uxi_service_test/import.sh +++ b/examples/resources/hpeuxi_service_test/import.sh @@ -1,8 +1,8 @@ # Import a service test using its ID -terraform import uxi_service_test.my_service_test +terraform import hpeuxi_service_test.my_service_test # Import a service test using its ID with an import block import { - to = uxi_service_test.my_service_test + to = hpeuxi_service_test.my_service_test id = "" } diff --git a/examples/resources/uxi_service_test/resource.tf b/examples/resources/hpeuxi_service_test/resource.tf similarity index 70% rename from examples/resources/uxi_service_test/resource.tf rename to examples/resources/hpeuxi_service_test/resource.tf index 48d6c765..787e0904 100644 --- a/examples/resources/uxi_service_test/resource.tf +++ b/examples/resources/hpeuxi_service_test/resource.tf @@ -1,4 +1,4 @@ -resource "uxi_service_test" "my_service_test" { +resource "hpeuxi_service_test" "my_service_test" { name = "name" # Deleting of service tests is not supported yet diff --git a/examples/resources/hpeuxi_service_test_group_assignment/import.sh b/examples/resources/hpeuxi_service_test_group_assignment/import.sh new file mode 100644 index 00000000..88178123 --- /dev/null +++ b/examples/resources/hpeuxi_service_test_group_assignment/import.sh @@ -0,0 +1,8 @@ +# Import service test group assignment using its ID +terraform import hpeuxi_service_test_group_assignment.my_service_test_group_assignment + +# Import service test group assignment using its ID with an import block +import { + to = hpeuxi_service_test_group_assignment.my_service_test_group_assignment + id = "" +} diff --git a/examples/resources/hpeuxi_service_test_group_assignment/resource.tf b/examples/resources/hpeuxi_service_test_group_assignment/resource.tf new file mode 100644 index 00000000..18083881 --- /dev/null +++ b/examples/resources/hpeuxi_service_test_group_assignment/resource.tf @@ -0,0 +1,4 @@ +resource "hpeuxi_service_test_group_assignment" "my_service_test_group_assignment" { + service_test_id = hpeuxi_service_test.my_service_test.id + group_id = hpeuxi_group.my_group.id +} diff --git a/examples/resources/uxi_wired_network/import.sh b/examples/resources/hpeuxi_wired_network/import.sh similarity index 53% rename from examples/resources/uxi_wired_network/import.sh rename to examples/resources/hpeuxi_wired_network/import.sh index ecbbffc5..a5342143 100644 --- a/examples/resources/uxi_wired_network/import.sh +++ b/examples/resources/hpeuxi_wired_network/import.sh @@ -1,8 +1,8 @@ # Import a wired network using its ID -terraform import uxi_wired_network.my_wired_network +terraform import hpeuxi_wired_network.my_wired_network # Import a wired network using its ID with an import block import { - to = uxi_wired_network.my_wired_network + to = hpeuxi_wired_network.my_wired_network id = "" } diff --git a/examples/resources/uxi_wired_network/resource.tf b/examples/resources/hpeuxi_wired_network/resource.tf similarity index 70% rename from examples/resources/uxi_wired_network/resource.tf rename to examples/resources/hpeuxi_wired_network/resource.tf index b9197202..59ee0bc5 100644 --- a/examples/resources/uxi_wired_network/resource.tf +++ b/examples/resources/hpeuxi_wired_network/resource.tf @@ -1,4 +1,4 @@ -resource "uxi_wired_network" "my_wired_network" { +resource "hpeuxi_wired_network" "my_wired_network" { name = "name" # Deleting of wired networks is not supported yet diff --git a/examples/resources/uxi_wireless_network/import.sh b/examples/resources/hpeuxi_wireless_network/import.sh similarity index 52% rename from examples/resources/uxi_wireless_network/import.sh rename to examples/resources/hpeuxi_wireless_network/import.sh index 25d90982..dbaf20a1 100644 --- a/examples/resources/uxi_wireless_network/import.sh +++ b/examples/resources/hpeuxi_wireless_network/import.sh @@ -1,8 +1,8 @@ # Import a wireless network using its ID -terraform import uxi_wireless_network.my_wireless_network +terraform import hpeuxi_wireless_network.my_wireless_network # Import a wireless network using its ID with an import block import { - to = uxi_wireless_network.my_wireless_network + to = hpeuxi_wireless_network.my_wireless_network id = "" } diff --git a/examples/resources/uxi_wireless_network/resource.tf b/examples/resources/hpeuxi_wireless_network/resource.tf similarity index 68% rename from examples/resources/uxi_wireless_network/resource.tf rename to examples/resources/hpeuxi_wireless_network/resource.tf index 813ca718..28830e85 100644 --- a/examples/resources/uxi_wireless_network/resource.tf +++ b/examples/resources/hpeuxi_wireless_network/resource.tf @@ -1,4 +1,4 @@ -resource "uxi_wireless_network" "my_wireless_network" { +resource "hpeuxi_wireless_network" "my_wireless_network" { name = "name" # Deleting of wireless networks is not supported yet diff --git a/examples/resources/uxi_agent_group_assignment/resource.tf b/examples/resources/uxi_agent_group_assignment/resource.tf deleted file mode 100644 index c3acf044..00000000 --- a/examples/resources/uxi_agent_group_assignment/resource.tf +++ /dev/null @@ -1,4 +0,0 @@ -resource "uxi_agent_group_assignment" "my_agent_group_assignment" { - agent_id = uxi_agent.my_agent.id - group_id = uxi_group.my_group.id -} diff --git a/examples/resources/uxi_network_group_assignment/import.sh b/examples/resources/uxi_network_group_assignment/import.sh deleted file mode 100644 index fda35aba..00000000 --- a/examples/resources/uxi_network_group_assignment/import.sh +++ /dev/null @@ -1,8 +0,0 @@ -# Import network group assignment using its ID -terraform import uxi_network_group_assignment.my_network_group_assignment - -# Import network group assignment using its ID with an import block -import { - to = uxi_network_group_assignment.my_network_group_assignment - id = "" -} diff --git a/examples/resources/uxi_network_group_assignment/resource.tf b/examples/resources/uxi_network_group_assignment/resource.tf deleted file mode 100644 index a31b5c1a..00000000 --- a/examples/resources/uxi_network_group_assignment/resource.tf +++ /dev/null @@ -1,4 +0,0 @@ -resource "uxi_network_group_assignment" "my_network_group_assignment" { - network_id = uxi_wired_network.my_network.id - group_id = uxi_group.my_group.id -} diff --git a/examples/resources/uxi_sensor_group_assignment/import.sh b/examples/resources/uxi_sensor_group_assignment/import.sh deleted file mode 100644 index 58616851..00000000 --- a/examples/resources/uxi_sensor_group_assignment/import.sh +++ /dev/null @@ -1,8 +0,0 @@ -# Import sensor group assignment using its ID -terraform import uxi_sensor_group_assignment.my_sensor_group_assignment - -# Import sensor group assignment using its ID with an import block -import { - to = uxi_sensor_group_assignment.my_sensor_group_assignment - id = "" -} diff --git a/examples/resources/uxi_sensor_group_assignment/resource.tf b/examples/resources/uxi_sensor_group_assignment/resource.tf deleted file mode 100644 index d8e63e2d..00000000 --- a/examples/resources/uxi_sensor_group_assignment/resource.tf +++ /dev/null @@ -1,4 +0,0 @@ -resource "uxi_sensor_group_assignment" "my_sensor_group_assignment" { - sensor_id = uxi_sensor.my_sensor.id - group_id = uxi_group.my_group.id -} diff --git a/examples/resources/uxi_service_test_group_assignment/import.sh b/examples/resources/uxi_service_test_group_assignment/import.sh deleted file mode 100644 index e12252e0..00000000 --- a/examples/resources/uxi_service_test_group_assignment/import.sh +++ /dev/null @@ -1,8 +0,0 @@ -# Import service test group assignment using its ID -terraform import uxi_service_test_group_assignment.my_service_test_group_assignment - -# Import service test group assignment using its ID with an import block -import { - to = uxi_service_test_group_assignment.my_service_test_group_assignment - id = "" -} diff --git a/examples/resources/uxi_service_test_group_assignment/resource.tf b/examples/resources/uxi_service_test_group_assignment/resource.tf deleted file mode 100644 index 6498d615..00000000 --- a/examples/resources/uxi_service_test_group_assignment/resource.tf +++ /dev/null @@ -1,4 +0,0 @@ -resource "uxi_service_test_group_assignment" "my_service_test_group_assignment" { - service_test_id = uxi_service_test.my_service_test.id - group_id = uxi_group.my_group.id -} diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 0f1cdcbc..ffa82667 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -23,38 +23,38 @@ import ( "golang.org/x/oauth2/clientcredentials" ) -var _ provider.Provider = &uxiConfigurationProvider{} +var _ provider.Provider = &hpeuxiConfigurationProvider{} func New(version string) func() provider.Provider { return func() provider.Provider { - return &uxiConfigurationProvider{ + return &hpeuxiConfigurationProvider{ version: version, } } } -type uxiProviderModel struct { +type hpeuxiProviderModel struct { ClientID types.String `tfsdk:"client_id"` ClientSecret types.String `tfsdk:"client_secret"` } -type uxiConfigurationProvider struct { +type hpeuxiConfigurationProvider struct { // version is set to the provider version on release, "dev" when the // provider is built and ran locally, and "test" when running acceptance // testing. version string } -func (p *uxiConfigurationProvider) Metadata( +func (p *hpeuxiConfigurationProvider) Metadata( _ context.Context, _ provider.MetadataRequest, resp *provider.MetadataResponse, ) { - resp.TypeName = "uxi" + resp.TypeName = "hpeuxi" resp.Version = p.version } -func (p *uxiConfigurationProvider) Schema( +func (p *hpeuxiConfigurationProvider) Schema( _ context.Context, _ provider.SchemaRequest, resp *provider.SchemaResponse, @@ -79,13 +79,13 @@ func (p *uxiConfigurationProvider) Schema( } } -func (p *uxiConfigurationProvider) Configure( +func (p *hpeuxiConfigurationProvider) Configure( ctx context.Context, req provider.ConfigureRequest, resp *provider.ConfigureResponse, ) { var ( - config uxiProviderModel + config hpeuxiProviderModel clientID, clientSecret string ) diags := req.Config.Get(ctx, &config) @@ -132,17 +132,19 @@ func (p *uxiConfigurationProvider) Configure( return } - uxiConfiguration := config_api_client.NewConfiguration() - uxiConfiguration.Host = configuration.Host - uxiConfiguration.Scheme = "https" - uxiConfiguration.HTTPClient = getHTTPClient(clientID, clientSecret, configuration.TokenURL) - uxiClient := config_api_client.NewAPIClient(uxiConfiguration) + hpeuxiConfiguration := config_api_client.NewConfiguration() + hpeuxiConfiguration.Host = configuration.Host + hpeuxiConfiguration.Scheme = "https" + hpeuxiConfiguration.HTTPClient = getHTTPClient(clientID, clientSecret, configuration.TokenURL) + uxiClient := config_api_client.NewAPIClient(hpeuxiConfiguration) resp.DataSourceData = uxiClient resp.ResourceData = uxiClient } -func (p *uxiConfigurationProvider) DataSources(_ context.Context) []func() datasource.DataSource { +func (p *hpeuxiConfigurationProvider) DataSources( + _ context.Context, +) []func() datasource.DataSource { return []func() datasource.DataSource{ resources.NewAgentDataSource, resources.NewAgentGroupAssignmentDataSource, @@ -157,7 +159,7 @@ func (p *uxiConfigurationProvider) DataSources(_ context.Context) []func() datas } } -func (p *uxiConfigurationProvider) Resources(_ context.Context) []func() resource.Resource { +func (p *hpeuxiConfigurationProvider) Resources(_ context.Context) []func() resource.Resource { return []func() resource.Resource{ resources.NewAgentGroupAssignmentResource, resources.NewAgentResource, diff --git a/internal/provider/resources/data_source_agent.go b/internal/provider/resources/data_source_agent.go index d0acb2d6..0ec4f378 100644 --- a/internal/provider/resources/data_source_agent.go +++ b/internal/provider/resources/data_source_agent.go @@ -123,7 +123,7 @@ func (d *agentDataSource) Read( agentResponse, response, err := util.RetryForTooManyRequests(request.Execute) errorPresent, errorDetail := util.RaiseForStatus(response, err) - errorSummary := util.GenerateErrorSummary("read", "uxi_agent") + errorSummary := util.GenerateErrorSummary("read", "hpeuxi_agent") if errorPresent { resp.Diagnostics.AddError(errorSummary, errorDetail) diff --git a/internal/provider/resources/data_source_agent_group_assignment.go b/internal/provider/resources/data_source_agent_group_assignment.go index 1a70cf9e..af115cc9 100644 --- a/internal/provider/resources/data_source_agent_group_assignment.go +++ b/internal/provider/resources/data_source_agent_group_assignment.go @@ -97,7 +97,7 @@ func (d *agentGroupAssignmentDataSource) Read( Id(state.Filter.ID) agentGroupAssignmentResponse, response, err := util.RetryForTooManyRequests(request.Execute) errorPresent, errorDetail := util.RaiseForStatus(response, err) - errorSummary := util.GenerateErrorSummary("read", "uxi_agent_group_assignment") + errorSummary := util.GenerateErrorSummary("read", "hpeuxi_agent_group_assignment") if errorPresent { resp.Diagnostics.AddError(errorSummary, errorDetail) diff --git a/internal/provider/resources/data_source_group.go b/internal/provider/resources/data_source_group.go index 856cd888..256f90e0 100644 --- a/internal/provider/resources/data_source_group.go +++ b/internal/provider/resources/data_source_group.go @@ -103,7 +103,7 @@ func (d *groupDataSource) Read( groupResponse, response, err := util.RetryForTooManyRequests(request.Execute) errorPresent, errorDetail := util.RaiseForStatus(response, err) - errorSummary := util.GenerateErrorSummary("read", "uxi_group") + errorSummary := util.GenerateErrorSummary("read", "hpeuxi_group") if errorPresent { resp.Diagnostics.AddError(errorSummary, errorDetail) diff --git a/internal/provider/resources/data_source_network_group_assignment.go b/internal/provider/resources/data_source_network_group_assignment.go index 485c3062..6a598e83 100644 --- a/internal/provider/resources/data_source_network_group_assignment.go +++ b/internal/provider/resources/data_source_network_group_assignment.go @@ -97,7 +97,7 @@ func (d *networkGroupAssignmentDataSource) Read( Id(state.Filter.ID) networkGroupAssignmentResponse, response, err := util.RetryForTooManyRequests(request.Execute) errorPresent, errorDetail := util.RaiseForStatus(response, err) - errorSummary := util.GenerateErrorSummary("read", "uxi_network_group_assignment") + errorSummary := util.GenerateErrorSummary("read", "hpeuxi_network_group_assignment") if errorPresent { resp.Diagnostics.AddError(errorSummary, errorDetail) diff --git a/internal/provider/resources/data_source_sensor.go b/internal/provider/resources/data_source_sensor.go index fb2ce12b..0cc0b3f8 100644 --- a/internal/provider/resources/data_source_sensor.go +++ b/internal/provider/resources/data_source_sensor.go @@ -138,7 +138,7 @@ func (d *sensorDataSource) Read( sensorResponse, response, err := util.RetryForTooManyRequests(request.Execute) errorPresent, errorDetail := util.RaiseForStatus(response, err) - errorSummary := util.GenerateErrorSummary("read", "uxi_sensor") + errorSummary := util.GenerateErrorSummary("read", "hpeuxi_sensor") if errorPresent { resp.Diagnostics.AddError(errorSummary, errorDetail) diff --git a/internal/provider/resources/data_source_sensor_group_assignment.go b/internal/provider/resources/data_source_sensor_group_assignment.go index 72fc153c..9ab27879 100644 --- a/internal/provider/resources/data_source_sensor_group_assignment.go +++ b/internal/provider/resources/data_source_sensor_group_assignment.go @@ -97,7 +97,7 @@ func (d *sensorGroupAssignmentDataSource) Read( Id(state.Filter.ID) sensorGroupAssignmentResponse, response, err := util.RetryForTooManyRequests(request.Execute) errorPresent, errorDetail := util.RaiseForStatus(response, err) - errorSummary := util.GenerateErrorSummary("read", "uxi_sensor_group_assignment") + errorSummary := util.GenerateErrorSummary("read", "hpeuxi_sensor_group_assignment") if errorPresent { resp.Diagnostics.AddError(errorSummary, errorDetail) diff --git a/internal/provider/resources/data_source_service.go b/internal/provider/resources/data_source_service.go index d2749cc8..9f478a67 100644 --- a/internal/provider/resources/data_source_service.go +++ b/internal/provider/resources/data_source_service.go @@ -116,7 +116,7 @@ func (d *serviceTestDataSource) Read( serviceTestResponse, response, err := util.RetryForTooManyRequests(request.Execute) errorPresent, errorDetail := util.RaiseForStatus(response, err) - errorSummary := util.GenerateErrorSummary("read", "uxi_service_test") + errorSummary := util.GenerateErrorSummary("read", "hpeuxi_service_test") if errorPresent { resp.Diagnostics.AddError(errorSummary, errorDetail) diff --git a/internal/provider/resources/data_source_service_test_group_assignment.go b/internal/provider/resources/data_source_service_test_group_assignment.go index 71f32e9a..29cdd6eb 100644 --- a/internal/provider/resources/data_source_service_test_group_assignment.go +++ b/internal/provider/resources/data_source_service_test_group_assignment.go @@ -99,7 +99,7 @@ func (d *serviceTestGroupAssignmentDataSource) Read( request.Execute, ) errorPresent, errorDetail := util.RaiseForStatus(response, err) - errorSummary := util.GenerateErrorSummary("read", "uxi_service_test_group_assignment") + errorSummary := util.GenerateErrorSummary("read", "hpeuxi_service_test_group_assignment") if errorPresent { resp.Diagnostics.AddError(errorSummary, errorDetail) diff --git a/internal/provider/resources/data_source_wired_network.go b/internal/provider/resources/data_source_wired_network.go index 2998aa03..fc84d3d4 100644 --- a/internal/provider/resources/data_source_wired_network.go +++ b/internal/provider/resources/data_source_wired_network.go @@ -127,7 +127,7 @@ func (d *wiredNetworkDataSource) Read( Id(state.Filter.ID) networkResponse, response, err := util.RetryForTooManyRequests(request.Execute) errorPresent, errorDetail := util.RaiseForStatus(response, err) - errorSummary := util.GenerateErrorSummary("read", "uxi_wired_network") + errorSummary := util.GenerateErrorSummary("read", "hpeuxi_wired_network") if errorPresent { resp.Diagnostics.AddError(errorSummary, errorDetail) diff --git a/internal/provider/resources/data_source_wireless_network.go b/internal/provider/resources/data_source_wireless_network.go index 8a6d31e3..021f004a 100644 --- a/internal/provider/resources/data_source_wireless_network.go +++ b/internal/provider/resources/data_source_wireless_network.go @@ -137,7 +137,7 @@ func (d *wirelessNetworkDataSource) Read( Id(state.Filter.ID) networkResponse, response, err := util.RetryForTooManyRequests(request.Execute) errorPresent, errorDetail := util.RaiseForStatus(response, err) - errorSummary := util.GenerateErrorSummary("read", "uxi_wireless_network") + errorSummary := util.GenerateErrorSummary("read", "hpeuxi_wireless_network") if errorPresent { resp.Diagnostics.AddError(errorSummary, errorDetail) diff --git a/internal/provider/resources/resource_agent.go b/internal/provider/resources/resource_agent.go index fd5a1837..62aebab6 100644 --- a/internal/provider/resources/resource_agent.go +++ b/internal/provider/resources/resource_agent.go @@ -154,7 +154,7 @@ func (r *agentResource) Read( Id(state.ID.ValueString()) agentResponse, response, err := util.RetryForTooManyRequests(request.Execute) errorPresent, errorDetail := util.RaiseForStatus(response, err) - errorSummary := util.GenerateErrorSummary("read", "uxi_agent") + errorSummary := util.GenerateErrorSummary("read", "hpeuxi_agent") if errorPresent { resp.Diagnostics.AddError(errorSummary, errorDetail) @@ -199,7 +199,7 @@ func (r *agentResource) Update( return } - errorSummary := util.GenerateErrorSummary("update", "uxi_agent") + errorSummary := util.GenerateErrorSummary("update", "hpeuxi_agent") patchRequest := config_api_client.NewAgentsPatchRequest() patchRequest.Name = plan.Name.ValueStringPointer() if !plan.Notes.IsUnknown() { @@ -269,7 +269,7 @@ func (r *agentResource) Delete( return } - resp.Diagnostics.AddError(util.GenerateErrorSummary("delete", "uxi_agent"), errorDetail) + resp.Diagnostics.AddError(util.GenerateErrorSummary("delete", "hpeuxi_agent"), errorDetail) return } diff --git a/internal/provider/resources/resource_agent_group_assignment.go b/internal/provider/resources/resource_agent_group_assignment.go index ca046677..98e70bec 100644 --- a/internal/provider/resources/resource_agent_group_assignment.go +++ b/internal/provider/resources/resource_agent_group_assignment.go @@ -131,7 +131,7 @@ func (r *agentGroupAssignmentResource) Create( errorPresent, errorDetail := util.RaiseForStatus(response, err) if errorPresent { resp.Diagnostics.AddError( - util.GenerateErrorSummary("create", "uxi_agent_group_assignment"), + util.GenerateErrorSummary("create", "hpeuxi_agent_group_assignment"), errorDetail, ) @@ -168,7 +168,7 @@ func (r *agentGroupAssignmentResource) Read( Id(state.ID.ValueString()) agentGroupAssignmentResponse, response, err := util.RetryForTooManyRequests(request.Execute) errorPresent, errorDetail := util.RaiseForStatus(response, err) - errorSummary := util.GenerateErrorSummary("read", "uxi_agent_group_assignment") + errorSummary := util.GenerateErrorSummary("read", "hpeuxi_agent_group_assignment") if errorPresent { resp.Diagnostics.AddError(errorSummary, errorDetail) @@ -233,7 +233,7 @@ func (r *agentGroupAssignmentResource) Delete( return } resp.Diagnostics.AddError( - util.GenerateErrorSummary("delete", "uxi_agent_group_assignment"), + util.GenerateErrorSummary("delete", "hpeuxi_agent_group_assignment"), errorDetail, ) diff --git a/internal/provider/resources/resource_group.go b/internal/provider/resources/resource_group.go index b35d0178..85b47ce8 100644 --- a/internal/provider/resources/resource_group.go +++ b/internal/provider/resources/resource_group.go @@ -70,7 +70,7 @@ func (r *groupResource) Schema( }, "parent_group_id": schema.StringAttribute{ Description: "The identifier of the parent of this group. " + - "Use uxi_group resource or datasource id for this attribute. " + + "Use hpeuxi_group resource or datasource id for this attribute. " + "Alternatively leave blank to set group to highest level configurable node.", Optional: true, PlanModifiers: []planmodifier.String{ @@ -127,7 +127,7 @@ func (r *groupResource) Create( group, response, err := util.RetryForTooManyRequests(request.Execute) errorPresent, errorDetail := util.RaiseForStatus(response, err) if errorPresent { - resp.Diagnostics.AddError(util.GenerateErrorSummary("create", "uxi_group"), errorDetail) + resp.Diagnostics.AddError(util.GenerateErrorSummary("create", "hpeuxi_group"), errorDetail) return } @@ -163,7 +163,7 @@ func (r *groupResource) Read( group, errorDetail := r.getGroup(ctx, state.ID.ValueString()) - errorSummary := util.GenerateErrorSummary("read", "uxi_group") + errorSummary := util.GenerateErrorSummary("read", "hpeuxi_group") if errorDetail != nil { if errorDetail.Error() == groupNotFoundError { @@ -218,7 +218,7 @@ func (r *groupResource) Update( group, response, err := util.RetryForTooManyRequests(request.Execute) errorPresent, errorDetail := util.RaiseForStatus(response, err) if errorPresent { - resp.Diagnostics.AddError(util.GenerateErrorSummary("update", "uxi_group"), errorDetail) + resp.Diagnostics.AddError(util.GenerateErrorSummary("update", "hpeuxi_group"), errorDetail) return } @@ -262,7 +262,7 @@ func (r *groupResource) Delete( return } - resp.Diagnostics.AddError(util.GenerateErrorSummary("delete", "uxi_group"), errorDetail) + resp.Diagnostics.AddError(util.GenerateErrorSummary("delete", "hpeuxi_group"), errorDetail) return } diff --git a/internal/provider/resources/resource_network_group_assignment.go b/internal/provider/resources/resource_network_group_assignment.go index 40d1ea93..81728008 100644 --- a/internal/provider/resources/resource_network_group_assignment.go +++ b/internal/provider/resources/resource_network_group_assignment.go @@ -134,7 +134,7 @@ func (r *networkGroupAssignmentResource) Create( errorPresent, errorDetail := util.RaiseForStatus(response, err) if errorPresent { resp.Diagnostics.AddError( - util.GenerateErrorSummary("create", "uxi_network_group_assignment"), + util.GenerateErrorSummary("create", "hpeuxi_network_group_assignment"), errorDetail, ) @@ -171,7 +171,7 @@ func (r *networkGroupAssignmentResource) Read( Id(state.ID.ValueString()) networkGroupAssignmentResponse, response, err := util.RetryForTooManyRequests(request.Execute) errorPresent, errorDetail := util.RaiseForStatus(response, err) - errorSummary := util.GenerateErrorSummary("read", "uxi_network_group_assignment") + errorSummary := util.GenerateErrorSummary("read", "hpeuxi_network_group_assignment") if errorPresent { resp.Diagnostics.AddError(errorSummary, errorDetail) @@ -239,7 +239,7 @@ func (r *networkGroupAssignmentResource) Delete( return } resp.Diagnostics.AddError( - util.GenerateErrorSummary("delete", "uxi_network_group_assignment"), + util.GenerateErrorSummary("delete", "hpeuxi_network_group_assignment"), errorDetail, ) diff --git a/internal/provider/resources/resource_sensor.go b/internal/provider/resources/resource_sensor.go index 2386d8e7..3e6240eb 100644 --- a/internal/provider/resources/resource_sensor.go +++ b/internal/provider/resources/resource_sensor.go @@ -172,7 +172,7 @@ func (r *sensorResource) Read( Id(state.ID.ValueString()) sensorResponse, response, err := util.RetryForTooManyRequests(request.Execute) errorPresent, errorDetail := util.RaiseForStatus(response, err) - errorSummary := util.GenerateErrorSummary("read", "uxi_sensor") + errorSummary := util.GenerateErrorSummary("read", "hpeuxi_sensor") if errorPresent { resp.Diagnostics.AddError(errorSummary, errorDetail) @@ -220,7 +220,7 @@ func (r *sensorResource) Update( return } - errorSummary := util.GenerateErrorSummary("update", "uxi_sensor") + errorSummary := util.GenerateErrorSummary("update", "hpeuxi_sensor") patchRequest := config_api_client.NewSensorsPatchRequest() patchRequest.Name = plan.Name.ValueStringPointer() patchRequest.AddressNote = plan.AddressNote.ValueStringPointer() diff --git a/internal/provider/resources/resource_sensor_group_assignment.go b/internal/provider/resources/resource_sensor_group_assignment.go index a218ef7e..469aa66b 100644 --- a/internal/provider/resources/resource_sensor_group_assignment.go +++ b/internal/provider/resources/resource_sensor_group_assignment.go @@ -131,7 +131,7 @@ func (r *sensorGroupAssignmentResource) Create( errorPresent, errorDetail := util.RaiseForStatus(response, err) if errorPresent { resp.Diagnostics.AddError( - util.GenerateErrorSummary("create", "uxi_sensor_group_assignment"), + util.GenerateErrorSummary("create", "hpeuxi_sensor_group_assignment"), errorDetail, ) @@ -168,7 +168,7 @@ func (r *sensorGroupAssignmentResource) Read( Id(state.ID.ValueString()) sensorGroupAssignmentResponse, response, err := util.RetryForTooManyRequests(request.Execute) errorPresent, errorDetail := util.RaiseForStatus(response, err) - errorSummary := util.GenerateErrorSummary("read", "uxi_sensor_group_assignment") + errorSummary := util.GenerateErrorSummary("read", "hpeuxi_sensor_group_assignment") if errorPresent { resp.Diagnostics.AddError(errorSummary, errorDetail) @@ -234,7 +234,7 @@ func (r *sensorGroupAssignmentResource) Delete( return } resp.Diagnostics.AddError( - util.GenerateErrorSummary("delete", "uxi_sensor_group_assignment"), + util.GenerateErrorSummary("delete", "hpeuxi_sensor_group_assignment"), errorDetail, ) diff --git a/internal/provider/resources/resource_service.go b/internal/provider/resources/resource_service.go index 26716fa9..fe38f58a 100644 --- a/internal/provider/resources/resource_service.go +++ b/internal/provider/resources/resource_service.go @@ -144,7 +144,7 @@ func (r *serviceTestResource) Read( Id(state.ID.ValueString()) sensorResponse, response, err := util.RetryForTooManyRequests(request.Execute) errorPresent, errorDetail := util.RaiseForStatus(response, err) - errorSummary := util.GenerateErrorSummary("read", "uxi_service_test") + errorSummary := util.GenerateErrorSummary("read", "hpeuxi_service_test") if errorPresent { resp.Diagnostics.AddError(errorSummary, errorDetail) diff --git a/internal/provider/resources/resource_service_group_assignment.go b/internal/provider/resources/resource_service_group_assignment.go index f008281a..7e5ba43e 100644 --- a/internal/provider/resources/resource_service_group_assignment.go +++ b/internal/provider/resources/resource_service_group_assignment.go @@ -131,7 +131,7 @@ func (r *serviceTestGroupAssignmentResource) Create( errorPresent, errorDetail := util.RaiseForStatus(response, err) if errorPresent { resp.Diagnostics.AddError( - util.GenerateErrorSummary("create", "uxi_service_test_group_assignment"), + util.GenerateErrorSummary("create", "hpeuxi_service_test_group_assignment"), errorDetail, ) @@ -170,7 +170,7 @@ func (r *serviceTestGroupAssignmentResource) Read( request.Execute, ) errorPresent, errorDetail := util.RaiseForStatus(response, err) - errorSummary := util.GenerateErrorSummary("read", "uxi_service_test_group_assignment") + errorSummary := util.GenerateErrorSummary("read", "hpeuxi_service_test_group_assignment") if errorPresent { resp.Diagnostics.AddError(errorSummary, errorDetail) @@ -239,7 +239,7 @@ func (r *serviceTestGroupAssignmentResource) Delete( return } resp.Diagnostics.AddError( - util.GenerateErrorSummary("delete", "uxi_service_test_group_assignment"), + util.GenerateErrorSummary("delete", "hpeuxi_service_test_group_assignment"), errorDetail, ) diff --git a/internal/provider/resources/resource_wired_network.go b/internal/provider/resources/resource_wired_network.go index a174f319..1cacc7fc 100644 --- a/internal/provider/resources/resource_wired_network.go +++ b/internal/provider/resources/resource_wired_network.go @@ -156,7 +156,7 @@ func (r *wiredNetworkResource) Read( Id(state.ID.ValueString()) networkResponse, response, err := util.RetryForTooManyRequests(request.Execute) errorPresent, errorDetail := util.RaiseForStatus(response, err) - errorSummary := util.GenerateErrorSummary("read", "uxi_wired_network") + errorSummary := util.GenerateErrorSummary("read", "hpeuxi_wired_network") if errorPresent { resp.Diagnostics.AddError(errorSummary, errorDetail) diff --git a/internal/provider/resources/resource_wireless_network.go b/internal/provider/resources/resource_wireless_network.go index 5f622e47..8da5b48a 100644 --- a/internal/provider/resources/resource_wireless_network.go +++ b/internal/provider/resources/resource_wireless_network.go @@ -167,7 +167,7 @@ func (r *wirelessNetworkResource) Read( Id(state.ID.ValueString()) networkResponse, response, err := util.RetryForTooManyRequests(request.Execute) errorPresent, errorDetail := util.RaiseForStatus(response, err) - errorSummary := util.GenerateErrorSummary("read", "uxi_wireless_network") + errorSummary := util.GenerateErrorSummary("read", "hpeuxi_wireless_network") if errorPresent { resp.Diagnostics.AddError(errorSummary, errorDetail) diff --git a/test/live/datasources/agent_group_assignment_test.go b/test/live/datasources/agent_group_assignment_test.go index 4a60702d..a71876af 100644 --- a/test/live/datasources/agent_group_assignment_test.go +++ b/test/live/datasources/agent_group_assignment_test.go @@ -24,36 +24,36 @@ func TestAgentGroupAssignmentDataSource(t *testing.T) { { Config: provider.ProviderConfig + ` // create the resource to be used as a datasource - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "` + groupName + `" } - data "uxi_agent" "my_agent" { + data "hpeuxi_agent" "my_agent" { filter = { id = "` + config.AgentPermanentID + `" } } - resource "uxi_agent_group_assignment" "my_agent_group_assignment" { - agent_id = data.uxi_agent.my_agent.id - group_id = uxi_group.my_group.id + resource "hpeuxi_agent_group_assignment" "my_agent_group_assignment" { + agent_id = data.hpeuxi_agent.my_agent.id + group_id = hpeuxi_group.my_group.id } // the actual datasource - data "uxi_agent_group_assignment" "my_agent_group_assignment" { + data "hpeuxi_agent_group_assignment" "my_agent_group_assignment" { filter = { - id = uxi_agent_group_assignment.my_agent_group_assignment.id + id = hpeuxi_agent_group_assignment.my_agent_group_assignment.id } } `, Check: resource.ComposeTestCheckFunc( func(s *terraform.State) error { - resourceName := "uxi_agent_group_assignment.my_agent_group_assignment" + resourceName := "hpeuxi_agent_group_assignment.my_agent_group_assignment" rs := s.RootModule().Resources[resourceName] return util.CheckStateAgainstAgentGroupAssignment( t, - "data.uxi_agent_group_assignment.my_agent_group_assignment", + "data.hpeuxi_agent_group_assignment.my_agent_group_assignment", *util.GetAgentGroupAssignment(rs.Primary.ID), )(s) }, diff --git a/test/live/datasources/agent_test.go b/test/live/datasources/agent_test.go index f6ab3552..4b2c518e 100644 --- a/test/live/datasources/agent_test.go +++ b/test/live/datasources/agent_test.go @@ -23,13 +23,13 @@ func TestAgentDataSource(t *testing.T) { Steps: []resource.TestStep{ { Config: provider.ProviderConfig + ` - data "uxi_agent" "my_agent" { + data "hpeuxi_agent" "my_agent" { filter = { id = "` + config.AgentPermanentID + `" } } `, - Check: shared.CheckStateAgainstAgent(t, "data.uxi_agent.my_agent", agent), + Check: shared.CheckStateAgainstAgent(t, "data.hpeuxi_agent.my_agent", agent), }, }, }) diff --git a/test/live/datasources/group_test.go b/test/live/datasources/group_test.go index d601a5ea..83939d29 100644 --- a/test/live/datasources/group_test.go +++ b/test/live/datasources/group_test.go @@ -24,7 +24,7 @@ func TestGroupDataSource(t *testing.T) { Steps: []resource.TestStep{ { Config: provider.ProviderConfig + ` - data "uxi_group" "my_group" { + data "hpeuxi_group" "my_group" { filter = { id = "` + config.GroupIDRoot + `" } @@ -35,19 +35,19 @@ func TestGroupDataSource(t *testing.T) { { Config: provider.ProviderConfig + ` // create the resource to use subsequently as datasource - resource "uxi_group" "my_group_resource" { + resource "hpeuxi_group" "my_group_resource" { name = "` + groupName + `" } - data "uxi_group" "my_group" { + data "hpeuxi_group" "my_group" { filter = { - id = uxi_group.my_group_resource.id + id = hpeuxi_group.my_group_resource.id } } `, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttrWith( - "data.uxi_group.my_group", + "data.hpeuxi_group.my_group", "id", func(value string) error { assert.Equal(t, value, util.GetGroupByName(groupName).Id) @@ -55,9 +55,9 @@ func TestGroupDataSource(t *testing.T) { return nil }, ), - resource.TestCheckResourceAttr("data.uxi_group.my_group", "name", groupName), + resource.TestCheckResourceAttr("data.hpeuxi_group.my_group", "name", groupName), resource.TestCheckResourceAttrWith( - "data.uxi_group.my_group", + "data.hpeuxi_group.my_group", "path", func(value string) error { assert.Equal(t, value, util.GetGroupByName(groupName).Path) @@ -66,7 +66,7 @@ func TestGroupDataSource(t *testing.T) { }, ), resource.TestCheckResourceAttr( - "data.uxi_group.my_group", + "data.hpeuxi_group.my_group", "parent_group_id", config.GroupIDRoot, ), diff --git a/test/live/datasources/network_group_assignment_test.go b/test/live/datasources/network_group_assignment_test.go index e8706a46..16ddb474 100644 --- a/test/live/datasources/network_group_assignment_test.go +++ b/test/live/datasources/network_group_assignment_test.go @@ -24,36 +24,36 @@ func TestNetworkGroupAssignmentDataSource(t *testing.T) { { Config: provider.ProviderConfig + ` // create the resource to be used as a datasource - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "` + groupName + `" } - data "uxi_wired_network" "my_network" { + data "hpeuxi_wired_network" "my_network" { filter = { id = "` + config.WiredNetworkID + `" } } - resource "uxi_network_group_assignment" "my_network_group_assignment" { - network_id = data.uxi_wired_network.my_network.id - group_id = uxi_group.my_group.id + resource "hpeuxi_network_group_assignment" "my_network_group_assignment" { + network_id = data.hpeuxi_wired_network.my_network.id + group_id = hpeuxi_group.my_group.id } // the actual datasource - data "uxi_network_group_assignment" "my_network_group_assignment" { + data "hpeuxi_network_group_assignment" "my_network_group_assignment" { filter = { - id = uxi_network_group_assignment.my_network_group_assignment.id + id = hpeuxi_network_group_assignment.my_network_group_assignment.id } } `, Check: resource.ComposeTestCheckFunc( func(s *terraform.State) error { - resourceName := "uxi_network_group_assignment.my_network_group_assignment" + resourceName := "hpeuxi_network_group_assignment.my_network_group_assignment" rs := s.RootModule().Resources[resourceName] return util.CheckStateAgainstNetworkGroupAssignment( t, - "data.uxi_network_group_assignment.my_network_group_assignment", + "data.hpeuxi_network_group_assignment.my_network_group_assignment", util.GetNetworkGroupAssignment(rs.Primary.ID), )(s) }, diff --git a/test/live/datasources/sensor_group_assignment_test.go b/test/live/datasources/sensor_group_assignment_test.go index c0a4d181..b019f245 100644 --- a/test/live/datasources/sensor_group_assignment_test.go +++ b/test/live/datasources/sensor_group_assignment_test.go @@ -24,36 +24,36 @@ func TestSensorGroupAssignmentDataSource(t *testing.T) { { Config: provider.ProviderConfig + ` // create the resource to be used as a datasource - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "` + groupName + `" } - data "uxi_sensor" "my_sensor" { + data "hpeuxi_sensor" "my_sensor" { filter = { id = "` + config.SensorID + `" } } - resource "uxi_sensor_group_assignment" "my_sensor_group_assignment" { - sensor_id = data.uxi_sensor.my_sensor.id - group_id = uxi_group.my_group.id + resource "hpeuxi_sensor_group_assignment" "my_sensor_group_assignment" { + sensor_id = data.hpeuxi_sensor.my_sensor.id + group_id = hpeuxi_group.my_group.id } // the actual datasource - data "uxi_sensor_group_assignment" "my_sensor_group_assignment" { + data "hpeuxi_sensor_group_assignment" "my_sensor_group_assignment" { filter = { - id = uxi_sensor_group_assignment.my_sensor_group_assignment.id + id = hpeuxi_sensor_group_assignment.my_sensor_group_assignment.id } } `, Check: resource.ComposeTestCheckFunc( func(s *terraform.State) error { - resourceName := "uxi_sensor_group_assignment.my_sensor_group_assignment" + resourceName := "hpeuxi_sensor_group_assignment.my_sensor_group_assignment" rs := s.RootModule().Resources[resourceName] return util.CheckStateAgainstSensorGroupAssignment( t, - "data.uxi_sensor_group_assignment.my_sensor_group_assignment", + "data.hpeuxi_sensor_group_assignment.my_sensor_group_assignment", util.GetSensorGroupAssignment(rs.Primary.ID), )(s) }, diff --git a/test/live/datasources/sensor_test.go b/test/live/datasources/sensor_test.go index f136c81c..2e505f97 100644 --- a/test/live/datasources/sensor_test.go +++ b/test/live/datasources/sensor_test.go @@ -22,13 +22,13 @@ func TestSensorDataSource(t *testing.T) { Steps: []resource.TestStep{ { Config: provider.ProviderConfig + ` - data "uxi_sensor" "my_sensor" { + data "hpeuxi_sensor" "my_sensor" { filter = { id = "` + config.SensorID + `" } } `, - Check: shared.CheckStateAgainstSensor(t, "data.uxi_sensor.my_sensor", sensor), + Check: shared.CheckStateAgainstSensor(t, "data.hpeuxi_sensor.my_sensor", sensor), }, }, }) diff --git a/test/live/datasources/service_test.go b/test/live/datasources/service_test.go index a9194cc0..2bd87089 100644 --- a/test/live/datasources/service_test.go +++ b/test/live/datasources/service_test.go @@ -23,7 +23,7 @@ func TestServiceTestDataSource(t *testing.T) { Steps: []resource.TestStep{ { Config: provider.ProviderConfig + ` - data "uxi_service_test" "my_service_test" { + data "hpeuxi_service_test" "my_service_test" { filter = { id = "` + config.ServiceTestID + `" } @@ -31,7 +31,7 @@ func TestServiceTestDataSource(t *testing.T) { `, Check: shared.CheckStateAgainstServiceTest( t, - "data.uxi_service_test.my_service_test", + "data.hpeuxi_service_test.my_service_test", serviceTest, ), }, diff --git a/test/live/datasources/service_test_group_assignment_test.go b/test/live/datasources/service_test_group_assignment_test.go index 9169d4a6..9f4a6885 100644 --- a/test/live/datasources/service_test_group_assignment_test.go +++ b/test/live/datasources/service_test_group_assignment_test.go @@ -24,36 +24,36 @@ func TestServiceTestGroupAssignmentDataSource(t *testing.T) { { Config: provider.ProviderConfig + ` // create the resource to be used as a datasource - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "` + groupName + `" } - data "uxi_service_test" "my_service_test" { + data "hpeuxi_service_test" "my_service_test" { filter = { id = "` + config.ServiceTestID + `" } } - resource "uxi_service_test_group_assignment" "my_service_test_group_assignment" { - service_test_id = data.uxi_service_test.my_service_test.id - group_id = uxi_group.my_group.id + resource "hpeuxi_service_test_group_assignment" "my_service_test_group_assignment" { + service_test_id = data.hpeuxi_service_test.my_service_test.id + group_id = hpeuxi_group.my_group.id } // the actual datasource - data "uxi_service_test_group_assignment" "my_service_test_group_assignment" { + data "hpeuxi_service_test_group_assignment" "my_service_test_group_assignment" { filter = { - id = uxi_service_test_group_assignment.my_service_test_group_assignment.id + id = hpeuxi_service_test_group_assignment.my_service_test_group_assignment.id } } `, Check: resource.ComposeTestCheckFunc( func(s *terraform.State) error { - resourceName := "uxi_service_test_group_assignment.my_service_test_group_assignment" + resourceName := "hpeuxi_service_test_group_assignment.my_service_test_group_assignment" rs := s.RootModule().Resources[resourceName] return util.CheckStateAgainstServiceTestGroupAssignment( t, - "data.uxi_service_test_group_assignment.my_service_test_group_assignment", + "data.hpeuxi_service_test_group_assignment.my_service_test_group_assignment", util.GetServiceTestGroupAssignment(rs.Primary.ID), )( s, diff --git a/test/live/datasources/wired_network_test.go b/test/live/datasources/wired_network_test.go index 15da54bf..61626175 100644 --- a/test/live/datasources/wired_network_test.go +++ b/test/live/datasources/wired_network_test.go @@ -23,7 +23,7 @@ func TestWiredNetworkDataSource(t *testing.T) { Steps: []resource.TestStep{ { Config: provider.ProviderConfig + ` - data "uxi_wired_network" "my_wired_network" { + data "hpeuxi_wired_network" "my_wired_network" { filter = { id = "` + config.WiredNetworkID + `" } @@ -31,7 +31,7 @@ func TestWiredNetworkDataSource(t *testing.T) { `, Check: shared.CheckStateAgainstWiredNetwork( t, - "data.uxi_wired_network.my_wired_network", + "data.hpeuxi_wired_network.my_wired_network", wiredNetwork, ), }, diff --git a/test/live/datasources/wireless_network_test.go b/test/live/datasources/wireless_network_test.go index e10cc048..776542bd 100644 --- a/test/live/datasources/wireless_network_test.go +++ b/test/live/datasources/wireless_network_test.go @@ -23,7 +23,7 @@ func TestWirelessNetworkDataSource(t *testing.T) { Steps: []resource.TestStep{ { Config: provider.ProviderConfig + ` - data "uxi_wireless_network" "my_wireless_network" { + data "hpeuxi_wireless_network" "my_wireless_network" { filter = { id = "` + config.WirelessNetworkID + `" } @@ -31,7 +31,7 @@ func TestWirelessNetworkDataSource(t *testing.T) { `, Check: shared.CheckStateAgainstWirelessNetwork( t, - "data.uxi_wireless_network.my_wireless_network", + "data.hpeuxi_wireless_network.my_wireless_network", wirelessNetwork, ), }, diff --git a/test/live/provider/provider.go b/test/live/provider/provider.go index b9f0e467..de88372c 100644 --- a/test/live/provider/provider.go +++ b/test/live/provider/provider.go @@ -12,8 +12,8 @@ import ( ) var ( - ProviderConfig = `provider "uxi" {}` + ProviderConfig = `provider "hpeuxi" {}` TestAccProtoV6ProviderFactories = map[string]func() (tfprotov6.ProviderServer, error){ - "uxi": providerserver.NewProtocol6WithError(provider.New("test")()), + "hpeuxi": providerserver.NewProtocol6WithError(provider.New("test")()), } ) diff --git a/test/live/resources/agent_group_assignment_test.go b/test/live/resources/agent_group_assignment_test.go index 3a330ce8..e2a2536d 100644 --- a/test/live/resources/agent_group_assignment_test.go +++ b/test/live/resources/agent_group_assignment_test.go @@ -32,29 +32,29 @@ func TestAgentGroupAssignmentResource(t *testing.T) { // Creating { Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "` + groupName + `" } - data "uxi_agent" "my_agent" { + data "hpeuxi_agent" "my_agent" { filter = { id = "` + config.AgentPermanentID + `" } } - resource "uxi_agent_group_assignment" "my_agent_group_assignment" { - agent_id = data.uxi_agent.my_agent.id - group_id = uxi_group.my_group.id + resource "hpeuxi_agent_group_assignment" "my_agent_group_assignment" { + agent_id = data.hpeuxi_agent.my_agent.id + group_id = hpeuxi_group.my_group.id }`, Check: resource.ComposeAggregateTestCheckFunc( // Check properties are what we configured resource.TestCheckResourceAttr( - "uxi_agent_group_assignment.my_agent_group_assignment", + "hpeuxi_agent_group_assignment.my_agent_group_assignment", "agent_id", config.AgentPermanentID, ), resource.TestCheckResourceAttrWith( - "uxi_agent_group_assignment.my_agent_group_assignment", + "hpeuxi_agent_group_assignment.my_agent_group_assignment", "group_id", func(value string) error { assert.Equal(t, util.GetGroupByName(groupName).Id, value) @@ -64,13 +64,13 @@ func TestAgentGroupAssignmentResource(t *testing.T) { ), // Check properties match what is on backend func(s *terraform.State) error { - resourceName := "uxi_agent_group_assignment.my_agent_group_assignment" + resourceName := "hpeuxi_agent_group_assignment.my_agent_group_assignment" rs := s.RootModule().Resources[resourceName] resourceIDBeforeRecreate = rs.Primary.ID return util.CheckStateAgainstAgentGroupAssignment( t, - "uxi_agent_group_assignment.my_agent_group_assignment", + "hpeuxi_agent_group_assignment.my_agent_group_assignment", *util.GetAgentGroupAssignment(resourceIDBeforeRecreate), )(s) }, @@ -78,7 +78,7 @@ func TestAgentGroupAssignmentResource(t *testing.T) { }, // ImportState { - ResourceName: "uxi_agent_group_assignment.my_agent_group_assignment", + ResourceName: "hpeuxi_agent_group_assignment.my_agent_group_assignment", ImportState: true, ImportStateVerify: true, }, @@ -86,35 +86,35 @@ func TestAgentGroupAssignmentResource(t *testing.T) { { Config: provider.ProviderConfig + ` // the original resources - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "` + groupName + `" } - data "uxi_agent" "my_agent" { + data "hpeuxi_agent" "my_agent" { filter = { id = "` + config.AgentPermanentID + `" } } // the new resources we wanna update the assignment to - resource "uxi_group" "my_group_2" { + resource "hpeuxi_group" "my_group_2" { name = "` + group2Name + `" } // the assignment update, updated from agent/group to agent/group_2 - resource "uxi_agent_group_assignment" "my_agent_group_assignment" { - agent_id = data.uxi_agent.my_agent.id - group_id = uxi_group.my_group_2.id + resource "hpeuxi_agent_group_assignment" "my_agent_group_assignment" { + agent_id = data.hpeuxi_agent.my_agent.id + group_id = hpeuxi_group.my_group_2.id }`, Check: resource.ComposeAggregateTestCheckFunc( // Check properties are what we configured resource.TestCheckResourceAttr( - "uxi_agent_group_assignment.my_agent_group_assignment", + "hpeuxi_agent_group_assignment.my_agent_group_assignment", "agent_id", config.AgentPermanentID, ), resource.TestCheckResourceAttrWith( - "uxi_agent_group_assignment.my_agent_group_assignment", + "hpeuxi_agent_group_assignment.my_agent_group_assignment", "group_id", func(value string) error { assert.Equal(t, util.GetGroupByName(group2Name).Id, value) @@ -124,13 +124,13 @@ func TestAgentGroupAssignmentResource(t *testing.T) { ), // Check properties match what is on backend func(s *terraform.State) error { - resourceName := "uxi_agent_group_assignment.my_agent_group_assignment" + resourceName := "hpeuxi_agent_group_assignment.my_agent_group_assignment" rs := s.RootModule().Resources[resourceName] resourceIDAfterRecreate = rs.Primary.ID return util.CheckStateAgainstAgentGroupAssignment( t, - "uxi_agent_group_assignment.my_agent_group_assignment", + "hpeuxi_agent_group_assignment.my_agent_group_assignment", *util.GetAgentGroupAssignment(resourceIDAfterRecreate), )(s) }, diff --git a/test/live/resources/agent_test.go b/test/live/resources/agent_test.go index d68e9a84..87cb2cfa 100644 --- a/test/live/resources/agent_test.go +++ b/test/live/resources/agent_test.go @@ -24,7 +24,7 @@ func TestAgentResource(t *testing.T) { // we provision an agent here so that we have something to delete later on agentID, err := util.ProvisionAgent{ CustomerID: config.CustomerID, - ProvisionToken: os.Getenv("UXI_PROVISION_TOKEN"), + ProvisionToken: os.Getenv("hpeuxi_PROVISION_TOKEN"), DeviceSerial: config.AgentCreateSerial, DeviceGatewayHost: config.DeviceGatewayHost, }.Provision() @@ -46,7 +46,7 @@ func TestAgentResource(t *testing.T) { // Creating an agent is not allowed { Config: provider.ProviderConfig + ` - resource "uxi_agent" "my_agent" { + resource "hpeuxi_agent" "my_agent" { name = "` + agent.Name + `" }`, @@ -57,31 +57,31 @@ func TestAgentResource(t *testing.T) { // Importing an agent { Config: provider.ProviderConfig + ` - resource "uxi_agent" "my_agent" { + resource "hpeuxi_agent" "my_agent" { name = "` + agent.Name + `" } import { - to = uxi_agent.my_agent + to = hpeuxi_agent.my_agent id = "` + agentID + `" }`, - Check: shared.CheckStateAgainstAgent(t, "uxi_agent.my_agent", agent), + Check: shared.CheckStateAgainstAgent(t, "hpeuxi_agent.my_agent", agent), }, // ImportState { - ResourceName: "uxi_agent.my_agent", + ResourceName: "hpeuxi_agent.my_agent", ImportState: true, ImportStateVerify: true, }, // Update { Config: provider.ProviderConfig + ` - resource "uxi_agent" "my_agent" { + resource "hpeuxi_agent" "my_agent" { name = "tf_provider_acceptance_test_agent_resource_updated_name" notes = "notes" pcap_mode = "off" }`, - Check: shared.CheckStateAgainstAgent(t, "uxi_agent.my_agent", updatedAgent), + Check: shared.CheckStateAgainstAgent(t, "hpeuxi_agent.my_agent", updatedAgent), }, // Delete { diff --git a/test/live/resources/group_test.go b/test/live/resources/group_test.go index 3c4ec784..1d0f7c53 100644 --- a/test/live/resources/group_test.go +++ b/test/live/resources/group_test.go @@ -41,12 +41,12 @@ func TestGroupResource(t *testing.T) { { // Node without parent (attached to root) Config: provider.ProviderConfig + ` - resource "uxi_group" "parent" { + resource "hpeuxi_group" "parent" { name = "` + groupNameParent + `" }`, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttrWith( - "uxi_group.parent", + "hpeuxi_group.parent", "id", func(value string) error { assert.Equal(t, value, util.GetGroupByName(groupNameParent).Id) @@ -55,26 +55,26 @@ func TestGroupResource(t *testing.T) { }, ), resource.TestCheckResourceAttr( - "uxi_group.parent", "name", groupNameParent, + "hpeuxi_group.parent", "name", groupNameParent, ), - resource.TestCheckNoResourceAttr("uxi_group.parent", "parent_group_id"), + resource.TestCheckNoResourceAttr("hpeuxi_group.parent", "parent_group_id"), ), }, // ImportState { - ResourceName: "uxi_group.parent", + ResourceName: "hpeuxi_group.parent", ImportState: true, ImportStateVerify: true, }, // Update that does not trigger a recreate { Config: provider.ProviderConfig + ` - resource "uxi_group" "parent" { + resource "hpeuxi_group" "parent" { name = "` + groupNameParentUpdated + `" }`, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttrWith( - "uxi_group.parent", + "hpeuxi_group.parent", "id", func(value string) error { assert.Equal(t, value, util.GetGroupByName(groupNameParentUpdated).Id) @@ -83,12 +83,12 @@ func TestGroupResource(t *testing.T) { }, ), resource.TestCheckResourceAttr( - "uxi_group.parent", + "hpeuxi_group.parent", "name", groupNameParentUpdated, ), resource.TestCheckNoResourceAttr( - "uxi_group.parent", + "hpeuxi_group.parent", "parent_group_id", ), ), @@ -96,22 +96,22 @@ func TestGroupResource(t *testing.T) { // Create nodes attached to non root node { Config: provider.ProviderConfig + ` - resource "uxi_group" "parent" { + resource "hpeuxi_group" "parent" { name = "` + groupNameParentUpdated + `" } - resource "uxi_group" "child" { + resource "hpeuxi_group" "child" { name = "` + groupNameChild + `" - parent_group_id = uxi_group.parent.id + parent_group_id = hpeuxi_group.parent.id } - resource "uxi_group" "grandchild" { + resource "hpeuxi_group" "grandchild" { name = "` + groupNameGrandChild + `" - parent_group_id = uxi_group.child.id + parent_group_id = hpeuxi_group.child.id }`, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttrWith( - "uxi_group.child", + "hpeuxi_group.child", "id", func(value string) error { assert.Equal(t, value, util.GetGroupByName(groupNameChild).Id) @@ -120,19 +120,19 @@ func TestGroupResource(t *testing.T) { }, ), resource.TestCheckResourceAttr( - "uxi_group.child", + "hpeuxi_group.child", "name", groupNameChild, ), resource.TestCheckResourceAttrWith( - "uxi_group.child", + "hpeuxi_group.child", "parent_group_id", func(parentGroupId string) error { return checkGroupIsChildOfNode(parentGroupId, groupNameParentUpdated) }, ), resource.TestCheckResourceAttrWith( - "uxi_group.grandchild", + "hpeuxi_group.grandchild", "id", func(value string) error { resourceIDBeforeRecreate = util.GetGroupByName( @@ -144,12 +144,12 @@ func TestGroupResource(t *testing.T) { }, ), resource.TestCheckResourceAttr( - "uxi_group.grandchild", + "hpeuxi_group.grandchild", "name", groupNameGrandChild, ), resource.TestCheckResourceAttrWith( - "uxi_group.grandchild", + "hpeuxi_group.grandchild", "parent_group_id", func(parentGroupId string) error { return checkGroupIsChildOfNode(parentGroupId, groupNameChild) @@ -160,23 +160,23 @@ func TestGroupResource(t *testing.T) { // Update that does trigger a recreate (moving group) { Config: provider.ProviderConfig + ` - resource "uxi_group" "parent" { + resource "hpeuxi_group" "parent" { name = "` + groupNameParentUpdated + `" } - resource "uxi_group" "child" { + resource "hpeuxi_group" "child" { name = "` + groupNameChild + `" - parent_group_id = uxi_group.parent.id + parent_group_id = hpeuxi_group.parent.id } # move grandchild from child to parent - resource "uxi_group" "grandchild" { + resource "hpeuxi_group" "grandchild" { name = "` + groupNameGrandChildMovedToParent + `" - parent_group_id = uxi_group.parent.id + parent_group_id = hpeuxi_group.parent.id }`, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttrWith( - "uxi_group.grandchild", + "hpeuxi_group.grandchild", "id", func(value string) error { assert.Equal( @@ -189,12 +189,12 @@ func TestGroupResource(t *testing.T) { }, ), resource.TestCheckResourceAttr( - "uxi_group.grandchild", + "hpeuxi_group.grandchild", "name", groupNameGrandChildMovedToParent, ), resource.TestCheckResourceAttrWith( - "uxi_group.grandchild", + "hpeuxi_group.grandchild", "parent_group_id", func(parentGroupId string) error { return checkGroupIsChildOfNode(parentGroupId, groupNameParentUpdated) @@ -202,7 +202,7 @@ func TestGroupResource(t *testing.T) { ), // Check that resource has been recreated resource.TestCheckResourceAttrWith( - "uxi_group.grandchild", + "hpeuxi_group.grandchild", "id", func(value string) error { assert.NotEqual(t, value, resourceIDBeforeRecreate) @@ -215,27 +215,27 @@ func TestGroupResource(t *testing.T) { // Update non root node group back to the root node by removing parent_group_id { Config: provider.ProviderConfig + ` - resource "uxi_group" "parent" { + resource "hpeuxi_group" "parent" { name = "` + groupNameParentUpdated + `" } - resource "uxi_group" "child" { + resource "hpeuxi_group" "child" { name = "` + groupNameChild + `" - parent_group_id = uxi_group.parent.id + parent_group_id = hpeuxi_group.parent.id } # move grandchild from parent to root - resource "uxi_group" "grandchild" { + resource "hpeuxi_group" "grandchild" { name = "` + groupNameGrandChildMovedToRoot + `" }`, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr( - "uxi_group.grandchild", + "hpeuxi_group.grandchild", "name", groupNameGrandChildMovedToRoot, ), resource.TestCheckNoResourceAttr( - "uxi_group.grandchild", + "hpeuxi_group.grandchild", "parent_group_id", ), ), @@ -265,12 +265,12 @@ func TestRootGroupResource(t *testing.T) { // Importing the root group does not work { Config: provider.ProviderConfig + ` - resource "uxi_group" "my_root_group" { + resource "hpeuxi_group" "my_root_group" { name = "root" } import { - to = uxi_group.my_root_group + to = hpeuxi_group.my_root_group id = "` + config.GroupIDRoot + `" }`, ExpectError: regexp.MustCompile(`The root group cannot be used as a resource`), diff --git a/test/live/resources/network_group_assignment_test.go b/test/live/resources/network_group_assignment_test.go index dc092f21..312e7ae1 100644 --- a/test/live/resources/network_group_assignment_test.go +++ b/test/live/resources/network_group_assignment_test.go @@ -34,32 +34,32 @@ func TestNetworkGroupAssignmentResourceForWiredNetwork(t *testing.T) { // Creating { Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "` + groupName + `" } - resource "uxi_wired_network" "my_network" { + resource "hpeuxi_wired_network" "my_network" { name = "` + config.WiredNetworkName + `" } import { - to = uxi_wired_network.my_network + to = hpeuxi_wired_network.my_network id = "` + config.WiredNetworkID + `" } - resource "uxi_network_group_assignment" "my_network_group_assignment" { - network_id = uxi_wired_network.my_network.id - group_id = uxi_group.my_group.id + resource "hpeuxi_network_group_assignment" "my_network_group_assignment" { + network_id = hpeuxi_wired_network.my_network.id + group_id = hpeuxi_group.my_group.id }`, Check: resource.ComposeAggregateTestCheckFunc( // Check configured properties resource.TestCheckResourceAttr( - "uxi_network_group_assignment.my_network_group_assignment", + "hpeuxi_network_group_assignment.my_network_group_assignment", "network_id", config.WiredNetworkID, ), resource.TestCheckResourceAttrWith( - "uxi_network_group_assignment.my_network_group_assignment", + "hpeuxi_network_group_assignment.my_network_group_assignment", "group_id", func(group_id string) error { assert.Equal(t, group_id, util.GetGroupByName(groupName).Id) @@ -69,13 +69,13 @@ func TestNetworkGroupAssignmentResourceForWiredNetwork(t *testing.T) { ), // Check properties match what is on backend func(s *terraform.State) error { - resourceName := "uxi_network_group_assignment.my_network_group_assignment" + resourceName := "hpeuxi_network_group_assignment.my_network_group_assignment" rs := s.RootModule().Resources[resourceName] resourceIDBeforeRecreate = rs.Primary.ID return util.CheckStateAgainstNetworkGroupAssignment( t, - "uxi_network_group_assignment.my_network_group_assignment", + "hpeuxi_network_group_assignment.my_network_group_assignment", util.GetNetworkGroupAssignment(resourceIDBeforeRecreate), )(s) }, @@ -83,7 +83,7 @@ func TestNetworkGroupAssignmentResourceForWiredNetwork(t *testing.T) { }, // ImportState { - ResourceName: "uxi_network_group_assignment.my_network_group_assignment", + ResourceName: "hpeuxi_network_group_assignment.my_network_group_assignment", ImportState: true, ImportStateVerify: true, }, @@ -91,38 +91,38 @@ func TestNetworkGroupAssignmentResourceForWiredNetwork(t *testing.T) { { Config: provider.ProviderConfig + ` // the original resources - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "` + groupName + `" } - resource "uxi_wired_network" "my_network" { + resource "hpeuxi_wired_network" "my_network" { name = "` + config.WiredNetworkName + `" } import { - to = uxi_wired_network.my_network + to = hpeuxi_wired_network.my_network id = "` + config.WiredNetworkID + `" } // the new resources we wanna update the assignment to - resource "uxi_group" "my_group_2" { + resource "hpeuxi_group" "my_group_2" { name = "` + group2Name + `" } // the assignment update, updated from network/group to network/group_2 - resource "uxi_network_group_assignment" "my_network_group_assignment" { - network_id = uxi_wired_network.my_network.id - group_id = uxi_group.my_group_2.id + resource "hpeuxi_network_group_assignment" "my_network_group_assignment" { + network_id = hpeuxi_wired_network.my_network.id + group_id = hpeuxi_group.my_group_2.id }`, Check: resource.ComposeAggregateTestCheckFunc( // Check configured properties resource.TestCheckResourceAttr( - "uxi_network_group_assignment.my_network_group_assignment", + "hpeuxi_network_group_assignment.my_network_group_assignment", "network_id", config.WiredNetworkID, ), resource.TestCheckResourceAttrWith( - "uxi_network_group_assignment.my_network_group_assignment", + "hpeuxi_network_group_assignment.my_network_group_assignment", "group_id", func(group_id string) error { assert.Equal(t, group_id, util.GetGroupByName(group2Name).Id) @@ -132,19 +132,19 @@ func TestNetworkGroupAssignmentResourceForWiredNetwork(t *testing.T) { ), // Check properties match what is on backend func(s *terraform.State) error { - resourceName := "uxi_network_group_assignment.my_network_group_assignment" + resourceName := "hpeuxi_network_group_assignment.my_network_group_assignment" rs := s.RootModule().Resources[resourceName] resourceIDAfterRecreate = rs.Primary.ID return util.CheckStateAgainstNetworkGroupAssignment( t, - "uxi_network_group_assignment.my_network_group_assignment", + "hpeuxi_network_group_assignment.my_network_group_assignment", util.GetNetworkGroupAssignment(resourceIDAfterRecreate), )(s) }, // Check that resource has been recreated resource.TestCheckResourceAttrWith( - "uxi_network_group_assignment.my_network_group_assignment", + "hpeuxi_network_group_assignment.my_network_group_assignment", "id", func(value string) error { assert.NotEqual(t, value, resourceIDBeforeRecreate) @@ -158,7 +158,7 @@ func TestNetworkGroupAssignmentResourceForWiredNetwork(t *testing.T) { { Config: provider.ProviderConfig + ` removed { - from = uxi_wired_network.my_network + from = hpeuxi_wired_network.my_network lifecycle { destroy = false @@ -195,32 +195,32 @@ func TestNetworkGroupAssignmentResourceForWirelessNetwork(t *testing.T) { // Creating { Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "` + groupName + `" } - resource "uxi_wireless_network" "my_network" { + resource "hpeuxi_wireless_network" "my_network" { name = "` + config.WirelessNetworkName + `" } import { - to = uxi_wireless_network.my_network + to = hpeuxi_wireless_network.my_network id = "` + config.WirelessNetworkID + `" } - resource "uxi_network_group_assignment" "my_network_group_assignment" { - network_id = uxi_wireless_network.my_network.id - group_id = uxi_group.my_group.id + resource "hpeuxi_network_group_assignment" "my_network_group_assignment" { + network_id = hpeuxi_wireless_network.my_network.id + group_id = hpeuxi_group.my_group.id }`, Check: resource.ComposeAggregateTestCheckFunc( // Check configured properties resource.TestCheckResourceAttr( - "uxi_network_group_assignment.my_network_group_assignment", + "hpeuxi_network_group_assignment.my_network_group_assignment", "network_id", config.WirelessNetworkID, ), resource.TestCheckResourceAttrWith( - "uxi_network_group_assignment.my_network_group_assignment", + "hpeuxi_network_group_assignment.my_network_group_assignment", "group_id", func(group_id string) error { assert.Equal(t, group_id, util.GetGroupByName(groupName).Id) @@ -230,13 +230,13 @@ func TestNetworkGroupAssignmentResourceForWirelessNetwork(t *testing.T) { ), // Check properties match what is on backend func(s *terraform.State) error { - resourceName := "uxi_network_group_assignment.my_network_group_assignment" + resourceName := "hpeuxi_network_group_assignment.my_network_group_assignment" rs := s.RootModule().Resources[resourceName] resourceIDBeforeRecreate = rs.Primary.ID return util.CheckStateAgainstNetworkGroupAssignment( t, - "uxi_network_group_assignment.my_network_group_assignment", + "hpeuxi_network_group_assignment.my_network_group_assignment", util.GetNetworkGroupAssignment(resourceIDBeforeRecreate), )(s) }, @@ -244,7 +244,7 @@ func TestNetworkGroupAssignmentResourceForWirelessNetwork(t *testing.T) { }, // ImportState { - ResourceName: "uxi_network_group_assignment.my_network_group_assignment", + ResourceName: "hpeuxi_network_group_assignment.my_network_group_assignment", ImportState: true, ImportStateVerify: true, }, @@ -252,38 +252,38 @@ func TestNetworkGroupAssignmentResourceForWirelessNetwork(t *testing.T) { { Config: provider.ProviderConfig + ` // the original resources - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "` + groupName + `" } - resource "uxi_wireless_network" "my_network" { + resource "hpeuxi_wireless_network" "my_network" { name = "` + config.WirelessNetworkName + `" } import { - to = uxi_wireless_network.my_network + to = hpeuxi_wireless_network.my_network id = "` + config.WirelessNetworkID + `" } // the new resources we wanna update the assignment to - resource "uxi_group" "my_group_2" { + resource "hpeuxi_group" "my_group_2" { name = "` + group2Name + `" } // the assignment update, updated from network/group to network/group_2 - resource "uxi_network_group_assignment" "my_network_group_assignment" { - network_id = uxi_wireless_network.my_network.id - group_id = uxi_group.my_group_2.id + resource "hpeuxi_network_group_assignment" "my_network_group_assignment" { + network_id = hpeuxi_wireless_network.my_network.id + group_id = hpeuxi_group.my_group_2.id }`, Check: resource.ComposeAggregateTestCheckFunc( // Check configured properties resource.TestCheckResourceAttr( - "uxi_network_group_assignment.my_network_group_assignment", + "hpeuxi_network_group_assignment.my_network_group_assignment", "network_id", config.WirelessNetworkID, ), resource.TestCheckResourceAttrWith( - "uxi_network_group_assignment.my_network_group_assignment", + "hpeuxi_network_group_assignment.my_network_group_assignment", "group_id", func(group_id string) error { assert.Equal(t, group_id, util.GetGroupByName(group2Name).Id) @@ -293,19 +293,19 @@ func TestNetworkGroupAssignmentResourceForWirelessNetwork(t *testing.T) { ), // Check properties match what is on backend func(s *terraform.State) error { - resourceName := "uxi_network_group_assignment.my_network_group_assignment" + resourceName := "hpeuxi_network_group_assignment.my_network_group_assignment" rs := s.RootModule().Resources[resourceName] resourceIDAfterRecreate = rs.Primary.ID return util.CheckStateAgainstNetworkGroupAssignment( t, - "uxi_network_group_assignment.my_network_group_assignment", + "hpeuxi_network_group_assignment.my_network_group_assignment", util.GetNetworkGroupAssignment(resourceIDAfterRecreate), )(s) }, // Check that resource has been recreated resource.TestCheckResourceAttrWith( - "uxi_network_group_assignment.my_network_group_assignment", + "hpeuxi_network_group_assignment.my_network_group_assignment", "id", func(value string) error { assert.NotEqual(t, value, resourceIDBeforeRecreate) @@ -319,7 +319,7 @@ func TestNetworkGroupAssignmentResourceForWirelessNetwork(t *testing.T) { { Config: provider.ProviderConfig + ` removed { - from = uxi_wireless_network.my_network + from = hpeuxi_wireless_network.my_network lifecycle { destroy = false diff --git a/test/live/resources/sensor_group_assignment_test.go b/test/live/resources/sensor_group_assignment_test.go index 7db60892..2aa43072 100644 --- a/test/live/resources/sensor_group_assignment_test.go +++ b/test/live/resources/sensor_group_assignment_test.go @@ -34,11 +34,11 @@ func TestSensorGroupAssignmentResource(t *testing.T) { // Creating { Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "` + groupName + `" } - resource "uxi_sensor" "my_sensor" { + resource "hpeuxi_sensor" "my_sensor" { name = "` + existingSensorProperties.Name + `" ` + util.ConditionalProperty("address_note", existingSensorProperties.AddressNote.Get()) + ` ` + util.ConditionalProperty("notes", existingSensorProperties.Notes.Get()) + ` @@ -46,23 +46,23 @@ func TestSensorGroupAssignmentResource(t *testing.T) { } import { - to = uxi_sensor.my_sensor + to = hpeuxi_sensor.my_sensor id = "` + config.SensorID + `" } - resource "uxi_sensor_group_assignment" "my_sensor_group_assignment" { - sensor_id = uxi_sensor.my_sensor.id - group_id = uxi_group.my_group.id + resource "hpeuxi_sensor_group_assignment" "my_sensor_group_assignment" { + sensor_id = hpeuxi_sensor.my_sensor.id + group_id = hpeuxi_group.my_group.id }`, Check: resource.ComposeAggregateTestCheckFunc( // Check configured properties resource.TestCheckResourceAttr( - "uxi_sensor_group_assignment.my_sensor_group_assignment", + "hpeuxi_sensor_group_assignment.my_sensor_group_assignment", "sensor_id", config.SensorID, ), resource.TestCheckResourceAttrWith( - "uxi_sensor_group_assignment.my_sensor_group_assignment", + "hpeuxi_sensor_group_assignment.my_sensor_group_assignment", "group_id", func(value string) error { assert.Equal(t, value, util.GetGroupByName(groupName).Id) @@ -72,13 +72,13 @@ func TestSensorGroupAssignmentResource(t *testing.T) { ), // Check properties match what is on backend func(s *terraform.State) error { - resourceName := "uxi_sensor_group_assignment.my_sensor_group_assignment" + resourceName := "hpeuxi_sensor_group_assignment.my_sensor_group_assignment" rs := s.RootModule().Resources[resourceName] resourceIDBeforeRecreate = rs.Primary.ID return util.CheckStateAgainstSensorGroupAssignment( t, - "uxi_sensor_group_assignment.my_sensor_group_assignment", + "hpeuxi_sensor_group_assignment.my_sensor_group_assignment", util.GetSensorGroupAssignment(resourceIDBeforeRecreate), )(s) }, @@ -86,7 +86,7 @@ func TestSensorGroupAssignmentResource(t *testing.T) { }, // ImportState { - ResourceName: "uxi_sensor_group_assignment.my_sensor_group_assignment", + ResourceName: "hpeuxi_sensor_group_assignment.my_sensor_group_assignment", ImportState: true, ImportStateVerify: true, }, @@ -94,11 +94,11 @@ func TestSensorGroupAssignmentResource(t *testing.T) { { Config: provider.ProviderConfig + ` // the original resources - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "` + groupName + `" } - resource "uxi_sensor" "my_sensor" { + resource "hpeuxi_sensor" "my_sensor" { name = "` + existingSensorProperties.Name + `" ` + util.ConditionalProperty("address_note", existingSensorProperties.AddressNote.Get()) + ` ` + util.ConditionalProperty("notes", existingSensorProperties.Notes.Get()) + ` @@ -106,24 +106,24 @@ func TestSensorGroupAssignmentResource(t *testing.T) { } // the new resources we wanna update the assignment to - resource "uxi_group" "my_group_2" { + resource "hpeuxi_group" "my_group_2" { name = "` + group2Name + `" } // the assignment update, updated from sensor/group to sensor/group_2 - resource "uxi_sensor_group_assignment" "my_sensor_group_assignment" { - sensor_id = uxi_sensor.my_sensor.id - group_id = uxi_group.my_group_2.id + resource "hpeuxi_sensor_group_assignment" "my_sensor_group_assignment" { + sensor_id = hpeuxi_sensor.my_sensor.id + group_id = hpeuxi_group.my_group_2.id }`, Check: resource.ComposeAggregateTestCheckFunc( // Check configured properties resource.TestCheckResourceAttr( - "uxi_sensor_group_assignment.my_sensor_group_assignment", + "hpeuxi_sensor_group_assignment.my_sensor_group_assignment", "sensor_id", config.SensorID, ), resource.TestCheckResourceAttrWith( - "uxi_sensor_group_assignment.my_sensor_group_assignment", + "hpeuxi_sensor_group_assignment.my_sensor_group_assignment", "group_id", func(value string) error { assert.Equal(t, value, util.GetGroupByName(group2Name).Id) @@ -133,13 +133,13 @@ func TestSensorGroupAssignmentResource(t *testing.T) { ), // Check properties match what is on backend func(s *terraform.State) error { - resourceName := "uxi_sensor_group_assignment.my_sensor_group_assignment" + resourceName := "hpeuxi_sensor_group_assignment.my_sensor_group_assignment" rs := s.RootModule().Resources[resourceName] resourceIDAfterRecreate = rs.Primary.ID return util.CheckStateAgainstSensorGroupAssignment( t, - "uxi_sensor_group_assignment.my_sensor_group_assignment", + "hpeuxi_sensor_group_assignment.my_sensor_group_assignment", util.GetSensorGroupAssignment(resourceIDAfterRecreate), )(s) }, @@ -149,7 +149,7 @@ func TestSensorGroupAssignmentResource(t *testing.T) { { Config: provider.ProviderConfig + ` removed { - from = uxi_sensor.my_sensor + from = hpeuxi_sensor.my_sensor lifecycle { destroy = false diff --git a/test/live/resources/sensor_test.go b/test/live/resources/sensor_test.go index b6c3a53e..4ff52305 100644 --- a/test/live/resources/sensor_test.go +++ b/test/live/resources/sensor_test.go @@ -35,7 +35,7 @@ func TestSensorResource(t *testing.T) { // Creating a sensor is not allowed { Config: provider.ProviderConfig + ` - resource "uxi_sensor" "my_sensor" { + resource "hpeuxi_sensor" "my_sensor" { name = "` + originalSensor.Name + `" }`, @@ -46,44 +46,44 @@ func TestSensorResource(t *testing.T) { // Importing a sensor { Config: provider.ProviderConfig + ` - resource "uxi_sensor" "my_sensor" { + resource "hpeuxi_sensor" "my_sensor" { name = "` + originalSensor.Name + `" } import { - to = uxi_sensor.my_sensor + to = hpeuxi_sensor.my_sensor id = "` + config.SensorID + `" }`, - Check: shared.CheckStateAgainstSensor(t, "uxi_sensor.my_sensor", originalSensor), + Check: shared.CheckStateAgainstSensor(t, "hpeuxi_sensor.my_sensor", originalSensor), }, // ImportState testing { - ResourceName: "uxi_sensor.my_sensor", + ResourceName: "hpeuxi_sensor.my_sensor", ImportState: true, ImportStateVerify: true, }, // Update testing { Config: provider.ProviderConfig + ` - resource "uxi_sensor" "my_sensor" { + resource "hpeuxi_sensor" "my_sensor" { name = "` + updatedSensor.Name + `" address_note = "` + updatedSensor.GetAddressNote() + `" notes = "` + updatedSensor.GetNotes() + `" pcap_mode = "` + updatedSensor.GetPcapMode() + `" }`, - Check: shared.CheckStateAgainstSensor(t, "uxi_sensor.my_sensor", updatedSensor), + Check: shared.CheckStateAgainstSensor(t, "hpeuxi_sensor.my_sensor", updatedSensor), }, // Update sensor back to original { Config: provider.ProviderConfig + ` - resource "uxi_sensor" "my_sensor" { + resource "hpeuxi_sensor" "my_sensor" { name = "` + originalSensor.Name + `" address_note = "` + originalSensor.GetAddressNote() + `" notes = "` + originalSensor.GetNotes() + `" pcap_mode = "` + originalSensor.GetPcapMode() + `" }`, - Check: shared.CheckStateAgainstSensor(t, "uxi_sensor.my_sensor", originalSensor), + Check: shared.CheckStateAgainstSensor(t, "hpeuxi_sensor.my_sensor", originalSensor), }, // Deleting a sensor is not allowed { @@ -96,7 +96,7 @@ func TestSensorResource(t *testing.T) { { Config: provider.ProviderConfig + ` removed { - from = uxi_sensor.my_sensor + from = hpeuxi_sensor.my_sensor lifecycle { destroy = false diff --git a/test/live/resources/service_test.go b/test/live/resources/service_test.go index 74f34837..ebca042b 100644 --- a/test/live/resources/service_test.go +++ b/test/live/resources/service_test.go @@ -30,7 +30,7 @@ func TestServiceTestResource(t *testing.T) { // Creating a service_test is not allowed { Config: provider.ProviderConfig + ` - resource "uxi_service_test" "my_service_test" { + resource "hpeuxi_service_test" "my_service_test" { name = "` + config.ServiceTestName + `" }`, @@ -41,31 +41,31 @@ func TestServiceTestResource(t *testing.T) { // Importing a service_test { Config: provider.ProviderConfig + ` - resource "uxi_service_test" "my_service_test" { + resource "hpeuxi_service_test" "my_service_test" { name = "` + config.ServiceTestName + `" } import { - to = uxi_service_test.my_service_test + to = hpeuxi_service_test.my_service_test id = "` + config.ServiceTestID + `" }`, Check: shared.CheckStateAgainstServiceTest( t, - "uxi_service_test.my_service_test", + "hpeuxi_service_test.my_service_test", serviceTest, ), }, // ImportState testing { - ResourceName: "uxi_service_test.my_service_test", + ResourceName: "hpeuxi_service_test.my_service_test", ImportState: true, ImportStateVerify: true, }, // Updating a service_test is not allowed { Config: provider.ProviderConfig + ` - resource "uxi_service_test" "my_service_test" { + resource "hpeuxi_service_test" "my_service_test" { name = "` + config.ServiceTestName + `-updated-name" }`, ExpectError: regexp.MustCompile( @@ -83,7 +83,7 @@ func TestServiceTestResource(t *testing.T) { { Config: provider.ProviderConfig + ` removed { - from = uxi_service_test.my_service_test + from = hpeuxi_service_test.my_service_test lifecycle { destroy = false diff --git a/test/live/resources/service_test_group_assignment_test.go b/test/live/resources/service_test_group_assignment_test.go index 20ce2e16..8da6a7ca 100644 --- a/test/live/resources/service_test_group_assignment_test.go +++ b/test/live/resources/service_test_group_assignment_test.go @@ -33,32 +33,32 @@ func TestServiceTestGroupAssignmentResource(t *testing.T) { // Creating { Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "` + groupName + `" } - resource "uxi_service_test" "my_service_test" { + resource "hpeuxi_service_test" "my_service_test" { name = "` + config.ServiceTestName + `" } import { - to = uxi_service_test.my_service_test + to = hpeuxi_service_test.my_service_test id = "` + config.ServiceTestID + `" } - resource "uxi_service_test_group_assignment" "my_service_test_group_assignment" { - service_test_id = uxi_service_test.my_service_test.id - group_id = uxi_group.my_group.id + resource "hpeuxi_service_test_group_assignment" "my_service_test_group_assignment" { + service_test_id = hpeuxi_service_test.my_service_test.id + group_id = hpeuxi_group.my_group.id }`, Check: resource.ComposeAggregateTestCheckFunc( // Check configured properties resource.TestCheckResourceAttr( - "uxi_service_test_group_assignment.my_service_test_group_assignment", + "hpeuxi_service_test_group_assignment.my_service_test_group_assignment", "service_test_id", config.ServiceTestID, ), resource.TestCheckResourceAttrWith( - "uxi_service_test_group_assignment.my_service_test_group_assignment", + "hpeuxi_service_test_group_assignment.my_service_test_group_assignment", "group_id", func(value string) error { assert.Equal(t, value, util.GetGroupByName(groupName).Id) @@ -68,13 +68,13 @@ func TestServiceTestGroupAssignmentResource(t *testing.T) { ), // Check properties match what is on backend func(s *terraform.State) error { - resourceName := "uxi_service_test_group_assignment.my_service_test_group_assignment" + resourceName := "hpeuxi_service_test_group_assignment.my_service_test_group_assignment" rs := s.RootModule().Resources[resourceName] resourceIDBeforeRecreate = rs.Primary.ID return util.CheckStateAgainstServiceTestGroupAssignment( t, - "uxi_service_test_group_assignment.my_service_test_group_assignment", + "hpeuxi_service_test_group_assignment.my_service_test_group_assignment", util.GetServiceTestGroupAssignment(rs.Primary.ID), )(s) }, @@ -82,7 +82,7 @@ func TestServiceTestGroupAssignmentResource(t *testing.T) { }, // ImportState { - ResourceName: "uxi_service_test_group_assignment.my_service_test_group_assignment", + ResourceName: "hpeuxi_service_test_group_assignment.my_service_test_group_assignment", ImportState: true, ImportStateVerify: true, }, @@ -90,33 +90,33 @@ func TestServiceTestGroupAssignmentResource(t *testing.T) { { Config: provider.ProviderConfig + ` // the original resources - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "` + groupName + `" } - resource "uxi_service_test" "my_service_test" { + resource "hpeuxi_service_test" "my_service_test" { name = "` + config.ServiceTestName + `" } // the new resources we wanna update the assignment to - resource "uxi_group" "my_group_2" { + resource "hpeuxi_group" "my_group_2" { name = "` + group2Name + `" } // the assignment update, updated from service_test/group to service_test/group_2 - resource "uxi_service_test_group_assignment" "my_service_test_group_assignment" { - service_test_id = uxi_service_test.my_service_test.id - group_id = uxi_group.my_group_2.id + resource "hpeuxi_service_test_group_assignment" "my_service_test_group_assignment" { + service_test_id = hpeuxi_service_test.my_service_test.id + group_id = hpeuxi_group.my_group_2.id }`, Check: resource.ComposeAggregateTestCheckFunc( // Check configured properties resource.TestCheckResourceAttr( - "uxi_service_test_group_assignment.my_service_test_group_assignment", + "hpeuxi_service_test_group_assignment.my_service_test_group_assignment", "service_test_id", config.ServiceTestID, ), resource.TestCheckResourceAttrWith( - "uxi_service_test_group_assignment.my_service_test_group_assignment", + "hpeuxi_service_test_group_assignment.my_service_test_group_assignment", "group_id", func(value string) error { assert.Equal(t, value, util.GetGroupByName(group2Name).Id) @@ -126,19 +126,19 @@ func TestServiceTestGroupAssignmentResource(t *testing.T) { ), // Check properties match what is on backend func(s *terraform.State) error { - resourceName := "uxi_service_test_group_assignment.my_service_test_group_assignment" + resourceName := "hpeuxi_service_test_group_assignment.my_service_test_group_assignment" rs := s.RootModule().Resources[resourceName] resourceIDAfterRecreate = rs.Primary.ID return util.CheckStateAgainstServiceTestGroupAssignment( t, - "uxi_service_test_group_assignment.my_service_test_group_assignment", + "hpeuxi_service_test_group_assignment.my_service_test_group_assignment", util.GetServiceTestGroupAssignment(rs.Primary.ID), )(s) }, // Check that resource has been recreated resource.TestCheckResourceAttrWith( - "uxi_service_test_group_assignment.my_service_test_group_assignment", + "hpeuxi_service_test_group_assignment.my_service_test_group_assignment", "id", func(value string) error { assert.NotEqual(t, value, resourceIDBeforeRecreate) @@ -152,7 +152,7 @@ func TestServiceTestGroupAssignmentResource(t *testing.T) { { Config: provider.ProviderConfig + ` removed { - from = uxi_service_test.my_service_test + from = hpeuxi_service_test.my_service_test lifecycle { destroy = false diff --git a/test/live/resources/wired_network_test.go b/test/live/resources/wired_network_test.go index 8dcbab81..aec8295f 100644 --- a/test/live/resources/wired_network_test.go +++ b/test/live/resources/wired_network_test.go @@ -30,7 +30,7 @@ func TestWiredNetworkResource(t *testing.T) { // Creating a wired_network is not allowed { Config: provider.ProviderConfig + ` - resource "uxi_wired_network" "my_wired_network" { + resource "hpeuxi_wired_network" "my_wired_network" { name = "name" }`, @@ -41,31 +41,31 @@ func TestWiredNetworkResource(t *testing.T) { // Importing a wired_network { Config: provider.ProviderConfig + ` - resource "uxi_wired_network" "wired_network_0" { + resource "hpeuxi_wired_network" "wired_network_0" { name = "` + config.WiredNetworkName + `" } import { - to = uxi_wired_network.wired_network_0 + to = hpeuxi_wired_network.wired_network_0 id = "` + config.WiredNetworkID + `" }`, Check: shared.CheckStateAgainstWiredNetwork( t, - "uxi_wired_network.wired_network_0", + "hpeuxi_wired_network.wired_network_0", wiredNetwork, ), }, // ImportState testing { - ResourceName: "uxi_wired_network.wired_network_0", + ResourceName: "hpeuxi_wired_network.wired_network_0", ImportState: true, ImportStateVerify: true, }, // Updating a wired_network is not allowed { Config: provider.ProviderConfig + ` - resource "uxi_wired_network" "wired_network_0" { + resource "hpeuxi_wired_network" "wired_network_0" { name = "` + config.WiredNetworkID + `-updated-name" }`, ExpectError: regexp.MustCompile( @@ -83,7 +83,7 @@ func TestWiredNetworkResource(t *testing.T) { { Config: provider.ProviderConfig + ` removed { - from = uxi_wired_network.wired_network_0 + from = hpeuxi_wired_network.wired_network_0 lifecycle { destroy = false diff --git a/test/live/resources/wireless_network_test.go b/test/live/resources/wireless_network_test.go index 0aae2f55..71e96d34 100644 --- a/test/live/resources/wireless_network_test.go +++ b/test/live/resources/wireless_network_test.go @@ -30,7 +30,7 @@ func TestWirelessNetworkResource(t *testing.T) { // Creating a wireless_network is not allowed { Config: provider.ProviderConfig + ` - resource "uxi_wireless_network" "wireless_network_0" { + resource "hpeuxi_wireless_network" "wireless_network_0" { name = "name" }`, @@ -41,31 +41,31 @@ func TestWirelessNetworkResource(t *testing.T) { // Importing a wireless_network { Config: provider.ProviderConfig + ` - resource "uxi_wireless_network" "wireless_network_0" { + resource "hpeuxi_wireless_network" "wireless_network_0" { name = "` + config.WirelessNetworkName + `" } import { - to = uxi_wireless_network.wireless_network_0 + to = hpeuxi_wireless_network.wireless_network_0 id = "` + config.WirelessNetworkID + `" }`, Check: shared.CheckStateAgainstWirelessNetwork( t, - "uxi_wireless_network.wireless_network_0", + "hpeuxi_wireless_network.wireless_network_0", wirelessNetwork, ), }, // ImportState testing { - ResourceName: "uxi_wireless_network.wireless_network_0", + ResourceName: "hpeuxi_wireless_network.wireless_network_0", ImportState: true, ImportStateVerify: true, }, // Updating a wireless_network is not allowed { Config: provider.ProviderConfig + ` - resource "uxi_wireless_network" "wireless_network_0" { + resource "hpeuxi_wireless_network" "wireless_network_0" { name = "` + config.WirelessNetworkName + `-updated-name" }`, ExpectError: regexp.MustCompile( @@ -83,7 +83,7 @@ func TestWirelessNetworkResource(t *testing.T) { { Config: provider.ProviderConfig + ` removed { - from = uxi_wireless_network.wireless_network_0 + from = hpeuxi_wireless_network.wireless_network_0 lifecycle { destroy = false diff --git a/test/mocked/datasources/agent_group_assignment_test.go b/test/mocked/datasources/agent_group_assignment_test.go index 6fdf4c69..cd26e5ae 100644 --- a/test/mocked/datasources/agent_group_assignment_test.go +++ b/test/mocked/datasources/agent_group_assignment_test.go @@ -36,7 +36,7 @@ func TestAgentGroupAssignmentDataSource(t *testing.T) { ) }, Config: provider.ProviderConfig + ` - data "uxi_agent_group_assignment" "my_agent_group_assignment" { + data "hpeuxi_agent_group_assignment" "my_agent_group_assignment" { filter = { id = "id" } @@ -44,17 +44,17 @@ func TestAgentGroupAssignmentDataSource(t *testing.T) { `, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr( - "data.uxi_agent_group_assignment.my_agent_group_assignment", + "data.hpeuxi_agent_group_assignment.my_agent_group_assignment", "id", "id", ), resource.TestCheckResourceAttr( - "data.uxi_agent_group_assignment.my_agent_group_assignment", + "data.hpeuxi_agent_group_assignment.my_agent_group_assignment", "group_id", "group_id", ), resource.TestCheckResourceAttr( - "data.uxi_agent_group_assignment.my_agent_group_assignment", + "data.hpeuxi_agent_group_assignment.my_agent_group_assignment", "agent_id", "agent_id", ), @@ -88,7 +88,7 @@ func TestAgentGroupAssignmentDataSourceTooManyRequestsHandling(t *testing.T) { ) }, Config: provider.ProviderConfig + ` - data "uxi_agent_group_assignment" "my_agent_group_assignment" { + data "hpeuxi_agent_group_assignment" "my_agent_group_assignment" { filter = { id = "id" } @@ -96,7 +96,7 @@ func TestAgentGroupAssignmentDataSourceTooManyRequestsHandling(t *testing.T) { `, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr( - "data.uxi_agent_group_assignment.my_agent_group_assignment", + "data.hpeuxi_agent_group_assignment.my_agent_group_assignment", "id", "id", ), @@ -132,7 +132,7 @@ func TestAgentGroupAssignmentDataSourceHttpErrorHandling(t *testing.T) { }) }, Config: provider.ProviderConfig + ` - data "uxi_agent_group_assignment" "my_agent_group_assignment" { + data "hpeuxi_agent_group_assignment" "my_agent_group_assignment" { filter = { id = "id" } @@ -147,7 +147,7 @@ func TestAgentGroupAssignmentDataSourceHttpErrorHandling(t *testing.T) { util.MockGetAgentGroupAssignment("id", util.EmptyGetListResponse, 1) }, Config: provider.ProviderConfig + ` - data "uxi_agent_group_assignment" "my_agent_group_assignment" { + data "hpeuxi_agent_group_assignment" "my_agent_group_assignment" { filter = { id = "id" } diff --git a/test/mocked/datasources/agent_test.go b/test/mocked/datasources/agent_test.go index 95db8bca..3935b0a8 100644 --- a/test/mocked/datasources/agent_test.go +++ b/test/mocked/datasources/agent_test.go @@ -33,13 +33,13 @@ func TestAgentDataSource(t *testing.T) { util.MockGetAgent("id", util.GenerateAgentResponse("id", ""), 3) }, Config: provider.ProviderConfig + ` - data "uxi_agent" "my_agent" { + data "hpeuxi_agent" "my_agent" { filter = { id = "id" } } `, - Check: shared.CheckStateAgainstAgent(t, "data.uxi_agent.my_agent", agent), + Check: shared.CheckStateAgainstAgent(t, "data.hpeuxi_agent.my_agent", agent), }, }, }) @@ -66,14 +66,14 @@ func TestAgentDataSourceTooManyRequestsHandling(t *testing.T) { util.MockGetAgent("id", util.GenerateAgentResponse("id", ""), 3) }, Config: provider.ProviderConfig + ` - data "uxi_agent" "my_agent" { + data "hpeuxi_agent" "my_agent" { filter = { id = "id" } } `, Check: resource.ComposeAggregateTestCheckFunc( - shared.CheckStateAgainstAgent(t, "data.uxi_agent.my_agent", agent), + shared.CheckStateAgainstAgent(t, "data.hpeuxi_agent.my_agent", agent), func(s *terraform.State) error { assert.Equal(t, mockTooManyRequests.Mock.Request().Counter, 0) @@ -107,7 +107,7 @@ func TestAgentDataSourceHttpErrorHandling(t *testing.T) { }) }, Config: provider.ProviderConfig + ` - data "uxi_agent" "my_agent" { + data "hpeuxi_agent" "my_agent" { filter = { id = "id" } @@ -123,7 +123,7 @@ func TestAgentDataSourceHttpErrorHandling(t *testing.T) { util.MockGetAgent("id", util.EmptyGetListResponse, 1) }, Config: provider.ProviderConfig + ` - data "uxi_agent" "my_agent" { + data "hpeuxi_agent" "my_agent" { filter = { id = "id" } diff --git a/test/mocked/datasources/group_test.go b/test/mocked/datasources/group_test.go index 806853f2..ac3c9775 100644 --- a/test/mocked/datasources/group_test.go +++ b/test/mocked/datasources/group_test.go @@ -31,14 +31,14 @@ func TestGroupDataSource(t *testing.T) { util.MockGetGroup("id", util.GenerateGroupGetResponse("id", "", ""), 3) }, Config: provider.ProviderConfig + ` - data "uxi_group" "my_group" { + data "hpeuxi_group" "my_group" { filter = { id = "id" } } `, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("data.uxi_group.my_group", "id", "id"), + resource.TestCheckResourceAttr("data.hpeuxi_group.my_group", "id", "id"), ), }, { @@ -46,7 +46,7 @@ func TestGroupDataSource(t *testing.T) { util.MockGetGroup(util.MockRootGroupID, util.GenerateRootGroupGetResponse(), 1) }, Config: provider.ProviderConfig + ` - data "uxi_group" "my_group" { + data "hpeuxi_group" "my_group" { filter = { id = "my_root_group_id" } @@ -78,14 +78,14 @@ func TestGroupDataSourceTooManyRequestsHandling(t *testing.T) { util.MockGetGroup("id", util.GenerateGroupGetResponse("id", "", ""), 3) }, Config: provider.ProviderConfig + ` - data "uxi_group" "my_group" { + data "hpeuxi_group" "my_group" { filter = { id = "id" } } `, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("data.uxi_group.my_group", "id", "id"), + resource.TestCheckResourceAttr("data.hpeuxi_group.my_group", "id", "id"), func(s *terraform.State) error { assert.Equal(t, mockTooManyRequests.Mock.Request().Counter, 0) @@ -119,7 +119,7 @@ func TestGroupDataSourceHttpErrorHandling(t *testing.T) { }) }, Config: provider.ProviderConfig + ` - data "uxi_group" "my_group" { + data "hpeuxi_group" "my_group" { filter = { id = "id" } @@ -135,7 +135,7 @@ func TestGroupDataSourceHttpErrorHandling(t *testing.T) { util.MockGetGroup("id", util.EmptyGetListResponse, 1) }, Config: provider.ProviderConfig + ` - data "uxi_group" "my_group" { + data "hpeuxi_group" "my_group" { filter = { id = "id" } diff --git a/test/mocked/datasources/network_group_assignment_test.go b/test/mocked/datasources/network_group_assignment_test.go index 9de6ad2f..27ba5f5a 100644 --- a/test/mocked/datasources/network_group_assignment_test.go +++ b/test/mocked/datasources/network_group_assignment_test.go @@ -36,7 +36,7 @@ func TestNetworkGroupAssignmentDataSource(t *testing.T) { ) }, Config: provider.ProviderConfig + ` - data "uxi_network_group_assignment" "my_network_group_assignment" { + data "hpeuxi_network_group_assignment" "my_network_group_assignment" { filter = { id = "id" } @@ -44,17 +44,17 @@ func TestNetworkGroupAssignmentDataSource(t *testing.T) { `, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr( - "data.uxi_network_group_assignment.my_network_group_assignment", + "data.hpeuxi_network_group_assignment.my_network_group_assignment", "id", "id", ), resource.TestCheckResourceAttr( - "data.uxi_network_group_assignment.my_network_group_assignment", + "data.hpeuxi_network_group_assignment.my_network_group_assignment", "group_id", "group_id", ), resource.TestCheckResourceAttr( - "data.uxi_network_group_assignment.my_network_group_assignment", + "data.hpeuxi_network_group_assignment.my_network_group_assignment", "network_id", "network_id", ), @@ -88,7 +88,7 @@ func TestNetworkGroupAssignmentDataSourceTooManyRequestsHandling(t *testing.T) { ) }, Config: provider.ProviderConfig + ` - data "uxi_network_group_assignment" "my_network_group_assignment" { + data "hpeuxi_network_group_assignment" "my_network_group_assignment" { filter = { id = "id" } @@ -96,7 +96,7 @@ func TestNetworkGroupAssignmentDataSourceTooManyRequestsHandling(t *testing.T) { `, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr( - "data.uxi_network_group_assignment.my_network_group_assignment", + "data.hpeuxi_network_group_assignment.my_network_group_assignment", "id", "id", ), @@ -132,7 +132,7 @@ func TestNetworkGroupAssignmentDataSourceHttpErrorHandling(t *testing.T) { }) }, Config: provider.ProviderConfig + ` - data "uxi_network_group_assignment" "my_network_group_assignment" { + data "hpeuxi_network_group_assignment" "my_network_group_assignment" { filter = { id = "id" } @@ -147,7 +147,7 @@ func TestNetworkGroupAssignmentDataSourceHttpErrorHandling(t *testing.T) { util.MockGetNetworkGroupAssignment("id", util.EmptyGetListResponse, 1) }, Config: provider.ProviderConfig + ` - data "uxi_network_group_assignment" "my_network_group_assignment" { + data "hpeuxi_network_group_assignment" "my_network_group_assignment" { filter = { id = "id" } diff --git a/test/mocked/datasources/sensor_group_assignment_test.go b/test/mocked/datasources/sensor_group_assignment_test.go index f9fb5aba..003f22c1 100644 --- a/test/mocked/datasources/sensor_group_assignment_test.go +++ b/test/mocked/datasources/sensor_group_assignment_test.go @@ -36,7 +36,7 @@ func TestSensorGroupAssignmentDataSource(t *testing.T) { ) }, Config: provider.ProviderConfig + ` - data "uxi_sensor_group_assignment" "my_sensor_group_assignment" { + data "hpeuxi_sensor_group_assignment" "my_sensor_group_assignment" { filter = { id = "id" } @@ -44,17 +44,17 @@ func TestSensorGroupAssignmentDataSource(t *testing.T) { `, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr( - "data.uxi_sensor_group_assignment.my_sensor_group_assignment", + "data.hpeuxi_sensor_group_assignment.my_sensor_group_assignment", "id", "id", ), resource.TestCheckResourceAttr( - "data.uxi_sensor_group_assignment.my_sensor_group_assignment", + "data.hpeuxi_sensor_group_assignment.my_sensor_group_assignment", "group_id", "group_id", ), resource.TestCheckResourceAttr( - "data.uxi_sensor_group_assignment.my_sensor_group_assignment", + "data.hpeuxi_sensor_group_assignment.my_sensor_group_assignment", "sensor_id", "sensor_id", ), @@ -88,7 +88,7 @@ func TestSensorGroupAssignmentDataSourceTooManyRequestsHandling(t *testing.T) { ) }, Config: provider.ProviderConfig + ` - data "uxi_sensor_group_assignment" "my_sensor_group_assignment" { + data "hpeuxi_sensor_group_assignment" "my_sensor_group_assignment" { filter = { id = "id" } @@ -96,7 +96,7 @@ func TestSensorGroupAssignmentDataSourceTooManyRequestsHandling(t *testing.T) { `, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr( - "data.uxi_sensor_group_assignment.my_sensor_group_assignment", + "data.hpeuxi_sensor_group_assignment.my_sensor_group_assignment", "id", "id", ), @@ -132,7 +132,7 @@ func TestSensorGroupAssignmentDataSourceHttpErrorHandling(t *testing.T) { }) }, Config: provider.ProviderConfig + ` - data "uxi_sensor_group_assignment" "my_sensor_group_assignment" { + data "hpeuxi_sensor_group_assignment" "my_sensor_group_assignment" { filter = { id = "id" } @@ -147,7 +147,7 @@ func TestSensorGroupAssignmentDataSourceHttpErrorHandling(t *testing.T) { util.MockGetSensorGroupAssignment("id", util.EmptyGetListResponse, 1) }, Config: provider.ProviderConfig + ` - data "uxi_sensor_group_assignment" "my_sensor_group_assignment" { + data "hpeuxi_sensor_group_assignment" "my_sensor_group_assignment" { filter = { id = "id" } diff --git a/test/mocked/datasources/sensor_test.go b/test/mocked/datasources/sensor_test.go index 880f61ac..07f6d1e6 100644 --- a/test/mocked/datasources/sensor_test.go +++ b/test/mocked/datasources/sensor_test.go @@ -33,13 +33,13 @@ func TestSensorDataSource(t *testing.T) { util.MockGetSensor("id", util.GenerateSensorResponse("id", ""), 3) }, Config: provider.ProviderConfig + ` - data "uxi_sensor" "my_sensor" { + data "hpeuxi_sensor" "my_sensor" { filter = { id = "id" } } `, - Check: shared.CheckStateAgainstSensor(t, "data.uxi_sensor.my_sensor", sensor), + Check: shared.CheckStateAgainstSensor(t, "data.hpeuxi_sensor.my_sensor", sensor), }, }, }) @@ -66,14 +66,14 @@ func TestSensorDataSourceTooManyRequestsHandling(t *testing.T) { util.MockGetSensor("id", util.GenerateSensorResponse("id", ""), 3) }, Config: provider.ProviderConfig + ` - data "uxi_sensor" "my_sensor" { + data "hpeuxi_sensor" "my_sensor" { filter = { id = "id" } } `, Check: resource.ComposeAggregateTestCheckFunc( - shared.CheckStateAgainstSensor(t, "data.uxi_sensor.my_sensor", sensor), + shared.CheckStateAgainstSensor(t, "data.hpeuxi_sensor.my_sensor", sensor), func(s *terraform.State) error { assert.Equal(t, mockTooManyRequests.Mock.Request().Counter, 0) @@ -107,7 +107,7 @@ func TestSensorDataSourceHttpErrorHandling(t *testing.T) { }) }, Config: provider.ProviderConfig + ` - data "uxi_sensor" "my_sensor" { + data "hpeuxi_sensor" "my_sensor" { filter = { id = "id" } @@ -123,7 +123,7 @@ func TestSensorDataSourceHttpErrorHandling(t *testing.T) { util.MockGetSensor("id", util.EmptyGetListResponse, 1) }, Config: provider.ProviderConfig + ` - data "uxi_sensor" "my_sensor" { + data "hpeuxi_sensor" "my_sensor" { filter = { id = "id" } diff --git a/test/mocked/datasources/service_test.go b/test/mocked/datasources/service_test.go index 586e8ae1..14584f3a 100644 --- a/test/mocked/datasources/service_test.go +++ b/test/mocked/datasources/service_test.go @@ -33,7 +33,7 @@ func TestServiceTestDataSource(t *testing.T) { util.MockGetServiceTest("id", util.GenerateServiceTestResponse("id", ""), 3) }, Config: provider.ProviderConfig + ` - data "uxi_service_test" "my_service_test" { + data "hpeuxi_service_test" "my_service_test" { filter = { id = "id" } @@ -41,7 +41,7 @@ func TestServiceTestDataSource(t *testing.T) { `, Check: shared.CheckStateAgainstServiceTest( t, - "data.uxi_service_test.my_service_test", + "data.hpeuxi_service_test.my_service_test", serviceTest, ), }, @@ -70,7 +70,7 @@ func TestServiceTestDataSourceTooManyRequestsHandling(t *testing.T) { util.MockGetServiceTest("id", util.GenerateServiceTestResponse("id", ""), 3) }, Config: provider.ProviderConfig + ` - data "uxi_service_test" "my_service_test" { + data "hpeuxi_service_test" "my_service_test" { filter = { id = "id" } @@ -79,7 +79,7 @@ func TestServiceTestDataSourceTooManyRequestsHandling(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( shared.CheckStateAgainstServiceTest( t, - "data.uxi_service_test.my_service_test", + "data.hpeuxi_service_test.my_service_test", serviceTest, ), func(s *terraform.State) error { @@ -115,7 +115,7 @@ func TestServiceTestDataSourceHttpErrorHandling(t *testing.T) { }) }, Config: provider.ProviderConfig + ` - data "uxi_service_test" "my_service_test" { + data "hpeuxi_service_test" "my_service_test" { filter = { id = "id" } @@ -131,7 +131,7 @@ func TestServiceTestDataSourceHttpErrorHandling(t *testing.T) { util.MockGetServiceTest("id", util.EmptyGetListResponse, 1) }, Config: provider.ProviderConfig + ` - data "uxi_service_test" "my_service_test" { + data "hpeuxi_service_test" "my_service_test" { filter = { id = "id" } diff --git a/test/mocked/datasources/service_test_group_assignment_test.go b/test/mocked/datasources/service_test_group_assignment_test.go index 6367c45d..35532e3f 100644 --- a/test/mocked/datasources/service_test_group_assignment_test.go +++ b/test/mocked/datasources/service_test_group_assignment_test.go @@ -36,7 +36,7 @@ func TestServiceTestGroupAssignmentDataSource(t *testing.T) { ) }, Config: provider.ProviderConfig + ` - data "uxi_service_test_group_assignment" "my_service_test_group_assignment" { + data "hpeuxi_service_test_group_assignment" "my_service_test_group_assignment" { filter = { id = "id" } @@ -44,17 +44,17 @@ func TestServiceTestGroupAssignmentDataSource(t *testing.T) { `, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr( - "data.uxi_service_test_group_assignment.my_service_test_group_assignment", + "data.hpeuxi_service_test_group_assignment.my_service_test_group_assignment", "id", "id", ), resource.TestCheckResourceAttr( - "data.uxi_service_test_group_assignment.my_service_test_group_assignment", + "data.hpeuxi_service_test_group_assignment.my_service_test_group_assignment", "group_id", "group_id", ), resource.TestCheckResourceAttr( - "data.uxi_service_test_group_assignment.my_service_test_group_assignment", + "data.hpeuxi_service_test_group_assignment.my_service_test_group_assignment", "service_test_id", "service_test_id", ), @@ -88,7 +88,7 @@ func TestServiceTestGroupAssignmentDataSourceTooManyRequestsHandling(t *testing. ) }, Config: provider.ProviderConfig + ` - data "uxi_service_test_group_assignment" "my_service_test_group_assignment" { + data "hpeuxi_service_test_group_assignment" "my_service_test_group_assignment" { filter = { id = "id" } @@ -96,7 +96,7 @@ func TestServiceTestGroupAssignmentDataSourceTooManyRequestsHandling(t *testing. `, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr( - "data.uxi_service_test_group_assignment.my_service_test_group_assignment", + "data.hpeuxi_service_test_group_assignment.my_service_test_group_assignment", "id", "id", ), @@ -132,7 +132,7 @@ func TestServiceTestGroupAssignmentDataSourceHttpErrorHandling(t *testing.T) { }) }, Config: provider.ProviderConfig + ` - data "uxi_service_test_group_assignment" "my_service_test_group_assignment" { + data "hpeuxi_service_test_group_assignment" "my_service_test_group_assignment" { filter = { id = "id" } @@ -147,7 +147,7 @@ func TestServiceTestGroupAssignmentDataSourceHttpErrorHandling(t *testing.T) { util.MockGetServiceTestGroupAssignment("id", util.EmptyGetListResponse, 1) }, Config: provider.ProviderConfig + ` - data "uxi_service_test_group_assignment" "my_service_test_group_assignment" { + data "hpeuxi_service_test_group_assignment" "my_service_test_group_assignment" { filter = { id = "id" } diff --git a/test/mocked/datasources/wired_network_test.go b/test/mocked/datasources/wired_network_test.go index ebd118ab..8769b7c3 100644 --- a/test/mocked/datasources/wired_network_test.go +++ b/test/mocked/datasources/wired_network_test.go @@ -33,7 +33,7 @@ func TestWiredNetworkDataSource(t *testing.T) { util.MockGetWiredNetwork("id", util.GenerateWiredNetworkResponse("id", ""), 3) }, Config: provider.ProviderConfig + ` - data "uxi_wired_network" "my_wired_network" { + data "hpeuxi_wired_network" "my_wired_network" { filter = { id = "id" } @@ -41,7 +41,7 @@ func TestWiredNetworkDataSource(t *testing.T) { `, Check: shared.CheckStateAgainstWiredNetwork( t, - "data.uxi_wired_network.my_wired_network", + "data.hpeuxi_wired_network.my_wired_network", wiredNetwork, ), }, @@ -70,7 +70,7 @@ func TestWiredNetworkDataSourceTooManyRequestsHandling(t *testing.T) { util.MockGetWiredNetwork("id", util.GenerateWiredNetworkResponse("id", ""), 3) }, Config: provider.ProviderConfig + ` - data "uxi_wired_network" "my_wired_network" { + data "hpeuxi_wired_network" "my_wired_network" { filter = { id = "id" } @@ -79,7 +79,7 @@ func TestWiredNetworkDataSourceTooManyRequestsHandling(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( shared.CheckStateAgainstWiredNetwork( t, - "data.uxi_wired_network.my_wired_network", + "data.hpeuxi_wired_network.my_wired_network", wiredNetwork, ), func(s *terraform.State) error { @@ -114,7 +114,7 @@ func TestWiredNetworkAssignmentDataSourceHttpErrorHandling(t *testing.T) { }) }, Config: provider.ProviderConfig + ` - data "uxi_wired_network" "my_wired_network" { + data "hpeuxi_wired_network" "my_wired_network" { filter = { id = "id" } @@ -129,7 +129,7 @@ func TestWiredNetworkAssignmentDataSourceHttpErrorHandling(t *testing.T) { util.MockGetWiredNetwork("id", util.EmptyGetListResponse, 1) }, Config: provider.ProviderConfig + ` - data "uxi_wired_network" "my_wired_network" { + data "hpeuxi_wired_network" "my_wired_network" { filter = { id = "id" } diff --git a/test/mocked/datasources/wireless_network_test.go b/test/mocked/datasources/wireless_network_test.go index 6471b1c5..a377371c 100644 --- a/test/mocked/datasources/wireless_network_test.go +++ b/test/mocked/datasources/wireless_network_test.go @@ -37,7 +37,7 @@ func TestWirelessNetworkDataSource(t *testing.T) { ) }, Config: provider.ProviderConfig + ` - data "uxi_wireless_network" "my_wireless_network" { + data "hpeuxi_wireless_network" "my_wireless_network" { filter = { id = "id" } @@ -45,7 +45,7 @@ func TestWirelessNetworkDataSource(t *testing.T) { `, Check: shared.CheckStateAgainstWirelessNetwork( t, - "data.uxi_wireless_network.my_wireless_network", + "data.hpeuxi_wireless_network.my_wireless_network", wirelessNetwork, ), }, @@ -78,7 +78,7 @@ func TestWirelessNetworkDataSourceTooManyRequestsHandling(t *testing.T) { ) }, Config: provider.ProviderConfig + ` - data "uxi_wireless_network" "my_wireless_network" { + data "hpeuxi_wireless_network" "my_wireless_network" { filter = { id = "id" } @@ -87,7 +87,7 @@ func TestWirelessNetworkDataSourceTooManyRequestsHandling(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( shared.CheckStateAgainstWirelessNetwork( t, - "data.uxi_wireless_network.my_wireless_network", + "data.hpeuxi_wireless_network.my_wireless_network", wirelessNetwork, ), func(s *terraform.State) error { @@ -123,7 +123,7 @@ func TestWirelessNetworkAssignmentDataSourceHttpErrorHandling(t *testing.T) { }) }, Config: provider.ProviderConfig + ` - data "uxi_wireless_network" "my_wireless_network" { + data "hpeuxi_wireless_network" "my_wireless_network" { filter = { id = "id" } @@ -138,7 +138,7 @@ func TestWirelessNetworkAssignmentDataSourceHttpErrorHandling(t *testing.T) { util.MockGetWirelessNetwork("id", util.EmptyGetListResponse, 1) }, Config: provider.ProviderConfig + ` - data "uxi_wireless_network" "my_wireless_network" { + data "hpeuxi_wireless_network" "my_wireless_network" { filter = { id = "id" } diff --git a/test/mocked/provider/provider.go b/test/mocked/provider/provider.go index 56286a14..c968455f 100644 --- a/test/mocked/provider/provider.go +++ b/test/mocked/provider/provider.go @@ -12,12 +12,12 @@ import ( ) const ( - ProviderConfig = `provider "uxi" { + ProviderConfig = `provider "hpeuxi" { client_id = "client_id" client_secret = "client_secret" }` ) var TestAccProtoV6ProviderFactories = map[string]func() (tfprotov6.ProviderServer, error){ - "uxi": providerserver.NewProtocol6WithError(provider.New("test")()), + "hpeuxi": providerserver.NewProtocol6WithError(provider.New("test")()), } diff --git a/test/mocked/resources/agent_group_assignment_test.go b/test/mocked/resources/agent_group_assignment_test.go index 077374cf..75e4da14 100644 --- a/test/mocked/resources/agent_group_assignment_test.go +++ b/test/mocked/resources/agent_group_assignment_test.go @@ -64,39 +64,39 @@ func TestAgentGroupAssignmentResource(t *testing.T) { }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" } - resource "uxi_agent" "my_agent" { + resource "hpeuxi_agent" "my_agent" { name = "name" notes = "notes" pcap_mode = "light" } import { - to = uxi_agent.my_agent + to = hpeuxi_agent.my_agent id = "agent_id" } - resource "uxi_agent_group_assignment" "my_agent_group_assignment" { - agent_id = uxi_agent.my_agent.id - group_id = uxi_group.my_group.id + resource "hpeuxi_agent_group_assignment" "my_agent_group_assignment" { + agent_id = hpeuxi_agent.my_agent.id + group_id = hpeuxi_group.my_group.id }`, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr( - "uxi_agent_group_assignment.my_agent_group_assignment", + "hpeuxi_agent_group_assignment.my_agent_group_assignment", "agent_id", "agent_id", ), resource.TestCheckResourceAttr( - "uxi_agent_group_assignment.my_agent_group_assignment", + "hpeuxi_agent_group_assignment.my_agent_group_assignment", "group_id", "group_id", ), resource.TestCheckResourceAttr( - "uxi_agent_group_assignment.my_agent_group_assignment", + "hpeuxi_agent_group_assignment.my_agent_group_assignment", "id", "agent_group_assignment_id", ), @@ -111,7 +111,7 @@ func TestAgentGroupAssignmentResource(t *testing.T) { 1, ) }, - ResourceName: "uxi_agent_group_assignment.my_agent_group_assignment", + ResourceName: "hpeuxi_agent_group_assignment.my_agent_group_assignment", ImportState: true, ImportStateVerify: true, }, @@ -174,57 +174,57 @@ func TestAgentGroupAssignmentResource(t *testing.T) { }, Config: provider.ProviderConfig + ` // the original resources - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" } - resource "uxi_agent" "my_agent" { + resource "hpeuxi_agent" "my_agent" { name = "name" notes = "notes" pcap_mode = "light" } import { - to = uxi_agent.my_agent + to = hpeuxi_agent.my_agent id = "agent_id" } // the new resources we wanna update the assignment to - resource "uxi_group" "my_group_2" { + resource "hpeuxi_group" "my_group_2" { name = "name_2" parent_group_id = "parent_id_2" } - resource "uxi_agent" "my_agent_2" { + resource "hpeuxi_agent" "my_agent_2" { name = "name_2" notes = "notes_2" pcap_mode = "light" } import { - to = uxi_agent.my_agent_2 + to = hpeuxi_agent.my_agent_2 id = "agent_id_2" } // the assignment update, updated from agent/group to agent_2/group_2 - resource "uxi_agent_group_assignment" "my_agent_group_assignment" { - agent_id = uxi_agent.my_agent_2.id - group_id = uxi_group.my_group_2.id + resource "hpeuxi_agent_group_assignment" "my_agent_group_assignment" { + agent_id = hpeuxi_agent.my_agent_2.id + group_id = hpeuxi_group.my_group_2.id }`, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr( - "uxi_agent_group_assignment.my_agent_group_assignment", + "hpeuxi_agent_group_assignment.my_agent_group_assignment", "agent_id", "agent_id_2", ), resource.TestCheckResourceAttr( - "uxi_agent_group_assignment.my_agent_group_assignment", + "hpeuxi_agent_group_assignment.my_agent_group_assignment", "group_id", "group_id_2", ), resource.TestCheckResourceAttr( - "uxi_agent_group_assignment.my_agent_group_assignment", + "hpeuxi_agent_group_assignment.my_agent_group_assignment", "id", "agent_group_assignment_id_2", ), @@ -332,29 +332,29 @@ func TestAgentGroupAssignmentResourceTooManyRequestsHandling(t *testing.T) { }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" } - resource "uxi_agent" "my_agent" { + resource "hpeuxi_agent" "my_agent" { name = "name" notes = "notes" pcap_mode = "light" } import { - to = uxi_agent.my_agent + to = hpeuxi_agent.my_agent id = "agent_id" } - resource "uxi_agent_group_assignment" "my_agent_group_assignment" { - agent_id = uxi_agent.my_agent.id - group_id = uxi_group.my_group.id + resource "hpeuxi_agent_group_assignment" "my_agent_group_assignment" { + agent_id = hpeuxi_agent.my_agent.id + group_id = hpeuxi_group.my_group.id }`, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr( - "uxi_agent_group_assignment.my_agent_group_assignment", + "hpeuxi_agent_group_assignment.my_agent_group_assignment", "id", "agent_group_assignment_id", ), @@ -378,7 +378,7 @@ func TestAgentGroupAssignmentResourceTooManyRequestsHandling(t *testing.T) { 1, ) }, - ResourceName: "uxi_agent_group_assignment.my_agent_group_assignment", + ResourceName: "hpeuxi_agent_group_assignment.my_agent_group_assignment", ImportState: true, ImportStateVerify: true, Check: func(s *terraform.State) error { @@ -459,25 +459,25 @@ func TestAgentGroupAssignmentResourceHttpErrorHandling(t *testing.T) { }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" } - resource "uxi_agent" "my_agent" { + resource "hpeuxi_agent" "my_agent" { name = "name" notes = "notes" pcap_mode = "light" } import { - to = uxi_agent.my_agent + to = hpeuxi_agent.my_agent id = "agent_id" } - resource "uxi_agent_group_assignment" "my_agent_group_assignment" { - agent_id = uxi_agent.my_agent.id - group_id = uxi_group.my_group.id + resource "hpeuxi_agent_group_assignment" "my_agent_group_assignment" { + agent_id = hpeuxi_agent.my_agent.id + group_id = hpeuxi_group.my_group.id }`, ExpectError: regexp.MustCompile( `(?s)Validation error - bad request\s*DebugID: 12312-123123-123123-1231212`, @@ -508,29 +508,29 @@ func TestAgentGroupAssignmentResourceHttpErrorHandling(t *testing.T) { ) }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" } - resource "uxi_agent" "my_agent" { + resource "hpeuxi_agent" "my_agent" { name = "name" notes = "notes" pcap_mode = "light" } import { - to = uxi_agent.my_agent + to = hpeuxi_agent.my_agent id = "agent_id" } - resource "uxi_agent_group_assignment" "my_agent_group_assignment" { - agent_id = uxi_agent.my_agent.id - group_id = uxi_group.my_group.id + resource "hpeuxi_agent_group_assignment" "my_agent_group_assignment" { + agent_id = hpeuxi_agent.my_agent.id + group_id = hpeuxi_group.my_group.id } import { - to = uxi_agent_group_assignment.my_agent_group_assignment + to = hpeuxi_agent_group_assignment.my_agent_group_assignment id = "agent_group_assignment_id" } `, @@ -565,29 +565,29 @@ func TestAgentGroupAssignmentResourceHttpErrorHandling(t *testing.T) { }) }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" } - resource "uxi_agent" "my_agent" { + resource "hpeuxi_agent" "my_agent" { name = "name" notes = "notes" pcap_mode = "light" } import { - to = uxi_agent.my_agent + to = hpeuxi_agent.my_agent id = "agent_id" } - resource "uxi_agent_group_assignment" "my_agent_group_assignment" { - agent_id = uxi_agent.my_agent.id - group_id = uxi_group.my_group.id + resource "hpeuxi_agent_group_assignment" "my_agent_group_assignment" { + agent_id = hpeuxi_agent.my_agent.id + group_id = hpeuxi_group.my_group.id } import { - to = uxi_agent_group_assignment.my_agent_group_assignment + to = hpeuxi_agent_group_assignment.my_agent_group_assignment id = "agent_group_assignment_id" } `, @@ -636,12 +636,12 @@ func TestAgentGroupAssignmentResourceHttpErrorHandling(t *testing.T) { }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" } - resource "uxi_agent" "my_agent" { + resource "hpeuxi_agent" "my_agent" { name = "name" notes = "notes" pcap_mode = "light" @@ -649,17 +649,17 @@ func TestAgentGroupAssignmentResourceHttpErrorHandling(t *testing.T) { } import { - to = uxi_agent.my_agent + to = hpeuxi_agent.my_agent id = "agent_id" } - resource "uxi_agent_group_assignment" "my_agent_group_assignment" { - agent_id = uxi_agent.my_agent.id - group_id = uxi_group.my_group.id + resource "hpeuxi_agent_group_assignment" "my_agent_group_assignment" { + agent_id = hpeuxi_agent.my_agent.id + group_id = hpeuxi_group.my_group.id }`, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr( - "uxi_agent_group_assignment.my_agent_group_assignment", + "hpeuxi_agent_group_assignment.my_agent_group_assignment", "agent_id", "agent_id", ), @@ -693,7 +693,7 @@ func TestAgentGroupAssignmentResourceHttpErrorHandling(t *testing.T) { }, Config: provider.ProviderConfig + ` removed { - from = uxi_agent.my_agent + from = hpeuxi_agent.my_agent lifecycle { destroy = false @@ -722,7 +722,7 @@ func TestAgentGroupAssignmentResourceHttpErrorHandling(t *testing.T) { }, Config: provider.ProviderConfig + ` removed { - from = uxi_agent.my_agent + from = hpeuxi_agent.my_agent lifecycle { destroy = false diff --git a/test/mocked/resources/agent_test.go b/test/mocked/resources/agent_test.go index 88e448ab..3f8f8538 100644 --- a/test/mocked/resources/agent_test.go +++ b/test/mocked/resources/agent_test.go @@ -32,7 +32,7 @@ func TestAgentResource(t *testing.T) { // Creating an agent is not allowed { Config: provider.ProviderConfig + ` - resource "uxi_agent" "my_agent" { + resource "hpeuxi_agent" "my_agent" { name = "name" notes = "note" pcap_mode = "light" @@ -48,25 +48,25 @@ func TestAgentResource(t *testing.T) { util.MockGetAgent("id", util.GenerateAgentResponse("id", ""), 2) }, Config: provider.ProviderConfig + ` - resource "uxi_agent" "my_agent" { + resource "hpeuxi_agent" "my_agent" { name = "name" notes = "notes" pcap_mode = "light" } import { - to = uxi_agent.my_agent + to = hpeuxi_agent.my_agent id = "id" }`, - Check: shared.CheckStateAgainstAgent(t, "uxi_agent.my_agent", agent), + Check: shared.CheckStateAgainstAgent(t, "hpeuxi_agent.my_agent", agent), }, // ImportState testing { PreConfig: func() { util.MockGetAgent("id", util.GenerateAgentResponse("id", ""), 1) }, - ResourceName: "uxi_agent.my_agent", + ResourceName: "hpeuxi_agent.my_agent", ImportState: true, ImportStateVerify: true, }, @@ -85,12 +85,12 @@ func TestAgentResource(t *testing.T) { util.MockGetAgent("id", util.GenerateAgentResponse("id", "_2"), 1) }, Config: provider.ProviderConfig + ` - resource "uxi_agent" "my_agent" { + resource "hpeuxi_agent" "my_agent" { name = "name_2" notes = "notes_2" pcap_mode = "light" }`, - Check: shared.CheckStateAgainstAgent(t, "uxi_agent.my_agent", updatedAgent), + Check: shared.CheckStateAgainstAgent(t, "hpeuxi_agent.my_agent", updatedAgent), }, // Delete testing { @@ -130,19 +130,19 @@ func TestAgentResourceTooManyRequestsHandling(t *testing.T) { util.MockGetAgent("id", util.GenerateAgentResponse("id", ""), 2) }, Config: provider.ProviderConfig + ` - resource "uxi_agent" "my_agent" { + resource "hpeuxi_agent" "my_agent" { name = "name" notes = "notes" pcap_mode = "light" } import { - to = uxi_agent.my_agent + to = hpeuxi_agent.my_agent id = "id" }`, Check: resource.ComposeAggregateTestCheckFunc( - shared.CheckStateAgainstAgent(t, "uxi_agent.my_agent", agent), + shared.CheckStateAgainstAgent(t, "hpeuxi_agent.my_agent", agent), func(s *terraform.State) error { assert.Equal(t, mockTooManyRequests.Mock.Request().Counter, 0) @@ -169,13 +169,13 @@ func TestAgentResourceTooManyRequestsHandling(t *testing.T) { util.MockGetAgent("id", util.GenerateAgentResponse("id", "_2"), 1) }, Config: provider.ProviderConfig + ` - resource "uxi_agent" "my_agent" { + resource "hpeuxi_agent" "my_agent" { name = "name_2" notes = "notes_2" pcap_mode = "light" }`, Check: resource.ComposeAggregateTestCheckFunc( - shared.CheckStateAgainstAgent(t, "uxi_agent.my_agent", updatedAgent), + shared.CheckStateAgainstAgent(t, "hpeuxi_agent.my_agent", updatedAgent), func(s *terraform.State) error { assert.Equal(t, mockTooManyRequests.Mock.Request().Counter, 0) @@ -234,14 +234,14 @@ func TestAgentResourceHttpErrorHandling(t *testing.T) { }) }, Config: provider.ProviderConfig + ` - resource "uxi_agent" "my_agent" { + resource "hpeuxi_agent" "my_agent" { name = "name" notes = "notes" pcap_mode = "light" } import { - to = uxi_agent.my_agent + to = hpeuxi_agent.my_agent id = "id" }`, @@ -255,14 +255,14 @@ func TestAgentResourceHttpErrorHandling(t *testing.T) { util.MockGetAgent("id", util.EmptyGetListResponse, 1) }, Config: provider.ProviderConfig + ` - resource "uxi_agent" "my_agent" { + resource "hpeuxi_agent" "my_agent" { name = "name" notes = "notes" pcap_mode = "light" } import { - to = uxi_agent.my_agent + to = hpeuxi_agent.my_agent id = "id" }`, @@ -274,18 +274,18 @@ func TestAgentResourceHttpErrorHandling(t *testing.T) { util.MockGetAgent("id", util.GenerateAgentResponse("id", ""), 2) }, Config: provider.ProviderConfig + ` - resource "uxi_agent" "my_agent" { + resource "hpeuxi_agent" "my_agent" { name = "name" notes = "notes" pcap_mode = "light" } import { - to = uxi_agent.my_agent + to = hpeuxi_agent.my_agent id = "id" }`, - Check: shared.CheckStateAgainstAgent(t, "uxi_agent.my_agent", agent), + Check: shared.CheckStateAgainstAgent(t, "hpeuxi_agent.my_agent", agent), }, // Update HTTP error { @@ -305,7 +305,7 @@ func TestAgentResourceHttpErrorHandling(t *testing.T) { }) }, Config: provider.ProviderConfig + ` - resource "uxi_agent" "my_agent" { + resource "hpeuxi_agent" "my_agent" { name = "name_2" notes = "notes_2" pcap_mode = "light" diff --git a/test/mocked/resources/group_test.go b/test/mocked/resources/group_test.go index faa6d5fa..a811d477 100644 --- a/test/mocked/resources/group_test.go +++ b/test/mocked/resources/group_test.go @@ -46,18 +46,18 @@ func TestGroupResource(t *testing.T) { ) }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" }`, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("uxi_group.my_group", "name", "name"), + resource.TestCheckResourceAttr("hpeuxi_group.my_group", "name", "name"), resource.TestCheckResourceAttr( - "uxi_group.my_group", + "hpeuxi_group.my_group", "parent_group_id", "parent_id", ), - resource.TestCheckResourceAttr("uxi_group.my_group", "id", "id"), + resource.TestCheckResourceAttr("hpeuxi_group.my_group", "id", "id"), ), }, // ImportState @@ -71,7 +71,7 @@ func TestGroupResource(t *testing.T) { 1, ) }, - ResourceName: "uxi_group.my_group", + ResourceName: "hpeuxi_group.my_group", ImportState: true, ImportStateVerify: true, }, @@ -95,18 +95,18 @@ func TestGroupResource(t *testing.T) { ) }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name_2" parent_group_id = "parent_id" }`, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("uxi_group.my_group", "name", "name_2"), + resource.TestCheckResourceAttr("hpeuxi_group.my_group", "name", "name_2"), resource.TestCheckResourceAttr( - "uxi_group.my_group", + "hpeuxi_group.my_group", "parent_group_id", "parent_id", ), - resource.TestCheckResourceAttr("uxi_group.my_group", "id", "id"), + resource.TestCheckResourceAttr("hpeuxi_group.my_group", "id", "id"), ), }, // Update that does trigger a recreate @@ -129,18 +129,18 @@ func TestGroupResource(t *testing.T) { util.MockDeleteGroup("id", 1) }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id_2" }`, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("uxi_group.my_group", "name", "name"), + resource.TestCheckResourceAttr("hpeuxi_group.my_group", "name", "name"), resource.TestCheckResourceAttr( - "uxi_group.my_group", + "hpeuxi_group.my_group", "parent_group_id", "parent_id_2", ), - resource.TestCheckResourceAttr("uxi_group.my_group", "id", "new_id"), + resource.TestCheckResourceAttr("hpeuxi_group.my_group", "id", "new_id"), ), }, // Delete @@ -174,12 +174,12 @@ func TestRootGroupResource(t *testing.T) { util.MockGetGroup(util.MockRootGroupID, util.GenerateRootGroupGetResponse(), 1) }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_root_group" { + resource "hpeuxi_group" "my_root_group" { name = "name" } import { - to = uxi_group.my_root_group + to = hpeuxi_group.my_root_group id = "` + util.MockRootGroupID + `" }`, ExpectError: regexp.MustCompile(`The root group cannot be used as a resource`), @@ -201,13 +201,13 @@ func TestRootGroupResource(t *testing.T) { ) }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" }`, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("uxi_group.my_group", "id", "id"), - resource.TestCheckResourceAttr("uxi_group.my_group", "name", "name"), - resource.TestCheckNoResourceAttr("uxi_group.my_group", "parent_group_id"), + resource.TestCheckResourceAttr("hpeuxi_group.my_group", "id", "id"), + resource.TestCheckResourceAttr("hpeuxi_group.my_group", "name", "name"), + resource.TestCheckNoResourceAttr("hpeuxi_group.my_group", "parent_group_id"), ), }, // Delete testing @@ -258,12 +258,12 @@ func TestGroupResourceTooManyRequestsHandling(t *testing.T) { ) }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" }`, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("uxi_group.my_group", "id", "id"), + resource.TestCheckResourceAttr("hpeuxi_group.my_group", "id", "id"), func(s *terraform.State) error { assert.Equal(t, mockTooManyRequests.Mock.Request().Counter, 0) @@ -286,11 +286,11 @@ func TestGroupResourceTooManyRequestsHandling(t *testing.T) { 1, ) }, - ResourceName: "uxi_group.my_group", + ResourceName: "hpeuxi_group.my_group", ImportState: true, ImportStateVerify: true, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("uxi_group.my_group", "id", "id"), + resource.TestCheckResourceAttr("hpeuxi_group.my_group", "id", "id"), func(s *terraform.State) error { assert.Equal(t, mockTooManyRequests.Mock.Request().Counter, 0) @@ -323,12 +323,12 @@ func TestGroupResourceTooManyRequestsHandling(t *testing.T) { ) }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name_2" parent_group_id = "parent_id" }`, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("uxi_group.my_group", "name", "name_2"), + resource.TestCheckResourceAttr("hpeuxi_group.my_group", "name", "name_2"), func(s *terraform.State) error { assert.Equal(t, mockTooManyRequests.Mock.Request().Counter, 0) @@ -371,13 +371,13 @@ func TestGroupResourceHttpErrorHandling(t *testing.T) { }) }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" } import { - to = uxi_group.my_group + to = hpeuxi_group.my_group id = "id" } `, @@ -391,13 +391,13 @@ func TestGroupResourceHttpErrorHandling(t *testing.T) { util.MockGetGroup("id", util.EmptyGetListResponse, 1) }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" } import { - to = uxi_group.my_group + to = hpeuxi_group.my_group id = "id" } `, @@ -418,7 +418,7 @@ func TestGroupResourceHttpErrorHandling(t *testing.T) { }) }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" }`, @@ -443,12 +443,12 @@ func TestGroupResourceHttpErrorHandling(t *testing.T) { ) }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" }`, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("uxi_group.my_group", "id", "id"), + resource.TestCheckResourceAttr("hpeuxi_group.my_group", "id", "id"), ), }, // Update HTTP error @@ -468,7 +468,7 @@ func TestGroupResourceHttpErrorHandling(t *testing.T) { }) }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name_2" parent_group_id = "parent_id" }`, diff --git a/test/mocked/resources/network_group_assignment_test.go b/test/mocked/resources/network_group_assignment_test.go index fca8b8ad..22ec379c 100644 --- a/test/mocked/resources/network_group_assignment_test.go +++ b/test/mocked/resources/network_group_assignment_test.go @@ -71,37 +71,37 @@ func TestNetworkGroupAssignmentResourceForWiredNetwork(t *testing.T) { }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" } - resource "uxi_wired_network" "my_network" { + resource "hpeuxi_wired_network" "my_network" { name = "name" } import { - to = uxi_wired_network.my_network + to = hpeuxi_wired_network.my_network id = "network_id" } - resource "uxi_network_group_assignment" "my_network_group_assignment" { - network_id = uxi_wired_network.my_network.id - group_id = uxi_group.my_group.id + resource "hpeuxi_network_group_assignment" "my_network_group_assignment" { + network_id = hpeuxi_wired_network.my_network.id + group_id = hpeuxi_group.my_group.id }`, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr( - "uxi_network_group_assignment.my_network_group_assignment", + "hpeuxi_network_group_assignment.my_network_group_assignment", "network_id", "network_id", ), resource.TestCheckResourceAttr( - "uxi_network_group_assignment.my_network_group_assignment", + "hpeuxi_network_group_assignment.my_network_group_assignment", "group_id", "group_id", ), resource.TestCheckResourceAttr( - "uxi_network_group_assignment.my_network_group_assignment", + "hpeuxi_network_group_assignment.my_network_group_assignment", "id", "network_group_assignment_id", ), @@ -119,7 +119,7 @@ func TestNetworkGroupAssignmentResourceForWiredNetwork(t *testing.T) { 1, ) }, - ResourceName: "uxi_network_group_assignment.my_network_group_assignment", + ResourceName: "hpeuxi_network_group_assignment.my_network_group_assignment", ImportState: true, ImportStateVerify: true, }, @@ -186,53 +186,53 @@ func TestNetworkGroupAssignmentResourceForWiredNetwork(t *testing.T) { }, Config: provider.ProviderConfig + ` // the original resources - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" } - resource "uxi_wired_network" "my_network" { + resource "hpeuxi_wired_network" "my_network" { name = "name" } import { - to = uxi_wired_network.my_network + to = hpeuxi_wired_network.my_network id = "network_id" } // the new resources we wanna update the assignment to - resource "uxi_group" "my_group_2" { + resource "hpeuxi_group" "my_group_2" { name = "name_2" parent_group_id = "parent_id_2" } - resource "uxi_wired_network" "my_network_2" { + resource "hpeuxi_wired_network" "my_network_2" { name = "name_2" } import { - to = uxi_wired_network.my_network_2 + to = hpeuxi_wired_network.my_network_2 id = "network_id_2" } // the assignment update, updated from network/group to network_2/group_2 - resource "uxi_network_group_assignment" "my_network_group_assignment" { - network_id = uxi_wired_network.my_network_2.id - group_id = uxi_group.my_group_2.id + resource "hpeuxi_network_group_assignment" "my_network_group_assignment" { + network_id = hpeuxi_wired_network.my_network_2.id + group_id = hpeuxi_group.my_group_2.id }`, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr( - "uxi_network_group_assignment.my_network_group_assignment", + "hpeuxi_network_group_assignment.my_network_group_assignment", "network_id", "network_id_2", ), resource.TestCheckResourceAttr( - "uxi_network_group_assignment.my_network_group_assignment", + "hpeuxi_network_group_assignment.my_network_group_assignment", "group_id", "group_id_2", ), resource.TestCheckResourceAttr( - "uxi_network_group_assignment.my_network_group_assignment", + "hpeuxi_network_group_assignment.my_network_group_assignment", "id", "network_group_assignment_id_2", ), @@ -285,7 +285,7 @@ func TestNetworkGroupAssignmentResourceForWiredNetwork(t *testing.T) { }, Config: provider.ProviderConfig + ` removed { - from = uxi_wired_network.my_network + from = hpeuxi_wired_network.my_network lifecycle { destroy = false @@ -293,7 +293,7 @@ func TestNetworkGroupAssignmentResourceForWiredNetwork(t *testing.T) { } removed { - from = uxi_wired_network.my_network_2 + from = hpeuxi_wired_network.my_network_2 lifecycle { destroy = false @@ -358,37 +358,37 @@ func TestNetworkGroupAssignmentResourceForWirelessNetwork(t *testing.T) { }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" } - resource "uxi_wireless_network" "my_network" { + resource "hpeuxi_wireless_network" "my_network" { name = "name" } import { - to = uxi_wireless_network.my_network + to = hpeuxi_wireless_network.my_network id = "network_id" } - resource "uxi_network_group_assignment" "my_network_group_assignment" { - network_id = uxi_wireless_network.my_network.id - group_id = uxi_group.my_group.id + resource "hpeuxi_network_group_assignment" "my_network_group_assignment" { + network_id = hpeuxi_wireless_network.my_network.id + group_id = hpeuxi_group.my_group.id }`, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr( - "uxi_network_group_assignment.my_network_group_assignment", + "hpeuxi_network_group_assignment.my_network_group_assignment", "network_id", "network_id", ), resource.TestCheckResourceAttr( - "uxi_network_group_assignment.my_network_group_assignment", + "hpeuxi_network_group_assignment.my_network_group_assignment", "group_id", "group_id", ), resource.TestCheckResourceAttr( - "uxi_network_group_assignment.my_network_group_assignment", + "hpeuxi_network_group_assignment.my_network_group_assignment", "id", "network_group_assignment_id", ), @@ -406,7 +406,7 @@ func TestNetworkGroupAssignmentResourceForWirelessNetwork(t *testing.T) { 1, ) }, - ResourceName: "uxi_network_group_assignment.my_network_group_assignment", + ResourceName: "hpeuxi_network_group_assignment.my_network_group_assignment", ImportState: true, ImportStateVerify: true, }, @@ -473,53 +473,53 @@ func TestNetworkGroupAssignmentResourceForWirelessNetwork(t *testing.T) { }, Config: provider.ProviderConfig + ` // the original resources - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" } - resource "uxi_wireless_network" "my_network" { + resource "hpeuxi_wireless_network" "my_network" { name = "name" } import { - to = uxi_wireless_network.my_network + to = hpeuxi_wireless_network.my_network id = "network_id" } // the new resources we wanna update the assignment to - resource "uxi_group" "my_group_2" { + resource "hpeuxi_group" "my_group_2" { name = "name_2" parent_group_id = "parent_id_2" } - resource "uxi_wireless_network" "my_network_2" { + resource "hpeuxi_wireless_network" "my_network_2" { name = "name_2" } import { - to = uxi_wireless_network.my_network_2 + to = hpeuxi_wireless_network.my_network_2 id = "network_id_2" } // the assignment update, updated from network/group to network_2/group_2 - resource "uxi_network_group_assignment" "my_network_group_assignment" { - network_id = uxi_wireless_network.my_network_2.id - group_id = uxi_group.my_group_2.id + resource "hpeuxi_network_group_assignment" "my_network_group_assignment" { + network_id = hpeuxi_wireless_network.my_network_2.id + group_id = hpeuxi_group.my_group_2.id }`, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr( - "uxi_network_group_assignment.my_network_group_assignment", + "hpeuxi_network_group_assignment.my_network_group_assignment", "network_id", "network_id_2", ), resource.TestCheckResourceAttr( - "uxi_network_group_assignment.my_network_group_assignment", + "hpeuxi_network_group_assignment.my_network_group_assignment", "group_id", "group_id_2", ), resource.TestCheckResourceAttr( - "uxi_network_group_assignment.my_network_group_assignment", + "hpeuxi_network_group_assignment.my_network_group_assignment", "id", "network_group_assignment_id_2", ), @@ -572,7 +572,7 @@ func TestNetworkGroupAssignmentResourceForWirelessNetwork(t *testing.T) { }, Config: provider.ProviderConfig + ` removed { - from = uxi_wireless_network.my_network + from = hpeuxi_wireless_network.my_network lifecycle { destroy = false @@ -580,7 +580,7 @@ func TestNetworkGroupAssignmentResourceForWirelessNetwork(t *testing.T) { } removed { - from = uxi_wireless_network.my_network_2 + from = hpeuxi_wireless_network.my_network_2 lifecycle { destroy = false @@ -649,27 +649,27 @@ func TestNetworkGroupAssignmentResourceTooManyRequestsHandling(t *testing.T) { }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" } - resource "uxi_wired_network" "my_network" { + resource "hpeuxi_wired_network" "my_network" { name = "name" } import { - to = uxi_wired_network.my_network + to = hpeuxi_wired_network.my_network id = "network_id" } - resource "uxi_network_group_assignment" "my_network_group_assignment" { - network_id = uxi_wired_network.my_network.id - group_id = uxi_group.my_group.id + resource "hpeuxi_network_group_assignment" "my_network_group_assignment" { + network_id = hpeuxi_wired_network.my_network.id + group_id = hpeuxi_group.my_group.id }`, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr( - "uxi_network_group_assignment.my_network_group_assignment", + "hpeuxi_network_group_assignment.my_network_group_assignment", "network_id", "network_id", ), @@ -696,7 +696,7 @@ func TestNetworkGroupAssignmentResourceTooManyRequestsHandling(t *testing.T) { 1, ) }, - ResourceName: "uxi_network_group_assignment.my_network_group_assignment", + ResourceName: "hpeuxi_network_group_assignment.my_network_group_assignment", ImportState: true, ImportStateVerify: true, Check: resource.ComposeAggregateTestCheckFunc( @@ -738,7 +738,7 @@ func TestNetworkGroupAssignmentResourceTooManyRequestsHandling(t *testing.T) { }, Config: provider.ProviderConfig + ` removed { - from = uxi_wired_network.my_network + from = hpeuxi_wired_network.my_network lifecycle { destroy = false @@ -799,23 +799,23 @@ func TestNetworkGroupAssignmentResourceHttpErrorHandling(t *testing.T) { }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" } - resource "uxi_wired_network" "my_network" { + resource "hpeuxi_wired_network" "my_network" { name = "name" } import { - to = uxi_wired_network.my_network + to = hpeuxi_wired_network.my_network id = "network_id" } - resource "uxi_network_group_assignment" "my_network_group_assignment" { - network_id = uxi_wired_network.my_network.id - group_id = uxi_group.my_group.id + resource "hpeuxi_network_group_assignment" "my_network_group_assignment" { + network_id = hpeuxi_wired_network.my_network.id + group_id = hpeuxi_group.my_group.id }`, ExpectError: regexp.MustCompile( `(?s)Validation error - bad request\s*DebugID: 12312-123123-123123-1231212`, @@ -850,27 +850,27 @@ func TestNetworkGroupAssignmentResourceHttpErrorHandling(t *testing.T) { ) }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" } - resource "uxi_wired_network" "my_network" { + resource "hpeuxi_wired_network" "my_network" { name = "name" } import { - to = uxi_wired_network.my_network + to = hpeuxi_wired_network.my_network id = "network_id" } - resource "uxi_network_group_assignment" "my_network_group_assignment" { - network_id = uxi_wired_network.my_network.id - group_id = uxi_group.my_group.id + resource "hpeuxi_network_group_assignment" "my_network_group_assignment" { + network_id = hpeuxi_wired_network.my_network.id + group_id = hpeuxi_group.my_group.id } import { - to = uxi_network_group_assignment.my_network_group_assignment + to = hpeuxi_network_group_assignment.my_network_group_assignment id = "network_group_assignment_id" } `, @@ -909,27 +909,27 @@ func TestNetworkGroupAssignmentResourceHttpErrorHandling(t *testing.T) { }) }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" } - resource "uxi_wired_network" "my_network" { + resource "hpeuxi_wired_network" "my_network" { name = "name" } import { - to = uxi_wired_network.my_network + to = hpeuxi_wired_network.my_network id = "network_id" } - resource "uxi_network_group_assignment" "my_network_group_assignment" { - network_id = uxi_wired_network.my_network.id - group_id = uxi_group.my_group.id + resource "hpeuxi_network_group_assignment" "my_network_group_assignment" { + network_id = hpeuxi_wired_network.my_network.id + group_id = hpeuxi_group.my_group.id } import { - to = uxi_network_group_assignment.my_network_group_assignment + to = hpeuxi_network_group_assignment.my_network_group_assignment id = "network_group_assignment_id" } `, @@ -982,27 +982,27 @@ func TestNetworkGroupAssignmentResourceHttpErrorHandling(t *testing.T) { }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" } - resource "uxi_wired_network" "my_network" { + resource "hpeuxi_wired_network" "my_network" { name = "name" } import { - to = uxi_wired_network.my_network + to = hpeuxi_wired_network.my_network id = "network_id" } - resource "uxi_network_group_assignment" "my_network_group_assignment" { - network_id = uxi_wired_network.my_network.id - group_id = uxi_group.my_group.id + resource "hpeuxi_network_group_assignment" "my_network_group_assignment" { + network_id = hpeuxi_wired_network.my_network.id + group_id = hpeuxi_group.my_group.id }`, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr( - "uxi_network_group_assignment.my_network_group_assignment", + "hpeuxi_network_group_assignment.my_network_group_assignment", "network_id", "network_id", ), @@ -1043,7 +1043,7 @@ func TestNetworkGroupAssignmentResourceHttpErrorHandling(t *testing.T) { }, Config: provider.ProviderConfig + ` removed { - from = uxi_wired_network.my_network + from = hpeuxi_wired_network.my_network lifecycle { destroy = false @@ -1079,7 +1079,7 @@ func TestNetworkGroupAssignmentResourceHttpErrorHandling(t *testing.T) { }, Config: provider.ProviderConfig + ` removed { - from = uxi_wired_network.my_network + from = hpeuxi_wired_network.my_network lifecycle { destroy = false diff --git a/test/mocked/resources/sensor_group_assignment_test.go b/test/mocked/resources/sensor_group_assignment_test.go index f4553005..89343b97 100644 --- a/test/mocked/resources/sensor_group_assignment_test.go +++ b/test/mocked/resources/sensor_group_assignment_test.go @@ -67,12 +67,12 @@ func TestSensorGroupAssignmentResource(t *testing.T) { }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" } - resource "uxi_sensor" "my_sensor" { + resource "hpeuxi_sensor" "my_sensor" { name = "name" address_note = "address_note" notes = "notes" @@ -80,27 +80,27 @@ func TestSensorGroupAssignmentResource(t *testing.T) { } import { - to = uxi_sensor.my_sensor + to = hpeuxi_sensor.my_sensor id = "sensor_id" } - resource "uxi_sensor_group_assignment" "my_sensor_group_assignment" { - sensor_id = uxi_sensor.my_sensor.id - group_id = uxi_group.my_group.id + resource "hpeuxi_sensor_group_assignment" "my_sensor_group_assignment" { + sensor_id = hpeuxi_sensor.my_sensor.id + group_id = hpeuxi_group.my_group.id }`, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr( - "uxi_sensor_group_assignment.my_sensor_group_assignment", + "hpeuxi_sensor_group_assignment.my_sensor_group_assignment", "sensor_id", "sensor_id", ), resource.TestCheckResourceAttr( - "uxi_sensor_group_assignment.my_sensor_group_assignment", + "hpeuxi_sensor_group_assignment.my_sensor_group_assignment", "group_id", "group_id", ), resource.TestCheckResourceAttr( - "uxi_sensor_group_assignment.my_sensor_group_assignment", + "hpeuxi_sensor_group_assignment.my_sensor_group_assignment", "id", "sensor_group_assignment_id", ), @@ -118,7 +118,7 @@ func TestSensorGroupAssignmentResource(t *testing.T) { 1, ) }, - ResourceName: "uxi_sensor_group_assignment.my_sensor_group_assignment", + ResourceName: "hpeuxi_sensor_group_assignment.my_sensor_group_assignment", ImportState: true, ImportStateVerify: true, }, @@ -183,12 +183,12 @@ func TestSensorGroupAssignmentResource(t *testing.T) { }, Config: provider.ProviderConfig + ` // the original resources - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" } - resource "uxi_sensor" "my_sensor" { + resource "hpeuxi_sensor" "my_sensor" { name = "name" address_note = "address_note" notes = "notes" @@ -196,17 +196,17 @@ func TestSensorGroupAssignmentResource(t *testing.T) { } import { - to = uxi_sensor.my_sensor + to = hpeuxi_sensor.my_sensor id = "sensor_id" } // the new resources we wanna update the assignment to - resource "uxi_group" "my_group_2" { + resource "hpeuxi_group" "my_group_2" { name = "name_2" parent_group_id = "parent_id_2" } - resource "uxi_sensor" "my_sensor_2" { + resource "hpeuxi_sensor" "my_sensor_2" { name = "name_2" address_note = "address_note_2" notes = "notes_2" @@ -214,28 +214,28 @@ func TestSensorGroupAssignmentResource(t *testing.T) { } import { - to = uxi_sensor.my_sensor_2 + to = hpeuxi_sensor.my_sensor_2 id = "sensor_id_2" } // the assignment update, updated from sensor/group to sensor_2/group_2 - resource "uxi_sensor_group_assignment" "my_sensor_group_assignment" { - sensor_id = uxi_sensor.my_sensor_2.id - group_id = uxi_group.my_group_2.id + resource "hpeuxi_sensor_group_assignment" "my_sensor_group_assignment" { + sensor_id = hpeuxi_sensor.my_sensor_2.id + group_id = hpeuxi_group.my_group_2.id }`, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr( - "uxi_sensor_group_assignment.my_sensor_group_assignment", + "hpeuxi_sensor_group_assignment.my_sensor_group_assignment", "sensor_id", "sensor_id_2", ), resource.TestCheckResourceAttr( - "uxi_sensor_group_assignment.my_sensor_group_assignment", + "hpeuxi_sensor_group_assignment.my_sensor_group_assignment", "group_id", "group_id_2", ), resource.TestCheckResourceAttr( - "uxi_sensor_group_assignment.my_sensor_group_assignment", + "hpeuxi_sensor_group_assignment.my_sensor_group_assignment", "id", "sensor_group_assignment_id_2", ), @@ -269,7 +269,7 @@ func TestSensorGroupAssignmentResource(t *testing.T) { }, Config: provider.ProviderConfig + ` removed { - from = uxi_sensor.my_sensor + from = hpeuxi_sensor.my_sensor lifecycle { destroy = false @@ -277,7 +277,7 @@ func TestSensorGroupAssignmentResource(t *testing.T) { } removed { - from = uxi_sensor.my_sensor_2 + from = hpeuxi_sensor.my_sensor_2 lifecycle { destroy = false @@ -343,12 +343,12 @@ func TestSensorGroupAssignmentResourceTooManyRequestsHandling(t *testing.T) { }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" } - resource "uxi_sensor" "my_sensor" { + resource "hpeuxi_sensor" "my_sensor" { name = "name" address_note = "address_note" notes = "notes" @@ -356,17 +356,17 @@ func TestSensorGroupAssignmentResourceTooManyRequestsHandling(t *testing.T) { } import { - to = uxi_sensor.my_sensor + to = hpeuxi_sensor.my_sensor id = "sensor_id" } - resource "uxi_sensor_group_assignment" "my_sensor_group_assignment" { - sensor_id = uxi_sensor.my_sensor.id - group_id = uxi_group.my_group.id + resource "hpeuxi_sensor_group_assignment" "my_sensor_group_assignment" { + sensor_id = hpeuxi_sensor.my_sensor.id + group_id = hpeuxi_group.my_group.id }`, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr( - "uxi_sensor_group_assignment.my_sensor_group_assignment", + "hpeuxi_sensor_group_assignment.my_sensor_group_assignment", "id", "sensor_group_assignment_id", ), @@ -393,7 +393,7 @@ func TestSensorGroupAssignmentResourceTooManyRequestsHandling(t *testing.T) { 1, ) }, - ResourceName: "uxi_sensor_group_assignment.my_sensor_group_assignment", + ResourceName: "hpeuxi_sensor_group_assignment.my_sensor_group_assignment", ImportState: true, ImportStateVerify: true, Check: resource.ComposeAggregateTestCheckFunc( @@ -430,7 +430,7 @@ func TestSensorGroupAssignmentResourceTooManyRequestsHandling(t *testing.T) { }, Config: provider.ProviderConfig + ` removed { - from = uxi_sensor.my_sensor + from = hpeuxi_sensor.my_sensor lifecycle { destroy = false @@ -438,7 +438,7 @@ func TestSensorGroupAssignmentResourceTooManyRequestsHandling(t *testing.T) { } removed { - from = uxi_sensor.my_sensor_2 + from = hpeuxi_sensor.my_sensor_2 lifecycle { destroy = false @@ -496,12 +496,12 @@ func TestSensorGroupAssignmentResourceHttpErrorHandling(t *testing.T) { }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" } - resource "uxi_sensor" "my_sensor" { + resource "hpeuxi_sensor" "my_sensor" { name = "name" address_note = "address_note" notes = "notes" @@ -509,13 +509,13 @@ func TestSensorGroupAssignmentResourceHttpErrorHandling(t *testing.T) { } import { - to = uxi_sensor.my_sensor + to = hpeuxi_sensor.my_sensor id = "sensor_id" } - resource "uxi_sensor_group_assignment" "my_sensor_group_assignment" { - sensor_id = uxi_sensor.my_sensor.id - group_id = uxi_group.my_group.id + resource "hpeuxi_sensor_group_assignment" "my_sensor_group_assignment" { + sensor_id = hpeuxi_sensor.my_sensor.id + group_id = hpeuxi_group.my_group.id }`, ExpectError: regexp.MustCompile( `(?s)Validation error - bad request\s*DebugID: 12312-123123-123123-1231212`, @@ -541,12 +541,12 @@ func TestSensorGroupAssignmentResourceHttpErrorHandling(t *testing.T) { ) }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" } - resource "uxi_sensor" "my_sensor" { + resource "hpeuxi_sensor" "my_sensor" { name = "name" address_note = "address_note" notes = "notes" @@ -554,17 +554,17 @@ func TestSensorGroupAssignmentResourceHttpErrorHandling(t *testing.T) { } import { - to = uxi_sensor.my_sensor + to = hpeuxi_sensor.my_sensor id = "sensor_id" } - resource "uxi_sensor_group_assignment" "my_sensor_group_assignment" { - sensor_id = uxi_sensor.my_sensor.id - group_id = uxi_group.my_group.id + resource "hpeuxi_sensor_group_assignment" "my_sensor_group_assignment" { + sensor_id = hpeuxi_sensor.my_sensor.id + group_id = hpeuxi_group.my_group.id } import { - to = uxi_sensor_group_assignment.my_sensor_group_assignment + to = hpeuxi_sensor_group_assignment.my_sensor_group_assignment id = "sensor_group_assignment_id" } `, @@ -600,12 +600,12 @@ func TestSensorGroupAssignmentResourceHttpErrorHandling(t *testing.T) { }) }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" } - resource "uxi_sensor" "my_sensor" { + resource "hpeuxi_sensor" "my_sensor" { name = "name" address_note = "address_note" notes = "notes" @@ -613,17 +613,17 @@ func TestSensorGroupAssignmentResourceHttpErrorHandling(t *testing.T) { } import { - to = uxi_sensor.my_sensor + to = hpeuxi_sensor.my_sensor id = "sensor_id" } - resource "uxi_sensor_group_assignment" "my_sensor_group_assignment" { - sensor_id = uxi_sensor.my_sensor.id - group_id = uxi_group.my_group.id + resource "hpeuxi_sensor_group_assignment" "my_sensor_group_assignment" { + sensor_id = hpeuxi_sensor.my_sensor.id + group_id = hpeuxi_group.my_group.id } import { - to = uxi_sensor_group_assignment.my_sensor_group_assignment + to = hpeuxi_sensor_group_assignment.my_sensor_group_assignment id = "sensor_group_assignment_id" } `, @@ -673,12 +673,12 @@ func TestSensorGroupAssignmentResourceHttpErrorHandling(t *testing.T) { }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" } - resource "uxi_sensor" "my_sensor" { + resource "hpeuxi_sensor" "my_sensor" { name = "name" address_note = "address_note" notes = "notes" @@ -686,17 +686,17 @@ func TestSensorGroupAssignmentResourceHttpErrorHandling(t *testing.T) { } import { - to = uxi_sensor.my_sensor + to = hpeuxi_sensor.my_sensor id = "sensor_id" } - resource "uxi_sensor_group_assignment" "my_sensor_group_assignment" { - sensor_id = uxi_sensor.my_sensor.id - group_id = uxi_group.my_group.id + resource "hpeuxi_sensor_group_assignment" "my_sensor_group_assignment" { + sensor_id = hpeuxi_sensor.my_sensor.id + group_id = hpeuxi_group.my_group.id }`, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr( - "uxi_sensor_group_assignment.my_sensor_group_assignment", + "hpeuxi_sensor_group_assignment.my_sensor_group_assignment", "id", "sensor_group_assignment_id", ), @@ -731,7 +731,7 @@ func TestSensorGroupAssignmentResourceHttpErrorHandling(t *testing.T) { }, Config: provider.ProviderConfig + ` removed { - from = uxi_sensor.my_sensor + from = hpeuxi_sensor.my_sensor lifecycle { destroy = false @@ -762,7 +762,7 @@ func TestSensorGroupAssignmentResourceHttpErrorHandling(t *testing.T) { }, Config: provider.ProviderConfig + ` removed { - from = uxi_sensor.my_sensor + from = hpeuxi_sensor.my_sensor lifecycle { destroy = false diff --git a/test/mocked/resources/sensor_test.go b/test/mocked/resources/sensor_test.go index a50807b2..85b80bd9 100644 --- a/test/mocked/resources/sensor_test.go +++ b/test/mocked/resources/sensor_test.go @@ -36,7 +36,7 @@ func TestSensorResource(t *testing.T) { // Creating a sensor is not allowed { Config: provider.ProviderConfig + ` - resource "uxi_sensor" "my_sensor" { + resource "hpeuxi_sensor" "my_sensor" { name = "name" address_note = "address_note" notes = "note" @@ -53,7 +53,7 @@ func TestSensorResource(t *testing.T) { util.MockGetSensor("id", util.GenerateSensorResponse("id", ""), 2) }, Config: provider.ProviderConfig + ` - resource "uxi_sensor" "my_sensor" { + resource "hpeuxi_sensor" "my_sensor" { name = "name" address_note = "address_note" notes = "notes" @@ -61,18 +61,18 @@ func TestSensorResource(t *testing.T) { } import { - to = uxi_sensor.my_sensor + to = hpeuxi_sensor.my_sensor id = "id" }`, - Check: shared.CheckStateAgainstSensor(t, "uxi_sensor.my_sensor", sensor), + Check: shared.CheckStateAgainstSensor(t, "hpeuxi_sensor.my_sensor", sensor), }, // ImportState testing { PreConfig: func() { util.MockGetSensor("id", util.GenerateSensorResponse("id", ""), 1) }, - ResourceName: "uxi_sensor.my_sensor", + ResourceName: "hpeuxi_sensor.my_sensor", ImportState: true, ImportStateVerify: true, }, @@ -91,13 +91,13 @@ func TestSensorResource(t *testing.T) { util.MockGetSensor("id", util.GenerateSensorResponse("id", "_2"), 1) }, Config: provider.ProviderConfig + ` - resource "uxi_sensor" "my_sensor" { + resource "hpeuxi_sensor" "my_sensor" { name = "name_2" address_note = "address_note_2" notes = "notes_2" pcap_mode = "light" }`, - Check: shared.CheckStateAgainstSensor(t, "uxi_sensor.my_sensor", updatedSensor), + Check: shared.CheckStateAgainstSensor(t, "hpeuxi_sensor.my_sensor", updatedSensor), }, // Deleting a sensor is not allowed { @@ -113,7 +113,7 @@ func TestSensorResource(t *testing.T) { { Config: provider.ProviderConfig + ` removed { - from = uxi_sensor.my_sensor + from = hpeuxi_sensor.my_sensor lifecycle { destroy = false @@ -150,7 +150,7 @@ func TestSensorResourceTooManyRequestsHandling(t *testing.T) { util.MockGetSensor("id", util.GenerateSensorResponse("id", ""), 2) }, Config: provider.ProviderConfig + ` - resource "uxi_sensor" "my_sensor" { + resource "hpeuxi_sensor" "my_sensor" { name = "name" address_note = "address_note" notes = "notes" @@ -158,12 +158,12 @@ func TestSensorResourceTooManyRequestsHandling(t *testing.T) { } import { - to = uxi_sensor.my_sensor + to = hpeuxi_sensor.my_sensor id = "id" }`, Check: resource.ComposeAggregateTestCheckFunc( - shared.CheckStateAgainstSensor(t, "uxi_sensor.my_sensor", sensor), + shared.CheckStateAgainstSensor(t, "hpeuxi_sensor.my_sensor", sensor), func(s *terraform.State) error { assert.Equal(t, mockTooManyRequests.Mock.Request().Counter, 0) @@ -190,14 +190,14 @@ func TestSensorResourceTooManyRequestsHandling(t *testing.T) { util.MockGetSensor("id", util.GenerateSensorResponse("id", "_2"), 1) }, Config: provider.ProviderConfig + ` - resource "uxi_sensor" "my_sensor" { + resource "hpeuxi_sensor" "my_sensor" { name = "name_2" address_note = "address_note_2" notes = "notes_2" pcap_mode = "light" }`, Check: resource.ComposeAggregateTestCheckFunc( - shared.CheckStateAgainstSensor(t, "uxi_sensor.my_sensor", updatedSensor), + shared.CheckStateAgainstSensor(t, "hpeuxi_sensor.my_sensor", updatedSensor), func(s *terraform.State) error { assert.Equal(t, mockTooManyRequests.Mock.Request().Counter, 0) @@ -209,7 +209,7 @@ func TestSensorResourceTooManyRequestsHandling(t *testing.T) { { Config: provider.ProviderConfig + ` removed { - from = uxi_sensor.my_sensor + from = hpeuxi_sensor.my_sensor lifecycle { destroy = false @@ -248,7 +248,7 @@ func TestSensorResourceHttpErrorHandling(t *testing.T) { }) }, Config: provider.ProviderConfig + ` - resource "uxi_sensor" "my_sensor" { + resource "hpeuxi_sensor" "my_sensor" { name = "name" address_note = "address_note" notes = "notes" @@ -256,7 +256,7 @@ func TestSensorResourceHttpErrorHandling(t *testing.T) { } import { - to = uxi_sensor.my_sensor + to = hpeuxi_sensor.my_sensor id = "id" }`, @@ -270,7 +270,7 @@ func TestSensorResourceHttpErrorHandling(t *testing.T) { util.MockGetSensor("id", util.EmptyGetListResponse, 1) }, Config: provider.ProviderConfig + ` - resource "uxi_sensor" "my_sensor" { + resource "hpeuxi_sensor" "my_sensor" { name = "name" address_note = "address_note" notes = "notes" @@ -278,7 +278,7 @@ func TestSensorResourceHttpErrorHandling(t *testing.T) { } import { - to = uxi_sensor.my_sensor + to = hpeuxi_sensor.my_sensor id = "id" }`, @@ -290,7 +290,7 @@ func TestSensorResourceHttpErrorHandling(t *testing.T) { util.MockGetSensor("id", util.GenerateSensorResponse("id", ""), 2) }, Config: provider.ProviderConfig + ` - resource "uxi_sensor" "my_sensor" { + resource "hpeuxi_sensor" "my_sensor" { name = "name" address_note = "address_note" notes = "notes" @@ -298,11 +298,11 @@ func TestSensorResourceHttpErrorHandling(t *testing.T) { } import { - to = uxi_sensor.my_sensor + to = hpeuxi_sensor.my_sensor id = "id" }`, - Check: shared.CheckStateAgainstSensor(t, "uxi_sensor.my_sensor", sensor), + Check: shared.CheckStateAgainstSensor(t, "hpeuxi_sensor.my_sensor", sensor), }, // Update HTTP error { @@ -322,7 +322,7 @@ func TestSensorResourceHttpErrorHandling(t *testing.T) { }) }, Config: provider.ProviderConfig + ` - resource "uxi_sensor" "my_sensor" { + resource "hpeuxi_sensor" "my_sensor" { name = "name_2" address_note = "address_note_2" notes = "notes_2" @@ -336,7 +336,7 @@ func TestSensorResourceHttpErrorHandling(t *testing.T) { { Config: provider.ProviderConfig + ` removed { - from = uxi_sensor.my_sensor + from = hpeuxi_sensor.my_sensor lifecycle { destroy = false diff --git a/test/mocked/resources/service_test.go b/test/mocked/resources/service_test.go index 82111dea..ccb9f1f2 100644 --- a/test/mocked/resources/service_test.go +++ b/test/mocked/resources/service_test.go @@ -35,7 +35,7 @@ func TestServiceTestResource(t *testing.T) { // Creating a service_test is not allowed { Config: provider.ProviderConfig + ` - resource "uxi_service_test" "my_service_test" { + resource "hpeuxi_service_test" "my_service_test" { name = "name" }`, @@ -49,18 +49,18 @@ func TestServiceTestResource(t *testing.T) { util.MockGetServiceTest("id", util.GenerateServiceTestResponse("id", ""), 2) }, Config: provider.ProviderConfig + ` - resource "uxi_service_test" "my_service_test" { + resource "hpeuxi_service_test" "my_service_test" { name = "name" } import { - to = uxi_service_test.my_service_test + to = hpeuxi_service_test.my_service_test id = "id" }`, Check: shared.CheckStateAgainstServiceTest( t, - "uxi_service_test.my_service_test", + "hpeuxi_service_test.my_service_test", serviceTest, ), }, @@ -69,7 +69,7 @@ func TestServiceTestResource(t *testing.T) { PreConfig: func() { util.MockGetServiceTest("id", util.GenerateServiceTestResponse("id", ""), 1) }, - ResourceName: "uxi_service_test.my_service_test", + ResourceName: "hpeuxi_service_test.my_service_test", ImportState: true, ImportStateVerify: true, }, @@ -79,7 +79,7 @@ func TestServiceTestResource(t *testing.T) { util.MockGetServiceTest("id", util.GenerateServiceTestResponse("id", ""), 1) }, Config: provider.ProviderConfig + ` - resource "uxi_service_test" "my_service_test" { + resource "hpeuxi_service_test" "my_service_test" { name = "updated_name" }`, ExpectError: regexp.MustCompile( @@ -100,7 +100,7 @@ func TestServiceTestResource(t *testing.T) { { Config: provider.ProviderConfig + ` removed { - from = uxi_service_test.my_service_test + from = hpeuxi_service_test.my_service_test lifecycle { destroy = false @@ -136,19 +136,19 @@ func TestServiceTestResourceTooManyRequestsHandling(t *testing.T) { util.MockGetServiceTest("id", util.GenerateServiceTestResponse("id", ""), 2) }, Config: provider.ProviderConfig + ` - resource "uxi_service_test" "my_service_test" { + resource "hpeuxi_service_test" "my_service_test" { name = "name" } import { - to = uxi_service_test.my_service_test + to = hpeuxi_service_test.my_service_test id = "id" }`, Check: resource.ComposeAggregateTestCheckFunc( shared.CheckStateAgainstServiceTest( t, - "uxi_service_test.my_service_test", + "hpeuxi_service_test.my_service_test", serviceTest, ), func(s *terraform.State) error { @@ -162,7 +162,7 @@ func TestServiceTestResourceTooManyRequestsHandling(t *testing.T) { { Config: provider.ProviderConfig + ` removed { - from = uxi_service_test.my_service_test + from = hpeuxi_service_test.my_service_test lifecycle { destroy = false @@ -192,12 +192,12 @@ func TestServiceTestResourceHttpErrorHandling(t *testing.T) { util.MockGetServiceTest("id", util.EmptyGetListResponse, 1) }, Config: provider.ProviderConfig + ` - resource "uxi_service_test" "my_service_test" { + resource "hpeuxi_service_test" "my_service_test" { name = "name" } import { - to = uxi_service_test.my_service_test + to = hpeuxi_service_test.my_service_test id = "id" }`, ExpectError: regexp.MustCompile(`Error: Cannot import non-existent remote object`), @@ -216,12 +216,12 @@ func TestServiceTestResourceHttpErrorHandling(t *testing.T) { }) }, Config: provider.ProviderConfig + ` - resource "uxi_service_test" "my_service_test" { + resource "hpeuxi_service_test" "my_service_test" { name = "name" } import { - to = uxi_service_test.my_service_test + to = hpeuxi_service_test.my_service_test id = "id" }`, ExpectError: regexp.MustCompile( diff --git a/test/mocked/resources/service_test_group_assignment_test.go b/test/mocked/resources/service_test_group_assignment_test.go index 8585da73..f1bf3a9f 100644 --- a/test/mocked/resources/service_test_group_assignment_test.go +++ b/test/mocked/resources/service_test_group_assignment_test.go @@ -68,37 +68,37 @@ func TestServiceTestGroupAssignmentResource(t *testing.T) { }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" } - resource "uxi_service_test" "my_service_test" { + resource "hpeuxi_service_test" "my_service_test" { name = "name" } import { - to = uxi_service_test.my_service_test + to = hpeuxi_service_test.my_service_test id = "service_test_id" } - resource "uxi_service_test_group_assignment" "my_service_test_group_assignment" { - service_test_id = uxi_service_test.my_service_test.id - group_id = uxi_group.my_group.id + resource "hpeuxi_service_test_group_assignment" "my_service_test_group_assignment" { + service_test_id = hpeuxi_service_test.my_service_test.id + group_id = hpeuxi_group.my_group.id }`, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr( - "uxi_service_test_group_assignment.my_service_test_group_assignment", + "hpeuxi_service_test_group_assignment.my_service_test_group_assignment", "service_test_id", "service_test_id", ), resource.TestCheckResourceAttr( - "uxi_service_test_group_assignment.my_service_test_group_assignment", + "hpeuxi_service_test_group_assignment.my_service_test_group_assignment", "group_id", "group_id", ), resource.TestCheckResourceAttr( - "uxi_service_test_group_assignment.my_service_test_group_assignment", + "hpeuxi_service_test_group_assignment.my_service_test_group_assignment", "id", "service_test_group_assignment_id", ), @@ -115,7 +115,7 @@ func TestServiceTestGroupAssignmentResource(t *testing.T) { 1, ) }, - ResourceName: "uxi_service_test_group_assignment.my_service_test_group_assignment", + ResourceName: "hpeuxi_service_test_group_assignment.my_service_test_group_assignment", ImportState: true, ImportStateVerify: true, }, @@ -182,53 +182,53 @@ func TestServiceTestGroupAssignmentResource(t *testing.T) { }, Config: provider.ProviderConfig + ` // the original resources - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" } - resource "uxi_service_test" "my_service_test" { + resource "hpeuxi_service_test" "my_service_test" { name = "name" } import { - to = uxi_service_test.my_service_test + to = hpeuxi_service_test.my_service_test id = "service_test_id" } // the new resources we wanna update the assignment to - resource "uxi_group" "my_group_2" { + resource "hpeuxi_group" "my_group_2" { name = "name_2" parent_group_id = "parent_id_2" } - resource "uxi_service_test" "my_service_test_2" { + resource "hpeuxi_service_test" "my_service_test_2" { name = "name_2" } import { - to = uxi_service_test.my_service_test_2 + to = hpeuxi_service_test.my_service_test_2 id = "service_test_id_2" } // the assignment update, updated from service_test/group to service_test_2/group_2 - resource "uxi_service_test_group_assignment" "my_service_test_group_assignment" { - service_test_id = uxi_service_test.my_service_test_2.id - group_id = uxi_group.my_group_2.id + resource "hpeuxi_service_test_group_assignment" "my_service_test_group_assignment" { + service_test_id = hpeuxi_service_test.my_service_test_2.id + group_id = hpeuxi_group.my_group_2.id }`, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr( - "uxi_service_test_group_assignment.my_service_test_group_assignment", + "hpeuxi_service_test_group_assignment.my_service_test_group_assignment", "service_test_id", "service_test_id_2", ), resource.TestCheckResourceAttr( - "uxi_service_test_group_assignment.my_service_test_group_assignment", + "hpeuxi_service_test_group_assignment.my_service_test_group_assignment", "group_id", "group_id_2", ), resource.TestCheckResourceAttr( - "uxi_service_test_group_assignment.my_service_test_group_assignment", + "hpeuxi_service_test_group_assignment.my_service_test_group_assignment", "id", "service_test_group_assignment_id_2", ), @@ -257,7 +257,7 @@ func TestServiceTestGroupAssignmentResource(t *testing.T) { }, Config: provider.ProviderConfig + ` removed { - from = uxi_service_test.my_service_test + from = hpeuxi_service_test.my_service_test lifecycle { destroy = false @@ -265,7 +265,7 @@ func TestServiceTestGroupAssignmentResource(t *testing.T) { } removed { - from = uxi_service_test.my_service_test_2 + from = hpeuxi_service_test.my_service_test_2 lifecycle { destroy = false @@ -334,27 +334,27 @@ func TestServiceTestGroupAssignmentResourceTooManyRequestsHandling(t *testing.T) }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" } - resource "uxi_service_test" "my_service_test" { + resource "hpeuxi_service_test" "my_service_test" { name = "name" } import { - to = uxi_service_test.my_service_test + to = hpeuxi_service_test.my_service_test id = "service_test_id" } - resource "uxi_service_test_group_assignment" "my_service_test_group_assignment" { - service_test_id = uxi_service_test.my_service_test.id - group_id = uxi_group.my_group.id + resource "hpeuxi_service_test_group_assignment" "my_service_test_group_assignment" { + service_test_id = hpeuxi_service_test.my_service_test.id + group_id = hpeuxi_group.my_group.id }`, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr( - "uxi_service_test_group_assignment.my_service_test_group_assignment", + "hpeuxi_service_test_group_assignment.my_service_test_group_assignment", "id", "service_test_group_assignment_id", ), @@ -380,7 +380,7 @@ func TestServiceTestGroupAssignmentResourceTooManyRequestsHandling(t *testing.T) 1, ) }, - ResourceName: "uxi_service_test_group_assignment.my_service_test_group_assignment", + ResourceName: "hpeuxi_service_test_group_assignment.my_service_test_group_assignment", ImportState: true, ImportStateVerify: true, Check: resource.ComposeAggregateTestCheckFunc( @@ -415,7 +415,7 @@ func TestServiceTestGroupAssignmentResourceTooManyRequestsHandling(t *testing.T) }, Config: provider.ProviderConfig + ` removed { - from = uxi_service_test.my_service_test + from = hpeuxi_service_test.my_service_test lifecycle { destroy = false @@ -470,23 +470,23 @@ func TestServiceTestGroupAssignmentResourceHttpErrorHandling(t *testing.T) { }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" } - resource "uxi_service_test" "my_service_test" { + resource "hpeuxi_service_test" "my_service_test" { name = "name" } import { - to = uxi_service_test.my_service_test + to = hpeuxi_service_test.my_service_test id = "service_test_id" } - resource "uxi_service_test_group_assignment" "my_service_test_group_assignment" { - service_test_id = uxi_service_test.my_service_test.id - group_id = uxi_group.my_group.id + resource "hpeuxi_service_test_group_assignment" "my_service_test_group_assignment" { + service_test_id = hpeuxi_service_test.my_service_test.id + group_id = hpeuxi_group.my_group.id }`, ExpectError: regexp.MustCompile( `(?s)Validation error - bad request\s*DebugID: 12312-123123-123123-1231212`, @@ -513,22 +513,22 @@ func TestServiceTestGroupAssignmentResourceHttpErrorHandling(t *testing.T) { ) }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" } - resource "uxi_service_test" "my_service_test" { + resource "hpeuxi_service_test" "my_service_test" { name = "name" } - resource "uxi_service_test_group_assignment" "my_service_test_group_assignment" { - service_test_id = uxi_service_test.my_service_test.id - group_id = uxi_group.my_group.id + resource "hpeuxi_service_test_group_assignment" "my_service_test_group_assignment" { + service_test_id = hpeuxi_service_test.my_service_test.id + group_id = hpeuxi_group.my_group.id } import { - to = uxi_service_test_group_assignment.my_service_test_group_assignment + to = hpeuxi_service_test_group_assignment.my_service_test_group_assignment id = "service_test_group_assignment_id" }`, ExpectError: regexp.MustCompile(`Error: Cannot import non-existent remote object`), @@ -575,37 +575,37 @@ func TestServiceTestGroupAssignmentResourceHttpErrorHandling(t *testing.T) { }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" } - resource "uxi_service_test" "my_service_test" { + resource "hpeuxi_service_test" "my_service_test" { name = "name" } import { - to = uxi_service_test.my_service_test + to = hpeuxi_service_test.my_service_test id = "service_test_id" } - resource "uxi_service_test_group_assignment" "my_service_test_group_assignment" { - service_test_id = uxi_service_test.my_service_test.id - group_id = uxi_group.my_group.id + resource "hpeuxi_service_test_group_assignment" "my_service_test_group_assignment" { + service_test_id = hpeuxi_service_test.my_service_test.id + group_id = hpeuxi_group.my_group.id }`, Check: resource.ComposeAggregateTestCheckFunc( resource.TestCheckResourceAttr( - "uxi_service_test_group_assignment.my_service_test_group_assignment", + "hpeuxi_service_test_group_assignment.my_service_test_group_assignment", "service_test_id", "service_test_id", ), resource.TestCheckResourceAttr( - "uxi_service_test_group_assignment.my_service_test_group_assignment", + "hpeuxi_service_test_group_assignment.my_service_test_group_assignment", "group_id", "group_id", ), resource.TestCheckResourceAttr( - "uxi_service_test_group_assignment.my_service_test_group_assignment", + "hpeuxi_service_test_group_assignment.my_service_test_group_assignment", "id", "service_test_group_assignment_id", ), @@ -645,22 +645,22 @@ func TestServiceTestGroupAssignmentResourceHttpErrorHandling(t *testing.T) { }) }, Config: provider.ProviderConfig + ` - resource "uxi_group" "my_group" { + resource "hpeuxi_group" "my_group" { name = "name" parent_group_id = "parent_id" } - resource "uxi_service_test" "my_service_test" { + resource "hpeuxi_service_test" "my_service_test" { name = "name" } - resource "uxi_service_test_group_assignment" "my_service_test_group_assignment" { - service_test_id = uxi_service_test.my_service_test.id - group_id = uxi_group.my_group.id + resource "hpeuxi_service_test_group_assignment" "my_service_test_group_assignment" { + service_test_id = hpeuxi_service_test.my_service_test.id + group_id = hpeuxi_group.my_group.id } import { - to = uxi_service_test_group_assignment.my_service_test_group_assignment + to = hpeuxi_service_test_group_assignment.my_service_test_group_assignment id = "service_test_group_assignment_id" }`, @@ -696,7 +696,7 @@ func TestServiceTestGroupAssignmentResourceHttpErrorHandling(t *testing.T) { }, Config: provider.ProviderConfig + ` removed { - from = uxi_service_test.my_service_test + from = hpeuxi_service_test.my_service_test lifecycle { destroy = false @@ -731,7 +731,7 @@ func TestServiceTestGroupAssignmentResourceHttpErrorHandling(t *testing.T) { }, Config: provider.ProviderConfig + ` removed { - from = uxi_service_test.my_service_test + from = hpeuxi_service_test.my_service_test lifecycle { destroy = false diff --git a/test/mocked/resources/wired_network_test.go b/test/mocked/resources/wired_network_test.go index 63879ec7..2d793c59 100644 --- a/test/mocked/resources/wired_network_test.go +++ b/test/mocked/resources/wired_network_test.go @@ -35,7 +35,7 @@ func TestWiredNetworkResource(t *testing.T) { // Creating a wired_network is not allowed { Config: provider.ProviderConfig + ` - resource "uxi_wired_network" "my_wired_network" { + resource "hpeuxi_wired_network" "my_wired_network" { name = "name" }`, @@ -49,18 +49,18 @@ func TestWiredNetworkResource(t *testing.T) { util.MockGetWiredNetwork("id", util.GenerateWiredNetworkResponse("id", ""), 2) }, Config: provider.ProviderConfig + ` - resource "uxi_wired_network" "my_wired_network" { + resource "hpeuxi_wired_network" "my_wired_network" { name = "name" } import { - to = uxi_wired_network.my_wired_network + to = hpeuxi_wired_network.my_wired_network id = "id" }`, Check: shared.CheckStateAgainstWiredNetwork( t, - "uxi_wired_network.my_wired_network", + "hpeuxi_wired_network.my_wired_network", wiredNetwork, ), }, @@ -69,7 +69,7 @@ func TestWiredNetworkResource(t *testing.T) { PreConfig: func() { util.MockGetWiredNetwork("id", util.GenerateWiredNetworkResponse("id", ""), 1) }, - ResourceName: "uxi_wired_network.my_wired_network", + ResourceName: "hpeuxi_wired_network.my_wired_network", ImportState: true, ImportStateVerify: true, }, @@ -79,7 +79,7 @@ func TestWiredNetworkResource(t *testing.T) { util.MockGetWiredNetwork("id", util.GenerateWiredNetworkResponse("id", ""), 1) }, Config: provider.ProviderConfig + ` - resource "uxi_wired_network" "my_wired_network" { + resource "hpeuxi_wired_network" "my_wired_network" { name = "updated_name" }`, ExpectError: regexp.MustCompile( @@ -100,7 +100,7 @@ func TestWiredNetworkResource(t *testing.T) { { Config: provider.ProviderConfig + ` removed { - from = uxi_wired_network.my_wired_network + from = hpeuxi_wired_network.my_wired_network lifecycle { destroy = false @@ -136,19 +136,19 @@ func TestWiredNetworkResourceTooManyRequestsHandling(t *testing.T) { util.MockGetWiredNetwork("id", util.GenerateWiredNetworkResponse("id", ""), 2) }, Config: provider.ProviderConfig + ` - resource "uxi_wired_network" "my_wired_network" { + resource "hpeuxi_wired_network" "my_wired_network" { name = "name" } import { - to = uxi_wired_network.my_wired_network + to = hpeuxi_wired_network.my_wired_network id = "id" }`, Check: resource.ComposeAggregateTestCheckFunc( shared.CheckStateAgainstWiredNetwork( t, - "uxi_wired_network.my_wired_network", + "hpeuxi_wired_network.my_wired_network", wiredNetwork, ), func(s *terraform.State) error { @@ -162,7 +162,7 @@ func TestWiredNetworkResourceTooManyRequestsHandling(t *testing.T) { { Config: provider.ProviderConfig + ` removed { - from = uxi_wired_network.my_wired_network + from = hpeuxi_wired_network.my_wired_network lifecycle { destroy = false @@ -191,12 +191,12 @@ func TestWiredNetworkResourceHttpErrorHandling(t *testing.T) { util.MockGetWiredNetwork("id", util.EmptyGetListResponse, 1) }, Config: provider.ProviderConfig + ` - resource "uxi_wired_network" "my_wired_network" { + resource "hpeuxi_wired_network" "my_wired_network" { name = "name" } import { - to = uxi_wired_network.my_wired_network + to = hpeuxi_wired_network.my_wired_network id = "id" }`, ExpectError: regexp.MustCompile(`Error: Cannot import non-existent remote object`), @@ -214,12 +214,12 @@ func TestWiredNetworkResourceHttpErrorHandling(t *testing.T) { }) }, Config: provider.ProviderConfig + ` - resource "uxi_wired_network" "my_wired_network" { + resource "hpeuxi_wired_network" "my_wired_network" { name = "name" } import { - to = uxi_wired_network.my_wired_network + to = hpeuxi_wired_network.my_wired_network id = "id" }`, ExpectError: regexp.MustCompile( diff --git a/test/mocked/resources/wireless_network_test.go b/test/mocked/resources/wireless_network_test.go index 13850d47..7718ab97 100644 --- a/test/mocked/resources/wireless_network_test.go +++ b/test/mocked/resources/wireless_network_test.go @@ -35,7 +35,7 @@ func TestWirelessNetworkResource(t *testing.T) { // Creating a wireless_network is not allowed { Config: provider.ProviderConfig + ` - resource "uxi_wireless_network" "my_wireless_network" { + resource "hpeuxi_wireless_network" "my_wireless_network" { name = "name" }`, @@ -53,18 +53,18 @@ func TestWirelessNetworkResource(t *testing.T) { ) }, Config: provider.ProviderConfig + ` - resource "uxi_wireless_network" "my_wireless_network" { + resource "hpeuxi_wireless_network" "my_wireless_network" { name = "name" } import { - to = uxi_wireless_network.my_wireless_network + to = hpeuxi_wireless_network.my_wireless_network id = "id" }`, Check: shared.CheckStateAgainstWirelessNetwork( t, - "uxi_wireless_network.my_wireless_network", + "hpeuxi_wireless_network.my_wireless_network", wirelessNetwork, ), }, @@ -77,7 +77,7 @@ func TestWirelessNetworkResource(t *testing.T) { 1, ) }, - ResourceName: "uxi_wireless_network.my_wireless_network", + ResourceName: "hpeuxi_wireless_network.my_wireless_network", ImportState: true, ImportStateVerify: true, }, @@ -91,7 +91,7 @@ func TestWirelessNetworkResource(t *testing.T) { ) }, Config: provider.ProviderConfig + ` - resource "uxi_wireless_network" "my_wireless_network" { + resource "hpeuxi_wireless_network" "my_wireless_network" { name = "updated_name" }`, ExpectError: regexp.MustCompile( @@ -123,7 +123,7 @@ func TestWirelessNetworkResource(t *testing.T) { }, Config: provider.ProviderConfig + ` removed { - from = uxi_wireless_network.my_wireless_network + from = hpeuxi_wireless_network.my_wireless_network lifecycle { destroy = false @@ -163,19 +163,19 @@ func TestWirelessNetworkResourceTooManyRequestsHandling(t *testing.T) { ) }, Config: provider.ProviderConfig + ` - resource "uxi_wireless_network" "my_wireless_network" { + resource "hpeuxi_wireless_network" "my_wireless_network" { name = "name" } import { - to = uxi_wireless_network.my_wireless_network + to = hpeuxi_wireless_network.my_wireless_network id = "id" }`, Check: resource.ComposeAggregateTestCheckFunc( shared.CheckStateAgainstWirelessNetwork( t, - "uxi_wireless_network.my_wireless_network", + "hpeuxi_wireless_network.my_wireless_network", wirelessNetwork, ), func(s *terraform.State) error { @@ -189,7 +189,7 @@ func TestWirelessNetworkResourceTooManyRequestsHandling(t *testing.T) { { Config: provider.ProviderConfig + ` removed { - from = uxi_wireless_network.my_wireless_network + from = hpeuxi_wireless_network.my_wireless_network lifecycle { destroy = false @@ -219,12 +219,12 @@ func TestWirelessNetworkResourceHttpErrorHandling(t *testing.T) { util.MockGetWirelessNetwork("id", util.EmptyGetListResponse, 1) }, Config: provider.ProviderConfig + ` - resource "uxi_wireless_network" "my_wireless_network" { + resource "hpeuxi_wireless_network" "my_wireless_network" { name = "name" } import { - to = uxi_wireless_network.my_wireless_network + to = hpeuxi_wireless_network.my_wireless_network id = "id" }`, ExpectError: regexp.MustCompile(`Error: Cannot import non-existent remote object`), @@ -243,12 +243,12 @@ func TestWirelessNetworkResourceHttpErrorHandling(t *testing.T) { }) }, Config: provider.ProviderConfig + ` - resource "uxi_wireless_network" "my_wireless_network" { + resource "hpeuxi_wireless_network" "my_wireless_network" { name = "name" } import { - to = uxi_wireless_network.my_wireless_network + to = hpeuxi_wireless_network.my_wireless_network id = "id" }`, ExpectError: regexp.MustCompile(