Skip to content

Commit d91da82

Browse files
authored
feat(iam): add examples and see-alsos (#2475)
1 parent 06c98ce commit d91da82

3 files changed

Lines changed: 33 additions & 7 deletions

File tree

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ require (
1717
github.com/kubernetes-client/go-base v0.0.0-20190205182333-3d0e39759d98
1818
github.com/mattn/go-colorable v0.1.13
1919
github.com/mattn/go-isatty v0.0.16
20-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20220824154746-aa9860649253
20+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20220825105521-d3f8784dcb8b
2121
github.com/spf13/cobra v1.5.0
2222
github.com/spf13/pflag v1.0.5
2323
github.com/stretchr/testify v1.8.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
5858
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
5959
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
6060
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
61-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20220824154746-aa9860649253 h1:OlRfUqKcB4XsahOXTnI4k4RTkrzJastpAAMmXNAkPUc=
62-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20220824154746-aa9860649253/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
61+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20220825105521-d3f8784dcb8b h1:HW6dHxcnYIcRD6ezTnVoFc05usBgDTsd4bCiWKcumYI=
62+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20220825105521-d3f8784dcb8b/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg=
6363
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
6464
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
6565
github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU=

internal/namespaces/iam/v1alpha1/iam_cli.go

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,10 @@ func iamSSHKeyList() *core.Command {
213213
FieldName: "CreatedAt",
214214
},
215215
{
216-
FieldName: "ProjectID",
216+
FieldName: "Fingerprint",
217217
},
218218
{
219-
FieldName: "CreationIP",
219+
FieldName: "ProjectID",
220220
},
221221
{
222222
FieldName: "Disabled",
@@ -805,15 +805,25 @@ func iamGroupCreate() *core.Command {
805805
return api.CreateGroup(request)
806806

807807
},
808+
Examples: []*core.Example{
809+
{
810+
Short: "Create a group",
811+
Raw: `scw iam group create name=foobar`,
812+
},
813+
},
808814
SeeAlsos: []*core.SeeAlso{
809815
{
810-
Command: "scw iam group list",
811-
Short: "List all groups",
816+
Command: "scw iam group add-member",
817+
Short: "Add a group member",
812818
},
813819
{
814820
Command: "scw iam group delete",
815821
Short: "Delete a group",
816822
},
823+
{
824+
Command: "scw iam policy create",
825+
Short: "Create a policy for a group",
826+
},
817827
},
818828
}
819829
}
@@ -973,6 +983,16 @@ func iamGroupRemoveMember() *core.Command {
973983
return api.RemoveGroupMember(request)
974984

975985
},
986+
SeeAlsos: []*core.SeeAlso{
987+
{
988+
Command: "scw iam group remove-member",
989+
Short: "Remove a group member",
990+
},
991+
{
992+
Command: "scw iam group create",
993+
Short: "Create a group",
994+
},
995+
},
976996
}
977997
}
978998

@@ -1195,6 +1215,12 @@ func iamPolicyCreate() *core.Command {
11951215
return api.CreatePolicy(request)
11961216

11971217
},
1218+
Examples: []*core.Example{
1219+
{
1220+
Short: "Add a policy for a group that gives InstanceFullAccess on all projects",
1221+
Raw: `scw iam policy create group-id=11111111-1111-1111-1111-111111111111 rules.0.organization-id=11111111-1111-1111-1111-111111111111 rules.0.permission-set-names.0=InstanceFullAccess`,
1222+
},
1223+
},
11981224
}
11991225
}
12001226

0 commit comments

Comments
 (0)