Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module terraform-provider-delphix
go 1.17

require (
github.com/delphix/dct-sdk-go v1.2.0
github.com/delphix/dct-sdk-go v1.6.0
github.com/hashicorp/terraform-plugin-sdk v1.17.2
)

Expand Down Expand Up @@ -46,7 +46,6 @@ require (
github.com/vmihailenco/tagparser v0.1.1 // indirect
github.com/zclconf/go-cty v1.10.0 // indirect
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e // indirect
golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 // indirect
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d // indirect
Expand Down
16 changes: 10 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/delphix/dct-sdk-go v1.2.0 h1:/YM+CjuXv1cx3xBDYGk1ST3QcAG4EAF5ty96elnnh+M=
github.com/delphix/dct-sdk-go v1.2.0/go.mod h1:jHmLaVSOGroT5E298s7GU3TobaZ8SH0RqUhFo5WkPqo=
github.com/delphix/dct-sdk-go v1.6.0 h1:mlt+fNX7PwF1fnV9W1lbMP+qW1LPb2UBHBrrvCtiOTQ=
github.com/delphix/dct-sdk-go v1.6.0/go.mod h1:7mGbpjf2LNaBuyeblpbUF9K/VPWoym//HZlK5vGo3TI=
github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg=
github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
Expand Down Expand Up @@ -336,13 +336,18 @@ github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI=
Expand Down Expand Up @@ -458,8 +463,6 @@ golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4Iltr
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 h1:+jnHzr9VPj32ykQVai5DNahi9+NSp7yYuCsl5eAQtL0=
golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand Down Expand Up @@ -675,8 +678,9 @@ gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
Expand Down
41 changes: 41 additions & 0 deletions internal/provider/resource_vdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package provider

import (
"context"
"encoding/json"
"net/http"
"time"

Expand Down Expand Up @@ -567,6 +568,14 @@ func resourceVdb() *schema.Resource {
},
},
},
"appdata_source_params": {
Type: schema.TypeString,
Optional: true,
},
"appdata_config_params": {
Type: schema.TypeString,
Optional: true,
},
},
}
}
Expand Down Expand Up @@ -766,6 +775,16 @@ func helper_provision_by_snapshot(ctx context.Context, d *schema.ResourceData, m
if v, has_v := d.GetOk("tags"); has_v {
provisionVDBBySnapshotParameters.SetTags(toTagArray(v))
}
if v, has_v := d.GetOk("appdata_source_params"); has_v {
appdata_source_params := make(map[string]interface{})
json.Unmarshal([]byte(v.(string)), &appdata_source_params)
provisionVDBBySnapshotParameters.SetAppdataSourceParams(appdata_source_params)
}
if v, has_v := d.GetOk("appdata_config_params"); has_v {
appdata_config_params := make(map[string]interface{})
json.Unmarshal([]byte(v.(string)), &appdata_config_params)
provisionVDBBySnapshotParameters.SetAppdataConfigParams(appdata_config_params)
}

req := client.VDBsApi.ProvisionVdbBySnapshot(ctx)

Expand Down Expand Up @@ -963,6 +982,16 @@ func helper_provision_by_timestamp(ctx context.Context, d *schema.ResourceData,
if v, has_v := d.GetOk("tags"); has_v {
provisionVDBByTimestampParameters.SetTags(toTagArray(v))
}
if v, has_v := d.GetOk("appdata_source_params"); has_v {
appdata_source_params := make(map[string]interface{})
json.Unmarshal([]byte(v.(string)), &appdata_source_params)
provisionVDBByTimestampParameters.SetAppdataSourceParams(appdata_source_params)
}
if v, has_v := d.GetOk("appdata_config_params"); has_v {
appdata_config_params := make(map[string]interface{})
json.Unmarshal([]byte(v.(string)), &appdata_config_params)
provisionVDBByTimestampParameters.SetAppdataConfigParams(appdata_config_params)
}

req := client.VDBsApi.ProvisionVdbByTimestamp(ctx)

Expand Down Expand Up @@ -1145,6 +1174,16 @@ func helper_provision_by_bookmark(ctx context.Context, d *schema.ResourceData, m
if v, has_v := d.GetOk("tags"); has_v {
provisionVDBFromBookmarkParameters.SetPostStop(toHookArray(v))
}
if v, has_v := d.GetOk("appdata_source_params"); has_v {
appdata_source_params := make(map[string]interface{})
json.Unmarshal([]byte(v.(string)), &appdata_source_params)
provisionVDBFromBookmarkParameters.SetAppdataSourceParams(appdata_source_params)
}
if v, has_v := d.GetOk("appdata_config_params"); has_v {
appdata_config_params := make(map[string]interface{})
json.Unmarshal([]byte(v.(string)), &appdata_config_params)
provisionVDBFromBookmarkParameters.SetAppdataConfigParams(appdata_config_params)
}

req := client.VDBsApi.ProvisionVdbFromBookmark(ctx)

Expand Down Expand Up @@ -1248,6 +1287,8 @@ func resourceVdbRead(ctx context.Context, d *schema.ResourceData, meta interface
d.Set("parent_id", result.GetParentId())
d.Set("group_name", result.GetGroupName())
d.Set("creation_date", result.GetCreationDate().String())
d.Set("appdata_source_params", result.GetAppdataSourceParams())
d.Set("appdata_config_params", result.GetAppdataConfigParams())
d.Set("id", vdbId)

return diags
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/resource_vdb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ func testAccCheckDctVDBBookmarkConfigBasic() string {
}

//create bookmark
bookmark := dctapi.NewBookmarkWithDefaults()
bookmark := dctapi.NewBookmarkCreateParametersWithDefaults()
bookmark.SetVdbIds([]string{vdb_id})
bookmark.SetName(acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum))

bookmark_req := client.BookmarksApi.CreateBookmark(context.Background()).Bookmark(*bookmark)
bookmark_req := client.BookmarksApi.CreateBookmark(context.Background()).BookmarkCreateParameters(*bookmark)
bk_res, bk_http_res, bk_err := bookmark_req.Execute()

if diags := apiErrorResponseHelper(bk_res, bk_http_res, bk_err); diags != nil {
Expand Down