Skip to content

Commit 06da4d4

Browse files
unit tests for filesystem APIs in itacservices (#57)
* unit tests for filesystem APIs in itacservices Signed-off-by: Rohit Kulkarni <[email protected]> * add unit test coverage to github CI Signed-off-by: Rohit Kulkarni <[email protected]> * change coverage version to v4 Signed-off-by: Rohit Kulkarni <[email protected]> * calculate specific coverage Signed-off-by: Rohit Kulkarni <[email protected]> * add kubernetes API tests Signed-off-by: Rohit Kulkarni <[email protected]> --------- Signed-off-by: Rohit Kulkarni <[email protected]>
1 parent 4ab3500 commit 06da4d4

File tree

10 files changed

+739
-33
lines changed

10 files changed

+739
-33
lines changed

.github/workflows/ci.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,19 @@ jobs:
5454
terraform -chdir="$dir" validate
5555
done
5656
57+
- name: Run unit tests
58+
run: |
59+
go test -v ./pkg/itacservices/tests \
60+
-coverpkg=./pkg/itacservices,./pkg/itacservices/common \
61+
-coverprofile=coverage.out
62+
63+
64+
- name: Upload unit test coverage report
65+
uses: actions/upload-artifact@v4
66+
with:
67+
name: coverage-report
68+
path: coverage.out
69+
5770

5871
# TODO
5972
#- name: Run unit tests

go.mod

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ go 1.23.0
55
toolchain go1.23.7
66

77
require (
8+
github.com/golang/mock v1.6.0
89
github.com/hashicorp/terraform-plugin-docs v0.19.2
910
github.com/hashicorp/terraform-plugin-framework v1.8.0
1011
github.com/hashicorp/terraform-plugin-log v0.9.0
1112
github.com/sethvargo/go-retry v0.2.4
13+
github.com/stretchr/testify v1.8.2
1214
)
1315

1416
require (
@@ -23,6 +25,7 @@ require (
2325
github.com/bgentry/speakeasy v0.1.0 // indirect
2426
github.com/bmatcuk/doublestar/v4 v4.6.1 // indirect
2527
github.com/cloudflare/circl v1.3.7 // indirect
28+
github.com/davecgh/go-spew v1.1.1 // indirect
2629
github.com/fatih/color v1.16.0 // indirect
2730
github.com/golang/protobuf v1.5.4 // indirect
2831
github.com/google/uuid v1.6.0 // indirect
@@ -51,6 +54,7 @@ require (
5154
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
5255
github.com/mitchellh/reflectwalk v1.0.2 // indirect
5356
github.com/oklog/run v1.0.0 // indirect
57+
github.com/pmezard/go-difflib v1.0.0 // indirect
5458
github.com/posener/complete v1.2.3 // indirect
5559
github.com/shopspring/decimal v1.3.1 // indirect
5660
github.com/spf13/cast v1.5.0 // indirect

go.sum

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZt
4646
github.com/go-git/go-git/v5 v5.12.0/go.mod h1:FTM9VKtnI2m65hNI/TenDDDnUf2Q9FHnXYjuz9i5OEY=
4747
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
4848
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
49+
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
50+
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
4951
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
5052
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
5153
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
@@ -152,10 +154,14 @@ github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkU
152154
github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w=
153155
github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU=
154156
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
157+
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
158+
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
155159
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
156160
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
157161
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
162+
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
158163
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
164+
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
159165
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
160166
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
161167
github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8=
@@ -164,6 +170,7 @@ github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAh
164170
github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds=
165171
github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM=
166172
github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw=
173+
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
167174
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
168175
github.com/yuin/goldmark v1.7.1 h1:3bajkSilaCbjdKVsKdZjZCLBNPL9pYzrCakKaf4U49U=
169176
github.com/yuin/goldmark v1.7.1/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E=
@@ -174,29 +181,37 @@ github.com/zclconf/go-cty v1.14.4/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgr
174181
go.abhg.dev/goldmark/frontmatter v0.2.0 h1:P8kPG0YkL12+aYk2yU3xHv4tcXzeVnN+gU0tJ5JnxRw=
175182
go.abhg.dev/goldmark/frontmatter v0.2.0/go.mod h1:XqrEkZuM57djk7zrlRUB02x8I5J0px76YjkOzhB4YlU=
176183
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
184+
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
177185
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
178186
golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
179187
golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34=
180188
golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc=
181189
golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819 h1:EDuYyU/MkFXllv9QF9819VlI9a4tzGuCbhG0ExK9o1U=
182190
golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
191+
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
183192
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
184193
golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA=
185194
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
195+
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
186196
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
187197
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
198+
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
188199
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
189200
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
190201
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
191202
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
192203
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
204+
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
193205
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
194206
golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw=
195207
golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
196208
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
209+
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
197210
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
198211
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
199212
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
213+
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
214+
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
200215
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
201216
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
202217
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -219,10 +234,13 @@ golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
219234
golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
220235
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
221236
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
237+
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
222238
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
223239
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg=
224240
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
225241
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
242+
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
243+
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
226244
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de h1:cZGRis4/ot9uVm639a+rHCUaG0JJHEsdyzSQTMX+suY=
227245
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY=
228246
google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM=
@@ -237,5 +255,6 @@ gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRN
237255
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
238256
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
239257
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
258+
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
240259
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
241260
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

pkg/itacservices/client.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ type IDCServicesClient struct {
2424
Clientid *string
2525
Clientsecret *string
2626
ExpireAt time.Time
27+
APIClient common.APIClient
2728
}
2829

2930
var (

pkg/itacservices/common/httpclient.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ import (
1010
"time"
1111
)
1212

13+
type APIClient interface {
14+
MakeGetAPICall(ctx context.Context, url, token string, headers map[string]string) (int, []byte, error)
15+
MakePOSTAPICall(ctx context.Context, url, token string, payload []byte) (int, []byte, error)
16+
MakePutAPICall(ctx context.Context, url, token string, payload []byte) (int, []byte, error)
17+
MakeDeleteAPICall(ctx context.Context, url, token string, headers map[string]string) (int, []byte, error)
18+
GenerateFilesystemLoginCredentials(ctx context.Context, resourceId string) (*string, error)
19+
ParseString(tmpl string, data any) (string, error)
20+
}
21+
1322
// MakeGetAPICall :
1423
func MakeGetAPICall(ctx context.Context, connURL, auth string, payload []byte) (int, []byte, error) {
1524

pkg/itacservices/filesystems.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,12 @@ func (client *IDCServicesClient) GetFilesystems(ctx context.Context) (*Filesyste
103103
}
104104

105105
// Parse the template string with the provided data
106-
parsedURL, err := common.ParseString(getAllFilesystemsURL, params)
106+
parsedURL, err := client.APIClient.ParseString(getAllFilesystemsURL, params)
107107
if err != nil {
108108
return nil, fmt.Errorf("error parsing the url")
109109
}
110110

111-
retcode, retval, err := common.MakeGetAPICall(ctx, parsedURL, *client.Apitoken, nil)
111+
retcode, retval, err := client.APIClient.MakeGetAPICall(ctx, parsedURL, *client.Apitoken, nil)
112112
tflog.Debug(ctx, "filesystem read api", map[string]any{"retcode": retcode, "retval": string(retval)})
113113
if err != nil {
114114
return nil, fmt.Errorf("error reading filesystems")
@@ -151,12 +151,12 @@ func (client *IDCServicesClient) GenerateFilesystemLoginCredentials(ctx context.
151151
ResourceId: resourceId,
152152
}
153153
// Parse the template string with the provided data
154-
parsedURL, err := common.ParseString(getLoginCredentials, getLoginParams)
154+
parsedURL, err := client.APIClient.ParseString(getLoginCredentials, getLoginParams)
155155
if err != nil {
156156
return nil, fmt.Errorf("error parsing the url")
157157
}
158158

159-
retcode, retval, err := common.MakeGetAPICall(ctx, parsedURL, *client.Apitoken, nil)
159+
retcode, retval, err := client.APIClient.MakeGetAPICall(ctx, parsedURL, *client.Apitoken, nil)
160160
if err != nil {
161161
return nil, fmt.Errorf("error generating login credentials")
162162
}
@@ -180,7 +180,7 @@ func (client *IDCServicesClient) CreateFilesystem(ctx context.Context, in *Files
180180
}
181181

182182
// Parse the template string with the provided data
183-
parsedURL, err := common.ParseString(createFilesystemsURL, params)
183+
parsedURL, err := client.APIClient.ParseString(createFilesystemsURL, params)
184184
if err != nil {
185185
return nil, fmt.Errorf("error parsing the url")
186186
}
@@ -191,7 +191,7 @@ func (client *IDCServicesClient) CreateFilesystem(ctx context.Context, in *Files
191191
}
192192

193193
tflog.Debug(ctx, "filesystem create api", map[string]any{"url": parsedURL, "inArgs": string(inArgs)})
194-
retcode, retval, err := common.MakePOSTAPICall(ctx, parsedURL, *client.Apitoken, inArgs)
194+
retcode, retval, err := client.APIClient.MakePOSTAPICall(ctx, parsedURL, *client.Apitoken, inArgs)
195195
tflog.Debug(ctx, "filesystem create api", map[string]any{"retcode": retcode, "retval": string(retval)})
196196
if err != nil {
197197
return nil, fmt.Errorf("error reading filesystem create response")
@@ -248,12 +248,12 @@ func (client *IDCServicesClient) GetFilesystemByResourceId(ctx context.Context,
248248
}
249249

250250
// Parse the template string with the provided data
251-
parsedURL, err := common.ParseString(getFilesystemByResourceId, params)
251+
parsedURL, err := client.APIClient.ParseString(getFilesystemByResourceId, params)
252252
if err != nil {
253253
return nil, fmt.Errorf("error parsing the url")
254254
}
255255

256-
retcode, retval, err := common.MakeGetAPICall(ctx, parsedURL, *client.Apitoken, nil)
256+
retcode, retval, err := client.APIClient.MakeGetAPICall(ctx, parsedURL, *client.Apitoken, nil)
257257
if err != nil {
258258
return nil, fmt.Errorf("error reading filesystem by resource id")
259259
}
@@ -282,12 +282,12 @@ func (client *IDCServicesClient) DeleteFilesystemByResourceId(ctx context.Contex
282282
}
283283

284284
// Parse the template string with the provided data
285-
parsedURL, err := common.ParseString(deleteFilesystemByResourceId, params)
285+
parsedURL, err := client.APIClient.ParseString(deleteFilesystemByResourceId, params)
286286
if err != nil {
287287
return fmt.Errorf("error parsing the url")
288288
}
289289

290-
retcode, retval, err := common.MakeDeleteAPICall(ctx, parsedURL, *client.Apitoken, nil)
290+
retcode, retval, err := client.APIClient.MakeDeleteAPICall(ctx, parsedURL, *client.Apitoken, nil)
291291
if err != nil {
292292
return fmt.Errorf("error deleting filesystem by resource id")
293293
}
@@ -315,7 +315,7 @@ func (client *IDCServicesClient) UpdateFilesystem(ctx context.Context, in *Files
315315
}
316316

317317
// Parse the template string with the provided data
318-
parsedURL, err := common.ParseString(updateFilesystemByName, params)
318+
parsedURL, err := client.APIClient.ParseString(updateFilesystemByName, params)
319319
if err != nil {
320320
return fmt.Errorf("error parsing the url")
321321
}
@@ -329,7 +329,7 @@ func (client *IDCServicesClient) UpdateFilesystem(ctx context.Context, in *Files
329329
}
330330
tflog.Debug(ctx, "filesystem update api", map[string]any{"url": parsedURL, "payload byte": paramsByte})
331331

332-
retcode, retval, err := common.MakePutAPICall(ctx, parsedURL, *client.Apitoken, paramsByte)
332+
retcode, retval, err := client.APIClient.MakePutAPICall(ctx, parsedURL, *client.Apitoken, paramsByte)
333333
if err != nil {
334334
return fmt.Errorf("error updating filesystem by name")
335335
}

0 commit comments

Comments
 (0)