Skip to content

Commit f09b075

Browse files
authored
role: Populate Region field API calls (#309)
Populates the new Region field on all of the roleapi calls.
1 parent 4bbcb35 commit f09b075

File tree

6 files changed

+16
-10
lines changed

6 files changed

+16
-10
lines changed

cmd/platform/role/create.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ var createCmd = &cobra.Command{
4242
}
4343

4444
return roleapi.Create(roleapi.CreateParams{
45-
API: ecctl.Get().API,
46-
Role: &r,
45+
API: ecctl.Get().API,
46+
Role: &r,
47+
Region: ecctl.Get().Config.Region,
4748
})
4849
},
4950
}

cmd/platform/role/delete.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ var deleteCmd = &cobra.Command{
3030
PreRunE: cobra.MinimumNArgs(1),
3131
RunE: func(cmd *cobra.Command, args []string) error {
3232
return roleapi.Delete(roleapi.DeleteParams{
33-
API: ecctl.Get().API,
34-
ID: args[0],
33+
API: ecctl.Get().API,
34+
ID: args[0],
35+
Region: ecctl.Get().Config.Region,
3536
})
3637
},
3738
}

cmd/platform/role/list.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ var listCmd = &cobra.Command{
2929
Short: "Lists the existing platform roles",
3030
PreRunE: cobra.NoArgs,
3131
RunE: func(cmd *cobra.Command, args []string) error {
32-
res, err := roleapi.List(roleapi.ListParams{API: ecctl.Get().API})
32+
res, err := roleapi.List(roleapi.ListParams{
33+
API: ecctl.Get().API,
34+
Region: ecctl.Get().Config.Region,
35+
})
3336
if err != nil {
3437
return err
3538
}

cmd/platform/role/show.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ var showCmd = &cobra.Command{
3030
PreRunE: cobra.MinimumNArgs(1),
3131
RunE: func(cmd *cobra.Command, args []string) error {
3232
res, err := roleapi.Show(roleapi.ShowParams{
33-
API: ecctl.Get().API,
34-
ID: args[0],
33+
API: ecctl.Get().API,
34+
ID: args[0],
35+
Region: ecctl.Get().Config.Region,
3536
})
3637
if err != nil {
3738
return err

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.12
44

55
require (
66
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a
7-
github.com/elastic/cloud-sdk-go v1.0.0-beta3.0.20200615012742-6982df8d6b10
7+
github.com/elastic/cloud-sdk-go v1.0.0-beta3.0.20200615055322-c662e41de769
88
github.com/go-openapi/runtime v0.19.15
99
github.com/go-openapi/strfmt v0.19.5
1010
github.com/pkg/errors v0.9.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm
5959
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
6060
github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
6161
github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
62-
github.com/elastic/cloud-sdk-go v1.0.0-beta3.0.20200615012742-6982df8d6b10 h1:FX0SWzcYKYRd/9EbvsPcnzHc2RNJZqitDKOEMYXy8N8=
63-
github.com/elastic/cloud-sdk-go v1.0.0-beta3.0.20200615012742-6982df8d6b10/go.mod h1:+0Q5izB9Upzmolj6Pq4AkTsBwgDbQnNpODp3qFK7erQ=
62+
github.com/elastic/cloud-sdk-go v1.0.0-beta3.0.20200615055322-c662e41de769 h1:XoJx1X8VJQFlgvfeHGqLdWz0NJAEYuZzZixEXu6V3wQ=
63+
github.com/elastic/cloud-sdk-go v1.0.0-beta3.0.20200615055322-c662e41de769/go.mod h1:+0Q5izB9Upzmolj6Pq4AkTsBwgDbQnNpODp3qFK7erQ=
6464
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
6565
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
6666
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=

0 commit comments

Comments
 (0)