8000 Adds documentation for groups.create_AD_group (#771) · tableau/server-client-python@f3bb202 · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit f3bb202

Browse files
author
Chris Shin
authored
Adds documentation for groups.create_AD_group (#771)
1 parent 30055ea commit f3bb202

File tree

1 file changed

+57
-2
lines changed

1 file changed

+57
-2
lines changed

docs/api-ref.md

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,8 @@ Name | Description
812812
`id` | The id of the group.
813813
`users` | The list of users (`UserItem`).
814814
`name` | The name of the group. The `name` is required when you create an instance of a group.
815-
815+
`minimum_site_role` | The role to grant users that are added to the group.
816+
`license_mode` | The mode defining when to apply licenses for group members. When the mode is `onLogin`, a license is granted for each group member when they login to a site. When the mode is `onSync`, a license is granted for group members each time the domain is synced.
816817

817818

818819
**Example**
@@ -893,7 +894,7 @@ None.
893894
create(group_item)
894895
```
895896

896-
Creates a new group in Tableau Server.
897+
Creates a new local group in Tableau Server.
897898

898899

899900
REST API: [Create Group](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref.htm#create_group)
@@ -925,6 +926,7 @@ Adds new `GroupItem`.
925926

926927
# create a new instance with the group name
927928
newgroup = TSC.GroupItem('My Group')
929+
newgroup.minimum_site_role = TSC.UserItem.Roles.ExplorerCanPublish
928930

929931
# call the create method
930932
newgroup = server.groups.create(newgroup)
@@ -938,6 +940,59 @@ Adds new `GroupItem`.
938940
<br>
939941
<br>
940942

943+
#### groups.create_AD_group
944+
945+
```py
946+
create_AD_group(group_item, asJob=False)
947+
```
948+
949+
Creates an active directory group in Tableau Server.
950+
951+
952+
REST API: [Create Group](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref.htm#create_group)
953+
954+
955+
**Parameters**
956+
957+
Name | Description
958+
:--- | :---
959+
`group_item` | The `group_item` specifies the group to add. You first create a new instance of a `GroupItem` and pass that to this method.
960+
`asJob` | Boolean flag used to specify an asynchronous operation. If set to `True`, the return value will be a JobItem containing the status of the queued job. See [JobItem class](#jobitem-class).
961+
962+
963+
964+
965+
**Returns**
966+
Returns the created `GroupItem` or a `JobItem` if asJob flag was set to True.
967+
968+
969+
**Example**
970+
971+
```py
972+
973+
# Create a new group
974+
975+
# import tableauserverclient as TSC
976+
# tableau_auth = TSC.TableauAuth('USERNAME', 'PASSWORD')
977+
# server = TSC.Server('https://SERVERURL')
978+
979+
980+
# create a new instance with the group name
981+
newgroup = TSC.GroupItem('AD_Group_Name', 'AD_Domain_Name')
982+
newgroup.minimum_site_role = TSC.UserItem.Roles.SiteAdministratorExplorer
983+
newgroup.license_mode = TSC.GroupItem.LicenseMode.onSync
984+
985+
# call the create method
986+
newgroup = server.groups.create_AD_group(newgroup)
987+
988+
# call the create method asynchronously
989+
newgroup_job = server.groups.create_AD_group(newgroup, asJob=True)
990+
991+
```
992+
993+
<br>
994+
<br>
995+
941996
#### groups.delete
942997

943998
```py

0 commit comments

Comments
 (0)
0