Skip to content

Commit

Permalink
Merge branch 'main' into ay/feat/acceptance-tests/sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
1riatsila1 authored Nov 11, 2024
2 parents f88b55e + 3fc8aca commit 64690ce
Show file tree
Hide file tree
Showing 127 changed files with 3,476 additions and 437 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
pkg/config-api-client/** linguist-generated=true
docs/** linguist-generated=true
pkg/config-api-client/test/** linguist-generated=false
3 changes: 2 additions & 1 deletion .github/workflows/lint-test-code.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ jobs:
- name: Check Provider docs up to date
run: |
just generate-provider-docs
git diff --exit-code -- docs
git add --all docs
git diff --cached --exit-code -- docs || exit 1
- name: Check Provider docs valid
run: just validate-provider-docs
Expand Down
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Hewlett Packard Enterprise Development LP

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ go_path = $(go env GOPATH)/bin

```
dev_overrides {
"registry.terraform.io/arubauxi/configuration" = "<go_path>"
"registry.terraform.io/arubauxi/hpeuxi" = "<go_path>"
}
```

Example `~/.terraformrc` file
```
provider_installation {
dev_overrides {
"registry.terraform.io/arubauxi/configuration" = "/Users/<user>/go/bin"
"registry.terraform.io/arubauxi/hpeuxi" = "/Users/<user>/go/bin"
}
direct {}
}
Expand Down
3 changes: 0 additions & 3 deletions docs/data-sources/agent.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions docs/data-sources/agent_group_assignment.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions docs/data-sources/service_test.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions docs/data-sources/service_test_group_assignment.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/full-demo/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
uxi = {
source = "registry.terraform.io/arubauxi/configuration"
source = "registry.terraform.io/arubauxi/hpeuxi"
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module github.com/aruba-uxi/terraform-provider-configuration
module github.com/aruba-uxi/terraform-provider-hpeuxi

go 1.21

toolchain go1.22.5

require (
github.com/aruba-uxi/terraform-provider-configuration-api/pkg/config-api-client v0.0.0-00010101000000-000000000000
github.com/aruba-uxi/terraform-provider-hpeuxi/pkg/config-api-client v0.0.0-00010101000000-000000000000
github.com/h2non/gock v1.2.0
github.com/hashicorp/terraform-plugin-framework v1.10.0
github.com/hashicorp/terraform-plugin-go v0.23.0
Expand Down Expand Up @@ -68,4 +68,4 @@ require (
google.golang.org/protobuf v1.34.0 // indirect
)

replace github.com/aruba-uxi/terraform-provider-configuration-api/pkg/config-api-client => ./pkg/config-api-client
replace github.com/aruba-uxi/terraform-provider-hpeuxi/pkg/config-api-client => ./pkg/config-api-client
33 changes: 11 additions & 22 deletions internal/provider/datasources/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package datasources
import (
"context"

config_api_client "github.com/aruba-uxi/terraform-provider-configuration-api/pkg/config-api-client"
"github.com/aruba-uxi/terraform-provider-configuration/internal/provider/util"
"github.com/aruba-uxi/terraform-provider-hpeuxi/internal/provider/util"
config_api_client "github.com/aruba-uxi/terraform-provider-hpeuxi/pkg/config-api-client"
"github.com/hashicorp/terraform-plugin-framework/datasource"
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
"github.com/hashicorp/terraform-plugin-framework/types"
Expand All @@ -24,17 +24,14 @@ type agentDataSource struct {
}

type agentDataSourceModel struct {
Id types.String `tfsdk:"id"`
Serial types.String `tfsdk:"serial"`
Name types.String `tfsdk:"name"`
ModelNumber types.String `tfsdk:"model_number"`
WifiMacAddress types.String `tfsdk:"wifi_mac_address"`
EthernetMacAddress types.String `tfsdk:"ethernet_mac_address"`
AddressNote types.String `tfsdk:"address_note"`
Longitude types.Float32 `tfsdk:"longitude"`
Latitude types.Float32 `tfsdk:"latitude"`
Notes types.String `tfsdk:"notes"`
PcapMode types.String `tfsdk:"pcap_mode"`
Id types.String `tfsdk:"id"`
Serial types.String `tfsdk:"serial"`
Name types.String `tfsdk:"name"`
ModelNumber types.String `tfsdk:"model_number"`
WifiMacAddress types.String `tfsdk:"wifi_mac_address"`
EthernetMacAddress types.String `tfsdk:"ethernet_mac_address"`
Notes types.String `tfsdk:"notes"`
PcapMode types.String `tfsdk:"pcap_mode"`
Filter struct {
AgentID types.String `tfsdk:"agent_id"`
} `tfsdk:"filter"`
Expand Down Expand Up @@ -73,15 +70,6 @@ func (d *agentDataSource) Schema(
"ethernet_mac_address": schema.StringAttribute{
Computed: true,
},
"address_note": schema.StringAttribute{
Computed: true,
},
"longitude": schema.Float32Attribute{
Computed: true,
},
"latitude": schema.Float32Attribute{
Computed: true,
},
"notes": schema.StringAttribute{
Computed: true,
},
Expand Down Expand Up @@ -137,6 +125,7 @@ func (d *agentDataSource) Read(

state.Id = types.StringValue(agent.Id)
state.Name = types.StringValue(agent.Name)
state.Serial = types.StringValue(agent.Serial)
state.ModelNumber = types.StringPointerValue(agent.ModelNumber.Get())
state.WifiMacAddress = types.StringPointerValue(agent.WifiMacAddress.Get())
state.EthernetMacAddress = types.StringPointerValue(agent.EthernetMacAddress.Get())
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/datasources/agent_group_assignment.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package datasources
import (
"context"

config_api_client "github.com/aruba-uxi/terraform-provider-configuration-api/pkg/config-api-client"
"github.com/aruba-uxi/terraform-provider-configuration/internal/provider/util"
"github.com/aruba-uxi/terraform-provider-hpeuxi/internal/provider/util"
config_api_client "github.com/aruba-uxi/terraform-provider-hpeuxi/pkg/config-api-client"
"github.com/hashicorp/terraform-plugin-framework/datasource"
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
"github.com/hashicorp/terraform-plugin-framework/types"
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/datasources/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package datasources
import (
"context"

config_api_client "github.com/aruba-uxi/terraform-provider-configuration-api/pkg/config-api-client"
"github.com/aruba-uxi/terraform-provider-configuration/internal/provider/util"
"github.com/aruba-uxi/terraform-provider-hpeuxi/internal/provider/util"
config_api_client "github.com/aruba-uxi/terraform-provider-hpeuxi/pkg/config-api-client"
"github.com/hashicorp/terraform-plugin-framework/datasource"
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
"github.com/hashicorp/terraform-plugin-framework/types"
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/datasources/network_group_assignment.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package datasources
import (
"context"

config_api_client "github.com/aruba-uxi/terraform-provider-configuration-api/pkg/config-api-client"
"github.com/aruba-uxi/terraform-provider-configuration/internal/provider/util"
"github.com/aruba-uxi/terraform-provider-hpeuxi/internal/provider/util"
config_api_client "github.com/aruba-uxi/terraform-provider-hpeuxi/pkg/config-api-client"
"github.com/hashicorp/terraform-plugin-framework/datasource"
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
"github.com/hashicorp/terraform-plugin-framework/types"
Expand Down
5 changes: 3 additions & 2 deletions internal/provider/datasources/sensor.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package datasources
import (
"context"

config_api_client "github.com/aruba-uxi/terraform-provider-configuration-api/pkg/config-api-client"
"github.com/aruba-uxi/terraform-provider-configuration/internal/provider/util"
"github.com/aruba-uxi/terraform-provider-hpeuxi/internal/provider/util"
config_api_client "github.com/aruba-uxi/terraform-provider-hpeuxi/pkg/config-api-client"
"github.com/hashicorp/terraform-plugin-framework/datasource"
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
"github.com/hashicorp/terraform-plugin-framework/types"
Expand Down Expand Up @@ -137,6 +137,7 @@ func (d *sensorDataSource) Read(

state.Id = types.StringValue(sensor.Id)
state.Name = types.StringValue(sensor.Name)
state.Serial = types.StringValue(sensor.Serial)
state.ModelNumber = types.StringValue(sensor.ModelNumber)
state.WifiMacAddress = types.StringPointerValue(sensor.WifiMacAddress.Get())
state.EthernetMacAddress = types.StringPointerValue(sensor.EthernetMacAddress.Get())
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/datasources/sensor_group_assignment.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package datasources
import (
"context"

config_api_client "github.com/aruba-uxi/terraform-provider-configuration-api/pkg/config-api-client"
"github.com/aruba-uxi/terraform-provider-configuration/internal/provider/util"
"github.com/aruba-uxi/terraform-provider-hpeuxi/internal/provider/util"
config_api_client "github.com/aruba-uxi/terraform-provider-hpeuxi/pkg/config-api-client"
"github.com/hashicorp/terraform-plugin-framework/datasource"
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
"github.com/hashicorp/terraform-plugin-framework/types"
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/datasources/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package datasources
import (
"context"

config_api_client "github.com/aruba-uxi/terraform-provider-configuration-api/pkg/config-api-client"
"github.com/aruba-uxi/terraform-provider-configuration/internal/provider/util"
"github.com/aruba-uxi/terraform-provider-hpeuxi/internal/provider/util"
config_api_client "github.com/aruba-uxi/terraform-provider-hpeuxi/pkg/config-api-client"
"github.com/hashicorp/terraform-plugin-framework/datasource"
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
"github.com/hashicorp/terraform-plugin-framework/types"
Expand Down
Loading

0 comments on commit 64690ce

Please sign in to comment.