Skip to content

Commit

Permalink
Update to import SDK v0.1.12
Browse files Browse the repository at this point in the history
This version of the SDK supports creation of the Broker API Client.
We've updated the fields returned from the data-source.
  • Loading branch information
eamonnotoole committed Sep 19, 2024
1 parent 7c41e8e commit 4477391
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
# Location 1
provider "hpegl" {
vmaas {
location = var.location_1
location = var.location_1
space_name = var.space_1
}

alias = "location_1"
Expand All @@ -24,7 +25,8 @@ provider "morpheus" {
# Location 2
provider "hpegl" {
vmaas {
location = var.location_2
location = var.location_2
space_name = var.space_2
}

alias = "location_2"
Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/HewlettPackard/hpegl-vmaas-terraform-resources
go 1.21

require (
github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.11
github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.12
github.com/golang/mock v1.6.0
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
github.com/hashicorp/terraform-plugin-docs v0.9.0
Expand All @@ -14,8 +14,6 @@ require (
github.com/tshihad/tftags v0.0.10
)

replace github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk => ../hpegl-vmaas-cmp-go-sdk

require (
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.2.1 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.11 h1:KnXixte97F83KVsqppc5olEjFmCmccIhIPfR0s3gSVw=
github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.11/go.mod h1:UzXizYR6sUVsvDRMcLC2E4eabJsPH/3nM8rlKL2BLSc=
github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.12 h1:AVRTfWXyDYEa5FdTVSDBH2MHw7Fy5X3W4mv89cnAwHc=
github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk v0.1.12/go.mod h1:tsKOAAbEQnpXAzqjcZUGzRiVp9QfRViKoTOdIltIMFI=
github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI=
github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
Expand Down
3 changes: 1 addition & 2 deletions internal/cmp/morpheus_datasource_broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package cmp

import (
"context"

"github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk/pkg/client"
"github.com/HewlettPackard/hpegl-vmaas-terraform-resources/internal/utils"
)
Expand Down Expand Up @@ -35,7 +34,7 @@ func (m *morpheusBroker) Read(ctx context.Context, d *utils.Data, meta interface
return err
}

if err = d.Set("access_token_expires", morpheusDetails.AccessTokenExpires); err != nil {
if err = d.Set("valid_till", morpheusDetails.ValidTill); err != nil {
return err
}

Expand Down
7 changes: 4 additions & 3 deletions internal/resources/data_source_morpheus_token_broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ func MorpheusDetailsBroker() *schema.Resource {
Description: "Morpheus access_token",
Sensitive: true,
},
"access_token_expires": {
"valid_till": {
Type: schema.TypeInt,
Computed: true,
Description: "Unix timestamp of when the access_token expires",
Description: "Unix timestamp of when the access_token expires, in seconds",
Sensitive: false,
},
"url": {
Expand All @@ -36,7 +36,8 @@ func MorpheusDetailsBroker() *schema.Resource {
},
ReadContext: MorpheusDetailsBrokerReadContext,
Description: `The ` + DSMorpheusDataSource + ` data source can be used to get a details of the Morpheus instance
used by VMaaS. The details that can be retrieved are the access_token, access_token_expires and the URL.`,
used by VMaaS. The details that can be retrieved are the access_token, valid_till (the Unix timestamp of
access_token expiration) and the URL of the Morpheus instance.`,
SchemaVersion: 0,
StateUpgraders: nil,
Importer: &schema.ResourceImporter{
Expand Down

0 comments on commit 4477391

Please sign in to comment.