From d8e165a261f428fffb5d16f5bf129ec06d09ec3d Mon Sep 17 00:00:00 2001 From: Alistair Yan <52126234+1riatsila1@users.noreply.github.com> Date: Wed, 13 Nov 2024 09:01:11 +0400 Subject: [PATCH 1/4] feat: sensor acceptance tests (#83) --- internal/provider/resources/sensor.go | 43 ++++------ test/live/datasources/sensor_test.go | 6 +- test/live/resources/sensor_test.go | 116 ++++++++++++++++++++++++++ test/live/util/sensor.go | 58 +++++++------ 4 files changed, 168 insertions(+), 55 deletions(-) create mode 100644 test/live/resources/sensor_test.go diff --git a/internal/provider/resources/sensor.go b/internal/provider/resources/sensor.go index cc3a971d..8c88abbd 100644 --- a/internal/provider/resources/sensor.go +++ b/internal/provider/resources/sensor.go @@ -13,7 +13,6 @@ import ( "github.com/hashicorp/terraform-plugin-framework/types" ) -// Ensure the implementation satisfies the expected interfaces. var ( _ resource.Resource = &sensorResource{} _ resource.ResourceWithConfigure = &sensorResource{} @@ -61,12 +60,18 @@ func (r *sensorResource) Schema( }, "address_note": schema.StringAttribute{ Optional: true, + // computed because goes from nil -> "" when sensor becomes configured + Computed: true, }, "notes": schema.StringAttribute{ Optional: true, + // computed because goes from from nil -> "" when sensor becomes configured + Computed: true, }, "pcap_mode": schema.StringAttribute{ Optional: true, + // computed because goes from from nil -> "light" when sensor becomes configured + Computed: true, }, }, } @@ -77,8 +82,6 @@ func (r *sensorResource) Configure( req resource.ConfigureRequest, resp *resource.ConfigureResponse, ) { - // Add a nil check when handling ProviderData because Terraform - // sets that data after it calls the ConfigureProvider RPC. if req.ProviderData == nil { return } @@ -101,7 +104,6 @@ func (r *sensorResource) Create( req resource.CreateRequest, resp *resource.CreateResponse, ) { - // Retrieve values from plan var plan sensorResourceModel diags := req.Plan.Get(ctx, &plan) diags.AddError( @@ -116,7 +118,6 @@ func (r *sensorResource) Read( req resource.ReadRequest, resp *resource.ReadResponse, ) { - // Get current state var state sensorResourceModel diags := req.State.Get(ctx, &state) resp.Diagnostics.Append(diags...) @@ -143,14 +144,12 @@ func (r *sensorResource) Read( } sensor := sensorResponse.Items[0] - // Update state from client response state.ID = types.StringValue(sensor.Id) state.Name = types.StringValue(sensor.Name) state.AddressNote = types.StringPointerValue(sensor.AddressNote.Get()) state.Notes = types.StringPointerValue(sensor.Notes.Get()) state.PCapMode = types.StringPointerValue(sensor.PcapMode.Get()) - // Set refreshed state diags = resp.State.Set(ctx, &state) resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { @@ -163,7 +162,6 @@ func (r *sensorResource) Update( req resource.UpdateRequest, resp *resource.UpdateResponse, ) { - // Retrieve values from plan var plan sensorResourceModel diags := req.Plan.Get(ctx, &plan) resp.Diagnostics.Append(diags...) @@ -172,15 +170,11 @@ func (r *sensorResource) Update( } patchRequest := config_api_client.NewSensorsPatchRequest() - if !plan.AddressNote.IsUnknown() { - patchRequest.AddressNote = plan.AddressNote.ValueStringPointer() - } - if !plan.Notes.IsUnknown() { - patchRequest.Notes = plan.Notes.ValueStringPointer() - } - if !plan.PCapMode.IsUnknown() { - patchRequest.PcapMode = plan.PCapMode.ValueStringPointer() - } + patchRequest.Name = plan.Name.ValueStringPointer() + patchRequest.AddressNote = plan.AddressNote.ValueStringPointer() + patchRequest.Notes = plan.Notes.ValueStringPointer() + patchRequest.PcapMode = plan.PCapMode.ValueStringPointer() + request := r.client.ConfigurationAPI. SensorsPatch(ctx, plan.ID.ValueString()). SensorsPatchRequest(*patchRequest) @@ -193,20 +187,12 @@ func (r *sensorResource) Update( return } - // Update the state to match the plan (replace with response from client) plan.ID = types.StringValue(sensor.Id) plan.Name = types.StringValue(sensor.Name) - if sensor.AddressNote.Get() != nil { - plan.AddressNote = types.StringValue(*sensor.AddressNote.Get()) - } - if sensor.Notes.Get() != nil { - plan.Notes = types.StringValue(*sensor.Notes.Get()) - } - if sensor.PcapMode.Get() != nil { - plan.PCapMode = types.StringValue(*sensor.PcapMode.Get()) - } + plan.AddressNote = types.StringPointerValue(sensor.AddressNote.Get()) + plan.Notes = types.StringPointerValue(sensor.Notes.Get()) + plan.PCapMode = types.StringPointerValue(sensor.PcapMode.Get()) - // Set state to fully populated data diags = resp.State.Set(ctx, plan) resp.Diagnostics.Append(diags...) if resp.Diagnostics.HasError() { @@ -219,7 +205,6 @@ func (r *sensorResource) Delete( req resource.DeleteRequest, resp *resource.DeleteResponse, ) { - // Retrieve values from state var state sensorResourceModel diags := req.State.Get(ctx, &state) diags.AddError( diff --git a/test/live/datasources/sensor_test.go b/test/live/datasources/sensor_test.go index d9c3475b..d31133b8 100644 --- a/test/live/datasources/sensor_test.go +++ b/test/live/datasources/sensor_test.go @@ -22,7 +22,11 @@ func TestSensorDataSource(t *testing.T) { } } `, - Check: util.CheckStateAgainstSensor(t, sensor), + Check: util.CheckDataSourceStateAgainstSensor( + t, + "data.uxi_sensor.my_sensor", + sensor, + ), }, }, }) diff --git a/test/live/resources/sensor_test.go b/test/live/resources/sensor_test.go new file mode 100644 index 00000000..9bdfbfe9 --- /dev/null +++ b/test/live/resources/sensor_test.go @@ -0,0 +1,116 @@ +package resource_test + +import ( + config_api_client "github.com/aruba-uxi/terraform-provider-hpeuxi/pkg/config-api-client" + "github.com/aruba-uxi/terraform-provider-hpeuxi/test/live/config" + "github.com/aruba-uxi/terraform-provider-hpeuxi/test/live/provider" + "github.com/aruba-uxi/terraform-provider-hpeuxi/test/live/util" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/tfversion" + + "regexp" + "testing" +) + +func TestSensorResource(t *testing.T) { + originalSensor := util.GetSensorProperties(config.SensorUid) + updatedNotes := "tf_provider_acceptance_test_update_notes" + updatedAddressNote := "tf_provider_acceptance_test_update_address_note" + updatedPcapMode := "off" + updatedSensor := config_api_client.SensorItem{ + Id: config.SensorUid, + Name: "tf_provider_acceptance_test_update_name", + Notes: *config_api_client.NewNullableString(&updatedNotes), + AddressNote: *config_api_client.NewNullableString(&updatedAddressNote), + PcapMode: *config_api_client.NewNullableString(&updatedPcapMode), + } + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: provider.TestAccProtoV6ProviderFactories, + TerraformVersionChecks: []tfversion.TerraformVersionCheck{ + // we required terraform 1.7.0 and above for the `removed` block + tfversion.RequireAbove(tfversion.Version1_7_0), + }, + Steps: []resource.TestStep{ + // Creating a sensor is not allowed + { + Config: provider.ProviderConfig + ` + resource "uxi_sensor" "my_sensor" { + name = "` + originalSensor.Name + `" + }`, + + ExpectError: regexp.MustCompile( + `creating a sensor is not supported; sensors can only be imported`, + ), + }, + // Importing a sensor + { + Config: provider.ProviderConfig + ` + resource "uxi_sensor" "my_sensor" { + name = "` + originalSensor.Name + `" + } + + import { + to = uxi_sensor.my_sensor + id = "` + config.SensorUid + `" + }`, + + Check: resource.ComposeAggregateTestCheckFunc(), + }, + // ImportState testing + { + ResourceName: "uxi_sensor.my_sensor", + ImportState: true, + ImportStateVerify: true, + }, + // Update testing + { + Config: provider.ProviderConfig + ` + resource "uxi_sensor" "my_sensor" { + name = "` + updatedSensor.Name + `" + address_note = "` + updatedSensor.GetAddressNote() + `" + notes = "` + updatedSensor.GetNotes() + `" + pcap_mode = "` + updatedSensor.GetPcapMode() + `" + }`, + Check: util.CheckResourceStateAgainstSensor( + t, + "uxi_sensor.my_sensor", + updatedSensor, + ), + }, + // Update sensor back to original + { + Config: provider.ProviderConfig + ` + resource "uxi_sensor" "my_sensor" { + name = "` + originalSensor.Name + `" + address_note = "` + originalSensor.GetAddressNote() + `" + notes = "` + originalSensor.GetNotes() + `" + pcap_mode = "` + originalSensor.GetPcapMode() + `" + }`, + Check: util.CheckResourceStateAgainstSensor( + t, + "uxi_sensor.my_sensor", + originalSensor, + ), + }, + // Deleting a sensor is not allowed + { + Config: provider.ProviderConfig + ``, + ExpectError: regexp.MustCompile( + `deleting a sensor is not supported; sensors can only removed from state`, + ), + }, + // Remove sensor from state + { + Config: provider.ProviderConfig + ` + removed { + from = uxi_sensor.my_sensor + + lifecycle { + destroy = false + } + }`, + }, + }, + }) +} diff --git a/test/live/util/sensor.go b/test/live/util/sensor.go index b1e6209b..2e8068c6 100644 --- a/test/live/util/sensor.go +++ b/test/live/util/sensor.go @@ -23,42 +23,50 @@ func GetSensorProperties(id string) config_api_client.SensorItem { return result.Items[0] } -func CheckStateAgainstSensor( +func CheckDataSourceStateAgainstSensor( t st.Fatalf, + entity string, sensor config_api_client.SensorItem, ) resource.TestCheckFunc { return resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("data.uxi_sensor.my_sensor", "id", config.SensorUid), - resource.TestCheckResourceAttr("data.uxi_sensor.my_sensor", "serial", sensor.Serial), - resource.TestCheckResourceAttr( - "data.uxi_sensor.my_sensor", - "model_number", - sensor.ModelNumber, - ), + resource.TestCheckResourceAttr(entity, "id", config.SensorUid), + resource.TestCheckResourceAttr(entity, "serial", sensor.Serial), + resource.TestCheckResourceAttr(entity, "model_number", sensor.ModelNumber), resource.TestCheckResourceAttrWith( - "data.uxi_sensor.my_sensor", + entity, "name", func(value string) error { st.Assert(t, value, sensor.Name) return nil }, ), - TestOptionalValue( - t, - "data.uxi_sensor.my_sensor", - "wifi_mac_address", - sensor.WifiMacAddress.Get(), - ), - TestOptionalValue( - t, - "data.uxi_sensor.my_sensor", - "ethernet_mac_address", - sensor.EthernetMacAddress.Get(), + TestOptionalValue(t, entity, "wifi_mac_address", sensor.WifiMacAddress.Get()), + TestOptionalValue(t, entity, "ethernet_mac_address", sensor.EthernetMacAddress.Get()), + TestOptionalValue(t, entity, "address_note", sensor.AddressNote.Get()), + TestOptionalFloatValue(t, entity, "latitude", sensor.Latitude.Get()), + TestOptionalFloatValue(t, entity, "longitude", sensor.Longitude.Get()), + TestOptionalValue(t, entity, "notes", sensor.Notes.Get()), + TestOptionalValue(t, entity, "pcap_mode", sensor.PcapMode.Get()), + ) +} + +func CheckResourceStateAgainstSensor( + t st.Fatalf, + entity string, + sensor config_api_client.SensorItem, +) resource.TestCheckFunc { + return resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(entity, "id", config.SensorUid), + resource.TestCheckResourceAttrWith( + entity, + "name", + func(value string) error { + st.Assert(t, value, sensor.Name) + return nil + }, ), - TestOptionalValue(t, "data.uxi_sensor.my_sensor", "address_note", sensor.AddressNote.Get()), - TestOptionalFloatValue(t, "data.uxi_sensor.my_sensor", "latitude", sensor.Latitude.Get()), - TestOptionalFloatValue(t, "data.uxi_sensor.my_sensor", "longitude", sensor.Longitude.Get()), - TestOptionalValue(t, "data.uxi_sensor.my_sensor", "notes", sensor.Notes.Get()), - TestOptionalValue(t, "data.uxi_sensor.my_sensor", "pcap_mode", sensor.PcapMode.Get()), + TestOptionalValue(t, entity, "address_note", sensor.AddressNote.Get()), + TestOptionalValue(t, entity, "notes", sensor.Notes.Get()), + TestOptionalValue(t, entity, "pcap_mode", sensor.PcapMode.Get()), ) } From f5c6c802e50e2279c5bcb716f75ea87b21aee173 Mon Sep 17 00:00:00 2001 From: Alistair Yan <52126234+1riatsila1@users.noreply.github.com> Date: Wed, 13 Nov 2024 09:16:25 +0400 Subject: [PATCH 2/4] feat: acceptance tests | data source | network group assignment (#93) --- .../network_group_assignment_test.go | 58 +++++++++++++++++++ test/live/util/network_group_assignment.go | 35 +++++++++++ 2 files changed, 93 insertions(+) create mode 100644 test/live/datasources/network_group_assignment_test.go create mode 100644 test/live/util/network_group_assignment.go diff --git a/test/live/datasources/network_group_assignment_test.go b/test/live/datasources/network_group_assignment_test.go new file mode 100644 index 00000000..0a99dce7 --- /dev/null +++ b/test/live/datasources/network_group_assignment_test.go @@ -0,0 +1,58 @@ +package data_source_test + +import ( + "testing" + + "github.com/aruba-uxi/terraform-provider-hpeuxi/test/live/config" + "github.com/aruba-uxi/terraform-provider-hpeuxi/test/live/provider" + "github.com/aruba-uxi/terraform-provider-hpeuxi/test/live/util" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" +) + +func TestNetworkGroupAssignmentDataSource(t *testing.T) { + const groupName = "tf_provider_acceptance_test_network_group_assignment_datasource" + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: provider.TestAccProtoV6ProviderFactories, + Steps: []resource.TestStep{ + { + Config: provider.ProviderConfig + ` + // create the resource to be used as a datasource + resource "uxi_group" "my_group" { + name = "` + groupName + `" + } + + data "uxi_wired_network" "my_network" { + filter = { + wired_network_id = "` + config.WiredNetworkUid + `" + } + } + + 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 + } + + // the actual datasource + data "uxi_network_group_assignment" "my_network_group_assignment" { + filter = { + network_group_assignment_id = uxi_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" + rs := s.RootModule().Resources[resourceName] + return util.CheckStateAgainstNetworkGroupAssignment( + t, + "data.uxi_network_group_assignment.my_network_group_assignment", + util.GetNetworkGroupAssignment(rs.Primary.ID), + )(s) + }, + ), + }, + }, + }) +} diff --git a/test/live/util/network_group_assignment.go b/test/live/util/network_group_assignment.go new file mode 100644 index 00000000..3ef454c0 --- /dev/null +++ b/test/live/util/network_group_assignment.go @@ -0,0 +1,35 @@ +package util + +import ( + "context" + + config_api_client "github.com/aruba-uxi/terraform-provider-hpeuxi/pkg/config-api-client" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/nbio/st" +) + +func GetNetworkGroupAssignment(id string) config_api_client.NetworkGroupAssignmentsItem { + result, _, err := Client.ConfigurationAPI. + NetworkGroupAssignmentsGet(context.Background()). + Id(id). + Execute() + if err != nil { + panic(err) + } + if len(result.Items) != 1 { + panic("network_group_assignment with id `" + id + "` could not be found") + } + return result.Items[0] +} + +func CheckStateAgainstNetworkGroupAssignment( + t st.Fatalf, + entity string, + networkGroupAssignment config_api_client.NetworkGroupAssignmentsItem, +) resource.TestCheckFunc { + return resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(entity, "id", networkGroupAssignment.Id), + resource.TestCheckResourceAttr(entity, "group_id", networkGroupAssignment.Group.Id), + resource.TestCheckResourceAttr(entity, "network_id", networkGroupAssignment.Network.Id), + ) +} From 18eef4117686f31a1b7454efa5a5d415f8851c3c Mon Sep 17 00:00:00 2001 From: Alistair Yan <52126234+1riatsila1@users.noreply.github.com> Date: Wed, 13 Nov 2024 09:20:53 +0400 Subject: [PATCH 3/4] feat: acceptance tests | data source | service test group assignment (#94) --- .../service_test_group_assignment_test.go | 60 +++++++++++++++++++ .../util/service_test_group_assignment.go | 39 ++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 test/live/datasources/service_test_group_assignment_test.go create mode 100644 test/live/util/service_test_group_assignment.go diff --git a/test/live/datasources/service_test_group_assignment_test.go b/test/live/datasources/service_test_group_assignment_test.go new file mode 100644 index 00000000..04fcd8cd --- /dev/null +++ b/test/live/datasources/service_test_group_assignment_test.go @@ -0,0 +1,60 @@ +package data_source_test + +import ( + "testing" + + "github.com/aruba-uxi/terraform-provider-hpeuxi/test/live/config" + "github.com/aruba-uxi/terraform-provider-hpeuxi/test/live/provider" + "github.com/aruba-uxi/terraform-provider-hpeuxi/test/live/util" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/hashicorp/terraform-plugin-testing/terraform" +) + +func TestServiceTestGroupAssignmentDataSource(t *testing.T) { + const groupName = "tf_provider_acceptance_test_service_test_group_assignment_datasource" + + resource.Test(t, resource.TestCase{ + ProtoV6ProviderFactories: provider.TestAccProtoV6ProviderFactories, + Steps: []resource.TestStep{ + { + Config: provider.ProviderConfig + ` + // create the resource to be used as a datasource + resource "uxi_group" "my_group" { + name = "` + groupName + `" + } + + data "uxi_service_test" "my_service_test" { + filter = { + service_test_id = "` + config.ServiceTestUid + `" + } + } + + 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 + } + + // the actual datasource + data "uxi_service_test_group_assignment" "my_service_test_group_assignment" { + filter = { + service_test_group_assignment_id = uxi_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" + rs := s.RootModule().Resources[resourceName] + return util.CheckStateAgainstServiceTestGroupAssignment( + t, + "data.uxi_service_test_group_assignment.my_service_test_group_assignment", + util.GetServiceTestGroupAssignment(rs.Primary.ID), + )( + s, + ) + }, + ), + }, + }, + }) +} diff --git a/test/live/util/service_test_group_assignment.go b/test/live/util/service_test_group_assignment.go new file mode 100644 index 00000000..24c546ec --- /dev/null +++ b/test/live/util/service_test_group_assignment.go @@ -0,0 +1,39 @@ +package util + +import ( + "context" + + config_api_client "github.com/aruba-uxi/terraform-provider-hpeuxi/pkg/config-api-client" + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + "github.com/nbio/st" +) + +func GetServiceTestGroupAssignment(id string) config_api_client.ServiceTestGroupAssignmentsItem { + result, _, err := Client.ConfigurationAPI. + ServiceTestGroupAssignmentsGet(context.Background()). + Id(id). + Execute() + if err != nil { + panic(err) + } + if len(result.Items) != 1 { + panic("service_test_group_assignment with id `" + id + "` could not be found") + } + return result.Items[0] +} + +func CheckStateAgainstServiceTestGroupAssignment( + t st.Fatalf, + entity string, + serviceTestGroupAssignment config_api_client.ServiceTestGroupAssignmentsItem, +) resource.TestCheckFunc { + return resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(entity, "id", serviceTestGroupAssignment.Id), + resource.TestCheckResourceAttr(entity, "group_id", serviceTestGroupAssignment.Group.Id), + resource.TestCheckResourceAttr( + entity, + "service_test_id", + serviceTestGroupAssignment.ServiceTest.Id, + ), + ) +} From 53fe26a662a245f7785b194f75a0c96f43fc3aa0 Mon Sep 17 00:00:00 2001 From: Alistair Yan <52126234+1riatsila1@users.noreply.github.com> Date: Wed, 13 Nov 2024 09:25:20 +0400 Subject: [PATCH 4/4] feat: client (5.10.0) agent group assignment delete (#95) --- pkg/config-api-client/README.md | 3 +- .../api/.openapi.source.yaml | 42 ++++- pkg/config-api-client/api/openapi.yaml | 41 ++++- pkg/config-api-client/api_configuration.go | 153 +++++++++++++++++- pkg/config-api-client/client.go | 4 +- pkg/config-api-client/configuration.go | 2 +- .../docs/ConfigurationAPI.md | 71 ++++++++ pkg/config-api-client/model_agent.go | 2 +- .../model_agent_group_assignment_response.go | 2 +- .../model_agent_group_assignments_item.go | 2 +- ...el_agent_group_assignments_post_request.go | 2 +- .../model_agent_group_assignments_response.go | 2 +- pkg/config-api-client/model_agent_item.go | 2 +- .../model_agents_patch_request.go | 2 +- .../model_agents_patch_response.go | 2 +- .../model_agents_response.go | 2 +- pkg/config-api-client/model_error_detail.go | 2 +- pkg/config-api-client/model_error_response.go | 2 +- pkg/config-api-client/model_group.go | 2 +- .../model_groups_get_item.go | 2 +- .../model_groups_get_response.go | 2 +- .../model_groups_patch_request.go | 2 +- .../model_groups_patch_response.go | 2 +- .../model_groups_post_request.go | 2 +- .../model_groups_post_response.go | 2 +- pkg/config-api-client/model_issue.go | 2 +- pkg/config-api-client/model_issue_subject.go | 2 +- pkg/config-api-client/model_network.go | 2 +- .../model_network_group_assignments_item.go | 2 +- ..._network_group_assignments_post_request.go | 2 +- ...network_group_assignments_post_response.go | 2 +- ...odel_network_group_assignments_response.go | 2 +- pkg/config-api-client/model_parent.go | 2 +- pkg/config-api-client/model_sensor.go | 2 +- .../model_sensor_group_assignment_response.go | 2 +- .../model_sensor_group_assignments_item.go | 2 +- ...l_sensor_group_assignments_post_request.go | 2 +- ...model_sensor_group_assignments_response.go | 2 +- pkg/config-api-client/model_sensor_item.go | 2 +- .../model_sensors_patch_request.go | 2 +- .../model_sensors_patch_response.go | 2 +- .../model_sensors_response.go | 2 +- pkg/config-api-client/model_service_test_.go | 2 +- ...del_service_test_group_assignments_item.go | 2 +- ...ice_test_group_assignments_post_request.go | 2 +- ...ce_test_group_assignments_post_response.go | 2 +- ...service_test_group_assignments_response.go | 2 +- .../model_service_tests_list_item.go | 2 +- .../model_service_tests_list_response.go | 2 +- .../model_wired_networks_item.go | 2 +- .../model_wired_networks_response.go | 2 +- .../model_wireless_networks_item.go | 2 +- .../model_wireless_networks_response.go | 2 +- pkg/config-api-client/response.go | 2 +- .../test/api_configuration_test.go | 13 ++ pkg/config-api-client/utils.go | 2 +- 56 files changed, 370 insertions(+), 55 deletions(-) diff --git a/pkg/config-api-client/README.md b/pkg/config-api-client/README.md index e2d2ce49..448bcc59 100644 --- a/pkg/config-api-client/README.md +++ b/pkg/config-api-client/README.md @@ -5,7 +5,7 @@ Nice description goes here ## Overview This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. -- API version: 5.9.0 +- API version: 5.10.0 - Package version: 1.0.0 - Generator version: 7.9.0-SNAPSHOT - Build package: org.openapitools.codegen.languages.GoClientCodegen @@ -79,6 +79,7 @@ All URIs are relative to *https://api.capenetworks.com* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*ConfigurationAPI* | [**AgentGroupAssignmentDelete**](docs/ConfigurationAPI.md#agentgroupassignmentdelete) | **Delete** /networking-uxi/v1alpha1/agent-group-assignments/{uid} | Agent Group Assignment Delete *ConfigurationAPI* | [**AgentGroupAssignmentsGet**](docs/ConfigurationAPI.md#agentgroupassignmentsget) | **Get** /networking-uxi/v1alpha1/agent-group-assignments | Agent Group Assignments Get *ConfigurationAPI* | [**AgentGroupAssignmentsPost**](docs/ConfigurationAPI.md#agentgroupassignmentspost) | **Post** /networking-uxi/v1alpha1/agent-group-assignments | Agent Group Assignments Post *ConfigurationAPI* | [**AgentsDelete**](docs/ConfigurationAPI.md#agentsdelete) | **Delete** /networking-uxi/v1alpha1/agents/{agent_uid} | Agents Delete diff --git a/pkg/config-api-client/api/.openapi.source.yaml b/pkg/config-api-client/api/.openapi.source.yaml index 050cfcff..a87530b1 100644 --- a/pkg/config-api-client/api/.openapi.source.yaml +++ b/pkg/config-api-client/api/.openapi.source.yaml @@ -9,7 +9,7 @@ info: email: support@capenetworks.com license: name: No idea, but we need something - version: 5.9.0 + version: 5.10.0 servers: - url: https://api.capenetworks.com - url: https://api.staging.capedev.io @@ -109,6 +109,46 @@ paths: - v1alpha1 - agent-group-assignments x-stability-level: alpha + /networking-uxi/v1alpha1/agent-group-assignments/{uid}: + delete: + operationId: agent_group_assignment_delete + summary: Agent Group Assignment Delete + description: Delete an agent group assignment. + parameters: + - name: uid + in: path + required: true + schema: + type: string + title: Uid + responses: + '200': + description: Successful Response + content: + application/json: + schema: {} + '204': + description: No Content + 4XX: + description: Client Error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + 5XX: + description: Server Error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - HTTPBearer: [] + tags: + - api + - configuration + - v1alpha1 + - agent-group-assignments + x-stability-level: alpha /networking-uxi/v1alpha1/agents/{agent_uid}: delete: operationId: agents_delete diff --git a/pkg/config-api-client/api/openapi.yaml b/pkg/config-api-client/api/openapi.yaml index 1ae944f0..df14a1e1 100644 --- a/pkg/config-api-client/api/openapi.yaml +++ b/pkg/config-api-client/api/openapi.yaml @@ -9,7 +9,7 @@ info: name: "No idea, but we need something" termsOfService: http://we.dont.care.yet.com/term-of-service title: Configuration Api - version: 5.9.0 + version: 5.10.0 servers: - url: https://api.capenetworks.com - url: https://api.staging.capedev.io @@ -121,6 +121,45 @@ paths: tags: - configuration x-stability-level: alpha + /networking-uxi/v1alpha1/agent-group-assignments/{uid}: + delete: + description: Delete an agent group assignment. + operationId: agent_group_assignment_delete + parameters: + - explode: false + in: path + name: uid + required: true + schema: + title: Uid + type: string + style: simple + responses: + "200": + content: + application/json: + schema: {} + description: Successful Response + "204": + description: No Content + "4XX": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Client Error + "5XX": + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + description: Server Error + security: + - HTTPBearer: [] + summary: Agent Group Assignment Delete + tags: + - configuration + x-stability-level: alpha /networking-uxi/v1alpha1/agents/{agent_uid}: delete: description: Delete an existing agent. diff --git a/pkg/config-api-client/api_configuration.go b/pkg/config-api-client/api_configuration.go index e6c05851..7ec5630f 100644 --- a/pkg/config-api-client/api_configuration.go +++ b/pkg/config-api-client/api_configuration.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ @@ -23,6 +23,157 @@ import ( // ConfigurationAPIService ConfigurationAPI service type ConfigurationAPIService service +type ApiAgentGroupAssignmentDeleteRequest struct { + ctx context.Context + ApiService *ConfigurationAPIService + uid string +} + +func (r ApiAgentGroupAssignmentDeleteRequest) Execute() (interface{}, *http.Response, error) { + return r.ApiService.AgentGroupAssignmentDeleteExecute(r) +} + +/* +AgentGroupAssignmentDelete Agent Group Assignment Delete + +Delete an agent group assignment. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uid + @return ApiAgentGroupAssignmentDeleteRequest +*/ +func (a *ConfigurationAPIService) AgentGroupAssignmentDelete( + ctx context.Context, + uid string, +) ApiAgentGroupAssignmentDeleteRequest { + return ApiAgentGroupAssignmentDeleteRequest{ + ApiService: a, + ctx: ctx, + uid: uid, + } +} + +// Execute executes the request +// +// @return interface{} +func (a *ConfigurationAPIService) AgentGroupAssignmentDeleteExecute( + r ApiAgentGroupAssignmentDeleteRequest, +) (interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext( + r.ctx, + "ConfigurationAPIService.AgentGroupAssignmentDelete", + ) + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/networking-uxi/v1alpha1/agent-group-assignments/{uid}" + localVarPath = strings.Replace( + localVarPath, + "{"+"uid"+"}", + url.PathEscape(parameterValueToString(r.uid, "uid")), + -1, + ) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest( + r.ctx, + localVarPath, + localVarHTTPMethod, + localVarPostBody, + localVarHeaderParams, + localVarQueryParams, + localVarFormParams, + formFiles, + ) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode >= 400 && localVarHTTPResponse.StatusCode < 500 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode >= 500 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode( + &localVarReturnValue, + localVarBody, + localVarHTTPResponse.Header.Get("Content-Type"), + ) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + type ApiAgentGroupAssignmentsGetRequest struct { ctx context.Context ApiService *ConfigurationAPIService diff --git a/pkg/config-api-client/client.go b/pkg/config-api-client/client.go index e9889bc6..dd1a33eb 100644 --- a/pkg/config-api-client/client.go +++ b/pkg/config-api-client/client.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ @@ -41,7 +41,7 @@ var ( queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") ) -// APIClient manages communication with the Configuration Api API v5.9.0 +// APIClient manages communication with the Configuration Api API v5.10.0 // In most cases there should be only one, shared, APIClient. type APIClient struct { cfg *Configuration diff --git a/pkg/config-api-client/configuration.go b/pkg/config-api-client/configuration.go index 0fd876f8..2217c2e4 100644 --- a/pkg/config-api-client/configuration.go +++ b/pkg/config-api-client/configuration.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/docs/ConfigurationAPI.md b/pkg/config-api-client/docs/ConfigurationAPI.md index e3f8e2de..fb7deba8 100644 --- a/pkg/config-api-client/docs/ConfigurationAPI.md +++ b/pkg/config-api-client/docs/ConfigurationAPI.md @@ -4,6 +4,7 @@ All URIs are relative to *https://api.capenetworks.com* Method | HTTP request | Description ------------- | ------------- | ------------- +[**AgentGroupAssignmentDelete**](ConfigurationAPI.md#AgentGroupAssignmentDelete) | **Delete** /networking-uxi/v1alpha1/agent-group-assignments/{uid} | Agent Group Assignment Delete [**AgentGroupAssignmentsGet**](ConfigurationAPI.md#AgentGroupAssignmentsGet) | **Get** /networking-uxi/v1alpha1/agent-group-assignments | Agent Group Assignments Get [**AgentGroupAssignmentsPost**](ConfigurationAPI.md#AgentGroupAssignmentsPost) | **Post** /networking-uxi/v1alpha1/agent-group-assignments | Agent Group Assignments Post [**AgentsDelete**](ConfigurationAPI.md#AgentsDelete) | **Delete** /networking-uxi/v1alpha1/agents/{agent_uid} | Agents Delete @@ -30,6 +31,76 @@ Method | HTTP request | Description +## AgentGroupAssignmentDelete + +> interface{} AgentGroupAssignmentDelete(ctx, uid).Execute() + +Agent Group Assignment Delete + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/aruba-uxi/terraform-provider-hpeuxi/pkg/config-api-client" +) + +func main() { + uid := "uid_example" // string | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ConfigurationAPI.AgentGroupAssignmentDelete(context.Background(), uid).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ConfigurationAPI.AgentGroupAssignmentDelete``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AgentGroupAssignmentDelete`: interface{} + fmt.Fprintf(os.Stdout, "Response from `ConfigurationAPI.AgentGroupAssignmentDelete`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**uid** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAgentGroupAssignmentDeleteRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +**interface{}** + +### Authorization + +[HTTPBearer](../README.md#HTTPBearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + ## AgentGroupAssignmentsGet > AgentGroupAssignmentsResponse AgentGroupAssignmentsGet(ctx).Id(id).Next(next).Limit(limit).Execute() diff --git a/pkg/config-api-client/model_agent.go b/pkg/config-api-client/model_agent.go index 11c8c0bb..095f8736 100644 --- a/pkg/config-api-client/model_agent.go +++ b/pkg/config-api-client/model_agent.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_agent_group_assignment_response.go b/pkg/config-api-client/model_agent_group_assignment_response.go index 14388a7f..7fc7850b 100644 --- a/pkg/config-api-client/model_agent_group_assignment_response.go +++ b/pkg/config-api-client/model_agent_group_assignment_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_agent_group_assignments_item.go b/pkg/config-api-client/model_agent_group_assignments_item.go index 1d4b44e1..5b67360b 100644 --- a/pkg/config-api-client/model_agent_group_assignments_item.go +++ b/pkg/config-api-client/model_agent_group_assignments_item.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_agent_group_assignments_post_request.go b/pkg/config-api-client/model_agent_group_assignments_post_request.go index 94367adb..27bc83c1 100644 --- a/pkg/config-api-client/model_agent_group_assignments_post_request.go +++ b/pkg/config-api-client/model_agent_group_assignments_post_request.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_agent_group_assignments_response.go b/pkg/config-api-client/model_agent_group_assignments_response.go index bbfd6f9a..e726c89c 100644 --- a/pkg/config-api-client/model_agent_group_assignments_response.go +++ b/pkg/config-api-client/model_agent_group_assignments_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_agent_item.go b/pkg/config-api-client/model_agent_item.go index 7cadb445..3677cd4e 100644 --- a/pkg/config-api-client/model_agent_item.go +++ b/pkg/config-api-client/model_agent_item.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_agents_patch_request.go b/pkg/config-api-client/model_agents_patch_request.go index 1e048fce..44d16bad 100644 --- a/pkg/config-api-client/model_agents_patch_request.go +++ b/pkg/config-api-client/model_agents_patch_request.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_agents_patch_response.go b/pkg/config-api-client/model_agents_patch_response.go index 03e62ea0..dab8c5c5 100644 --- a/pkg/config-api-client/model_agents_patch_response.go +++ b/pkg/config-api-client/model_agents_patch_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_agents_response.go b/pkg/config-api-client/model_agents_response.go index 81f52770..daa5bc9c 100644 --- a/pkg/config-api-client/model_agents_response.go +++ b/pkg/config-api-client/model_agents_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_error_detail.go b/pkg/config-api-client/model_error_detail.go index a82d5e00..51ee835e 100644 --- a/pkg/config-api-client/model_error_detail.go +++ b/pkg/config-api-client/model_error_detail.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_error_response.go b/pkg/config-api-client/model_error_response.go index a81b1024..448deb4c 100644 --- a/pkg/config-api-client/model_error_response.go +++ b/pkg/config-api-client/model_error_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_group.go b/pkg/config-api-client/model_group.go index 1e04dc56..7c291c9a 100644 --- a/pkg/config-api-client/model_group.go +++ b/pkg/config-api-client/model_group.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_groups_get_item.go b/pkg/config-api-client/model_groups_get_item.go index cf4a85e0..9db3ce95 100644 --- a/pkg/config-api-client/model_groups_get_item.go +++ b/pkg/config-api-client/model_groups_get_item.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_groups_get_response.go b/pkg/config-api-client/model_groups_get_response.go index 1370923f..bb1fd03e 100644 --- a/pkg/config-api-client/model_groups_get_response.go +++ b/pkg/config-api-client/model_groups_get_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_groups_patch_request.go b/pkg/config-api-client/model_groups_patch_request.go index 8ef0029c..c22206af 100644 --- a/pkg/config-api-client/model_groups_patch_request.go +++ b/pkg/config-api-client/model_groups_patch_request.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_groups_patch_response.go b/pkg/config-api-client/model_groups_patch_response.go index 74a729a5..cb572f4b 100644 --- a/pkg/config-api-client/model_groups_patch_response.go +++ b/pkg/config-api-client/model_groups_patch_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_groups_post_request.go b/pkg/config-api-client/model_groups_post_request.go index 54b701c9..298a52ff 100644 --- a/pkg/config-api-client/model_groups_post_request.go +++ b/pkg/config-api-client/model_groups_post_request.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_groups_post_response.go b/pkg/config-api-client/model_groups_post_response.go index f428fae6..2ddcc319 100644 --- a/pkg/config-api-client/model_groups_post_response.go +++ b/pkg/config-api-client/model_groups_post_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_issue.go b/pkg/config-api-client/model_issue.go index b72b0133..1d53863a 100644 --- a/pkg/config-api-client/model_issue.go +++ b/pkg/config-api-client/model_issue.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_issue_subject.go b/pkg/config-api-client/model_issue_subject.go index bc479340..6ed7ed7a 100644 --- a/pkg/config-api-client/model_issue_subject.go +++ b/pkg/config-api-client/model_issue_subject.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_network.go b/pkg/config-api-client/model_network.go index 085e74fb..68498dfb 100644 --- a/pkg/config-api-client/model_network.go +++ b/pkg/config-api-client/model_network.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_network_group_assignments_item.go b/pkg/config-api-client/model_network_group_assignments_item.go index 1cfd3b79..016e4813 100644 --- a/pkg/config-api-client/model_network_group_assignments_item.go +++ b/pkg/config-api-client/model_network_group_assignments_item.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_network_group_assignments_post_request.go b/pkg/config-api-client/model_network_group_assignments_post_request.go index 210c49c8..a366d142 100644 --- a/pkg/config-api-client/model_network_group_assignments_post_request.go +++ b/pkg/config-api-client/model_network_group_assignments_post_request.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_network_group_assignments_post_response.go b/pkg/config-api-client/model_network_group_assignments_post_response.go index e15bd839..48b96639 100644 --- a/pkg/config-api-client/model_network_group_assignments_post_response.go +++ b/pkg/config-api-client/model_network_group_assignments_post_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_network_group_assignments_response.go b/pkg/config-api-client/model_network_group_assignments_response.go index 44972ae3..cbd49033 100644 --- a/pkg/config-api-client/model_network_group_assignments_response.go +++ b/pkg/config-api-client/model_network_group_assignments_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_parent.go b/pkg/config-api-client/model_parent.go index 924413f6..f7e3072f 100644 --- a/pkg/config-api-client/model_parent.go +++ b/pkg/config-api-client/model_parent.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_sensor.go b/pkg/config-api-client/model_sensor.go index 9c0a86cb..028b1352 100644 --- a/pkg/config-api-client/model_sensor.go +++ b/pkg/config-api-client/model_sensor.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_sensor_group_assignment_response.go b/pkg/config-api-client/model_sensor_group_assignment_response.go index 0c7de64d..b7df55a3 100644 --- a/pkg/config-api-client/model_sensor_group_assignment_response.go +++ b/pkg/config-api-client/model_sensor_group_assignment_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_sensor_group_assignments_item.go b/pkg/config-api-client/model_sensor_group_assignments_item.go index 0c08382b..6f4f278f 100644 --- a/pkg/config-api-client/model_sensor_group_assignments_item.go +++ b/pkg/config-api-client/model_sensor_group_assignments_item.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_sensor_group_assignments_post_request.go b/pkg/config-api-client/model_sensor_group_assignments_post_request.go index 171ad3ad..83ddd32b 100644 --- a/pkg/config-api-client/model_sensor_group_assignments_post_request.go +++ b/pkg/config-api-client/model_sensor_group_assignments_post_request.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_sensor_group_assignments_response.go b/pkg/config-api-client/model_sensor_group_assignments_response.go index 891f5a20..86c55e4f 100644 --- a/pkg/config-api-client/model_sensor_group_assignments_response.go +++ b/pkg/config-api-client/model_sensor_group_assignments_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_sensor_item.go b/pkg/config-api-client/model_sensor_item.go index e2729397..838cade2 100644 --- a/pkg/config-api-client/model_sensor_item.go +++ b/pkg/config-api-client/model_sensor_item.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_sensors_patch_request.go b/pkg/config-api-client/model_sensors_patch_request.go index 90a85c68..15512305 100644 --- a/pkg/config-api-client/model_sensors_patch_request.go +++ b/pkg/config-api-client/model_sensors_patch_request.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_sensors_patch_response.go b/pkg/config-api-client/model_sensors_patch_response.go index cacaec6a..27d0b853 100644 --- a/pkg/config-api-client/model_sensors_patch_response.go +++ b/pkg/config-api-client/model_sensors_patch_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_sensors_response.go b/pkg/config-api-client/model_sensors_response.go index 70e6df4a..2b626e61 100644 --- a/pkg/config-api-client/model_sensors_response.go +++ b/pkg/config-api-client/model_sensors_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_service_test_.go b/pkg/config-api-client/model_service_test_.go index dc818c15..44f0572f 100644 --- a/pkg/config-api-client/model_service_test_.go +++ b/pkg/config-api-client/model_service_test_.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_service_test_group_assignments_item.go b/pkg/config-api-client/model_service_test_group_assignments_item.go index a72a99aa..9cf0fef2 100644 --- a/pkg/config-api-client/model_service_test_group_assignments_item.go +++ b/pkg/config-api-client/model_service_test_group_assignments_item.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_service_test_group_assignments_post_request.go b/pkg/config-api-client/model_service_test_group_assignments_post_request.go index 8c6e8b32..462e66a9 100644 --- a/pkg/config-api-client/model_service_test_group_assignments_post_request.go +++ b/pkg/config-api-client/model_service_test_group_assignments_post_request.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_service_test_group_assignments_post_response.go b/pkg/config-api-client/model_service_test_group_assignments_post_response.go index 199fe98a..a8f2c406 100644 --- a/pkg/config-api-client/model_service_test_group_assignments_post_response.go +++ b/pkg/config-api-client/model_service_test_group_assignments_post_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_service_test_group_assignments_response.go b/pkg/config-api-client/model_service_test_group_assignments_response.go index f1cfc531..03f0b6d9 100644 --- a/pkg/config-api-client/model_service_test_group_assignments_response.go +++ b/pkg/config-api-client/model_service_test_group_assignments_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_service_tests_list_item.go b/pkg/config-api-client/model_service_tests_list_item.go index 08851aad..62375918 100644 --- a/pkg/config-api-client/model_service_tests_list_item.go +++ b/pkg/config-api-client/model_service_tests_list_item.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_service_tests_list_response.go b/pkg/config-api-client/model_service_tests_list_response.go index 27cd02b8..213e2b0c 100644 --- a/pkg/config-api-client/model_service_tests_list_response.go +++ b/pkg/config-api-client/model_service_tests_list_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_wired_networks_item.go b/pkg/config-api-client/model_wired_networks_item.go index 57a889ec..73a219a8 100644 --- a/pkg/config-api-client/model_wired_networks_item.go +++ b/pkg/config-api-client/model_wired_networks_item.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_wired_networks_response.go b/pkg/config-api-client/model_wired_networks_response.go index 1b2ece3e..8f4e171b 100644 --- a/pkg/config-api-client/model_wired_networks_response.go +++ b/pkg/config-api-client/model_wired_networks_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_wireless_networks_item.go b/pkg/config-api-client/model_wireless_networks_item.go index bb4ca527..c05f2e4d 100644 --- a/pkg/config-api-client/model_wireless_networks_item.go +++ b/pkg/config-api-client/model_wireless_networks_item.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/model_wireless_networks_response.go b/pkg/config-api-client/model_wireless_networks_response.go index 45f5e06a..0edde116 100644 --- a/pkg/config-api-client/model_wireless_networks_response.go +++ b/pkg/config-api-client/model_wireless_networks_response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/response.go b/pkg/config-api-client/response.go index 4b196a3a..2c309448 100644 --- a/pkg/config-api-client/response.go +++ b/pkg/config-api-client/response.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */ diff --git a/pkg/config-api-client/test/api_configuration_test.go b/pkg/config-api-client/test/api_configuration_test.go index c3bd095b..1cff5ae5 100644 --- a/pkg/config-api-client/test/api_configuration_test.go +++ b/pkg/config-api-client/test/api_configuration_test.go @@ -456,6 +456,19 @@ func TestConfigurationAPI(t *testing.T) { }) }) + t.Run("Test ConfigurationAPI AgentGroupAssignmentDelete", func(t *testing.T) { + gock.New(configuration.Scheme + "://" + configuration.Host). + Delete("/networking-uxi/v1alpha1/agent-group-assignments/uid"). + Reply(204) + + _, httpRes, err := apiClient.ConfigurationAPI. + AgentGroupAssignmentDelete(context.Background(), "uid"). + Execute() + + require.Nil(t, err) + assert.Equal(t, 204, httpRes.StatusCode) + }) + t.Run("Test ConfigurationAPI SensorGroupAssignmentsGet", func(t *testing.T) { gock.New(configuration.Scheme + "://" + configuration.Host). diff --git a/pkg/config-api-client/utils.go b/pkg/config-api-client/utils.go index a9166952..12f75903 100644 --- a/pkg/config-api-client/utils.go +++ b/pkg/config-api-client/utils.go @@ -3,7 +3,7 @@ Configuration Api Nice description goes here -API version: 5.9.0 +API version: 5.10.0 Contact: support@capenetworks.com */