File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import os
2+
3+ from staxapp .config import Config
4+ from staxapp .openapi import StaxClient
5+
6+ Config .access_key = os .getenv ("STAX_ACCESS_KEY" )
7+ Config .secret_key = os .getenv ("STAX_SECRET_KEY" )
8+
9+ # The name of the group you're creating
10+ group_name = < Group Name >
11+
12+ # Create a Stax groups
13+ teams = StaxClient ("teams" )
14+ response = teams .CreateGroup (
15+ Name = group_name
16+ )
17+ print (response )
Original file line number Diff line number Diff line change 1+ import os
2+
3+ from staxapp .config import Config
4+ from staxapp .openapi import StaxClient
5+
6+ Config .access_key = os .getenv ("STAX_ACCESS_KEY" )
7+ Config .secret_key = os .getenv ("STAX_SECRET_KEY" )
8+
9+ # Id of the group to delete
10+ group_id = < Group Id >
11+
12+ # Create a Stax groups
13+ teams = StaxClient ("teams" )
14+ response = teams .DeleteGroup (
15+ group_id = group_id
16+ )
17+ print (response )
Original file line number Diff line number Diff line change 1+ import os
2+
3+ from staxapp .config import Config
4+ from staxapp .openapi import StaxClient
5+
6+ Config .access_key = os .getenv ("STAX_ACCESS_KEY" )
7+ Config .secret_key = os .getenv ("STAX_SECRET_KEY" )
8+
9+ # Id of the group to update
10+ group_id = < Group Id >
11+
12+ # Name to rename the group
13+ group_name = < Group Name >
14+
15+ # Create a Stax groups
16+ teams = StaxClient ("teams" )
17+ response = teams .UpdateGroup (
18+ group_id = group_id ,
19+ Name = group_name
20+ )
21+ print (response )
Original file line number Diff line number Diff line change 1+ import os
2+
3+ from staxapp .config import Config
4+ from staxapp .openapi import StaxClient
5+
6+ Config .access_key = os .getenv ("STAX_ACCESS_KEY" )
7+ Config .secret_key = os .getenv ("STAX_SECRET_KEY" )
8+
9+ # An array of user memberships dicts to enableor an empty array
10+ # Properties: GroupId(string), UserId(string)
11+ user_membership_to_add = < An array of User Membership ?>
12+
13+ # An array of user memberships dicts to disable or an empty arry
14+ user_membership_to_remove = < An array of User Membership ?>
15+
16+ # Create a Stax groups
17+ teams = StaxClient ("teams" )
18+ response = teams .UpdateGroupMembers (
19+ AddMembers = user_membership_to_add ,
20+ RemoveMembers = user_membership_to_remove
21+ )
22+ print (response )
Original file line number Diff line number Diff line change 1+ import os
2+
3+ from staxapp .config import Config
4+ from staxapp .openapi import StaxClient
5+
6+ Config .access_key = os .getenv ("STAX_ACCESS_KEY" )
7+ Config .secret_key = os .getenv ("STAX_SECRET_KEY" )
8+
9+ policy_name = < Policy Name >
10+
11+ policy_description = < Policy Description >
12+
13+ policy = < Policy Json >
14+
15+ # Create a policy
16+ organisations = StaxClient ("organisations" )
17+ response = organisations .CreatePolicy (
18+ Name = policy_name ,
19+ Description = policy_description ,
20+ Policy = policy
21+ )
22+ print (response )
Original file line number Diff line number Diff line change 1+ import os
2+
3+ from staxapp .config import Config
4+ from staxapp .openapi import StaxClient
5+
6+ Config .access_key = os .getenv ("STAX_ACCESS_KEY" )
7+ Config .secret_key = os .getenv ("STAX_SECRET_KEY" )
8+
9+ policy_id = < Policy Id >
10+
11+ # Delete a policy
12+ organisations = StaxClient ("organisations" )
13+ response = organisations .DeletePolicy (
14+ policy_id = policy_id ,
15+ )
16+ print (response )
Original file line number Diff line number Diff line change 1+ import os
2+
3+ from staxapp .config import Config
4+ from staxapp .openapi import StaxClient
5+
6+ Config .access_key = os .getenv ("STAX_ACCESS_KEY" )
7+ Config .secret_key = os .getenv ("STAX_SECRET_KEY" )
8+
9+ # The policy to be updated
10+ policy_id = < Policy Id >
11+
12+ policy_description = < Policy Description >
13+
14+ policy = < Policy Json >
15+
16+ # Update a policy
17+ organisations = StaxClient ("organisations" )
18+ response = organisations .UpdatePolicy (
19+ policy_id = policy_id ,
20+ Description = policy_description ,
21+ Policy = policy ,
22+ )
23+ print (response )
Original file line number Diff line number Diff line change 1+ import os
2+
3+ from staxapp .config import Config
4+ from staxapp .openapi import StaxClient
5+
6+ Config .access_key = os .getenv ("STAX_ACCESS_KEY" )
7+ Config .secret_key = os .getenv ("STAX_SECRET_KEY" )
8+
9+ # The user's first name
10+ first_name = < User 's first Name >
11+
12+ # The user's second name
13+ last_name = < User 's last Name >
14+
15+ # The email for the user
16+ user_email = < User 's Email >
17+
18+ # Create a Stax User
19+ teams = StaxClient ("teams" )
20+ response = teams .CreateUser (
21+ FirstName = first_name ,
22+ LastName = last_name ,
23+ Email = user_email
24+ )
25+ print (response )
Original file line number Diff line number Diff line change 1+ import os
2+
3+ from staxapp .config import Config
4+ from staxapp .openapi import StaxClient
5+
6+ Config .access_key = os .getenv ("STAX_ACCESS_KEY" )
7+ Config .secret_key = os .getenv ("STAX_SECRET_KEY" )
8+
9+ # The user id that needs a reset
10+ user_id = < User Id >
11+
12+ teams = StaxClient ("teams" )
13+ response = teams .UpdateUserPassword (
14+ user_id = user_id
15+ )
16+ print (response )
Original file line number Diff line number Diff line change 1+ import os
2+
3+ from staxapp .config import Config
4+ from staxapp .openapi import StaxClient
5+
6+ Config .access_key = os .getenv ("STAX_ACCESS_KEY" )
7+ Config .secret_key = os .getenv ("STAX_SECRET_KEY" )
8+
9+ # The user id to resend invite
10+ user_id = < User Id >
11+
12+ # Not required just show how properties are changed
13+ user_role = < New Role >
14+ user_status = < New Status >
15+
16+
17+ # Update a Stax User
18+ teams = StaxClient ("teams" )
19+ response = teams .UpdateUser (
20+ user_id = user_id ,
21+ Role = user_role ,
22+ Status = user_status
23+ )
24+ print (response )
You can’t perform that action at this time.
0 commit comments