-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into SPOTAUT-14860-support-acctMgmt-apis
- Loading branch information
Showing
24 changed files
with
440 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
examples/service/organization/user/updatePolicyMapping/main.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package main | ||
|
||
import ( | ||
"context" | ||
"log" | ||
|
||
"github.com/spotinst/spotinst-sdk-go/service/organization" | ||
"github.com/spotinst/spotinst-sdk-go/spotinst" | ||
"github.com/spotinst/spotinst-sdk-go/spotinst/session" | ||
) | ||
|
||
func main() { | ||
// All clients require a Session. The Session provides the client with | ||
// shared configuration such as account and credentials. | ||
// A Session should be shared where possible to take advantage of | ||
// configuration and credential caching. See the session package for | ||
// more information. | ||
sess := session.New() | ||
|
||
// Create a new instance of the service's client with a Session. | ||
// Optional spotinst.Config values can also be provided as variadic | ||
// arguments to the New function. This option allows you to provide | ||
// service specific configuration. | ||
svc := organization.New(sess) | ||
|
||
// Create a new context. | ||
ctx := context.Background() | ||
|
||
// Create a new group. | ||
err := svc.UpdatePolicyMappingOfUser(ctx, &organization.UpdatePolicyMappingOfUserInput{ | ||
UserID: spotinst.String("u-0628514b"), | ||
Policies: []*organization.UserPolicy{ | ||
&organization.UserPolicy{ | ||
PolicyId: spotinst.String("pol-abcd1234"), | ||
AccountIds: []string{ | ||
"act-1234abcd", | ||
}, | ||
}, | ||
&organization.UserPolicy{ | ||
PolicyId: spotinst.String("pol-xyzw1234"), | ||
AccountIds: []string{ | ||
"act-abcd1234", | ||
}, | ||
}, | ||
}, | ||
}) | ||
|
||
if err != nil { | ||
log.Fatalf("spotinst: failed to update policy: %v", err) | ||
} | ||
|
||
} |
41 changes: 41 additions & 0 deletions
41
examples/service/organization/user/updateUserGroupMapping/main.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package main | ||
|
||
import ( | ||
"context" | ||
"log" | ||
|
||
"github.com/spotinst/spotinst-sdk-go/service/organization" | ||
"github.com/spotinst/spotinst-sdk-go/spotinst" | ||
"github.com/spotinst/spotinst-sdk-go/spotinst/session" | ||
) | ||
|
||
func main() { | ||
// All clients require a Session. The Session provides the client with | ||
// shared configuration such as account and credentials. | ||
// A Session should be shared where possible to take advantage of | ||
// configuration and credential caching. See the session package for | ||
// more information. | ||
sess := session.New() | ||
|
||
// Create a new instance of the service's client with a Session. | ||
// Optional spotinst.Config values can also be provided as variadic | ||
// arguments to the New function. This option allows you to provide | ||
// service specific configuration. | ||
svc := organization.New(sess) | ||
|
||
// Create a new context. | ||
ctx := context.Background() | ||
|
||
// Create a new group. | ||
err := svc.UpdateUserGroupMappingOfUser(ctx, &organization.UpdateUserGroupMappingOfUserInput{ | ||
UserID: spotinst.String("u-abcd1234"), | ||
UserGroupIds: []string{ | ||
"ugr-abcd1234", | ||
}, | ||
}) | ||
|
||
if err != nil { | ||
log.Fatalf("spotinst: failed to update policy: %v", err) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.