admin (directory_v1)
PREREQUISITE: Read ../gws-shared/SKILL.md for auth, global flags, and security rules. If missing, run gws generate-skills to create it.
CODEBLOCK0
API Resources
asps
- delete — Deletes an ASP issued by a user.
- get — Gets information about an ASP issued by a user.
- list — Lists the ASPs issued by a user.
channels
- stop — Stops watching resources through this channel.
chromeosdevices
- action — Use BatchChangeChromeOsDeviceStatus instead. Takes an action that affects a Chrome OS Device. This includes deprovisioning, disabling, and re-enabling devices. Warning: * Deprovisioning a device will stop device policy syncing and remove device-level printers. After a device is deprovisioned, it must be wiped before it can be re-enrolled.
- get — Retrieves a Chrome OS device's properties.
- list — Retrieves a paginated list of Chrome OS devices within an account.
- moveDevicesToOu — Moves or inserts multiple Chrome OS devices to an organizational unit. You can move up to 50 devices at once.
- patch — Updates a device's updatable properties, such as annotatedUser, annotatedLocation, notes, orgUnitPath, or annotatedAssetId. This method supports patch semantics.
- update — Updates a device's updatable properties, such as annotatedUser, annotatedLocation, notes, orgUnitPath, or annotatedAssetId.
customer
- devices — Operations on the 'devices' resource
customers
- get — Retrieves a customer.
- patch — Patches a customer.
- update — Updates a customer.
- chrome — Operations on the 'chrome' resource
domainAliases
- delete — Deletes a domain Alias of the customer.
- get — Retrieves a domain alias of the customer.
- insert — Inserts a domain alias of the customer.
- list — Lists the domain aliases of the customer.
domains
- delete — Deletes a domain of the customer.
- get — Retrieves a domain of the customer.
- insert — Inserts a domain of the customer.
- list — Lists the domains of the customer.
groups
- delete — Deletes a group.
- get — Retrieves a group's properties.
- insert — Creates a group.
- list — Retrieves all groups of a domain or of a user given a userKey (paginated).
- patch — Updates a group's properties. This method supports patch semantics.
- update — Updates a group's properties.
- aliases — Operations on the 'aliases' resource
members
- delete — Removes a member from a group.
- get — Retrieves a group member's properties.
- hasMember — Checks whether the given user is a member of the group. Membership can be direct or nested, but if nested, the memberKey and groupKey must be entities in the same domain or an Invalid input error is returned. To check for nested memberships that include entities outside of the group's domain, use the checkTransitiveMembership() method in the Cloud Identity Groups API.
- insert — Adds a user to the specified group.
- list — Retrieves a paginated list of all members in a group. This method times out after 60 minutes. For more information, see Troubleshoot error codes.
- patch — Updates the membership properties of a user in the specified group. This method supports patch semantics.
- update — Updates the membership of a user in the specified group.
mobiledevices
- action — Takes an action that affects a mobile device. For example, remotely wiping a device.
- delete — Removes a mobile device.
- get — Retrieves a mobile device's properties.
- list — Retrieves a paginated list of all user-owned mobile devices for an account. To retrieve a list that includes company-owned devices, use the Cloud Identity Devices API instead. This method times out after 60 minutes. For more information, see Troubleshoot error codes.
orgunits
- delete — Removes an organizational unit.
- get — Retrieves an organizational unit.
- insert — Adds an organizational unit.
- list — Retrieves a list of all organizational units for an account.
- patch — Updates an organizational unit. This method supports patch semantics
- update — Updates an organizational unit.
privileges
- list — Retrieves a paginated list of all privileges for a customer.
resources
- buildings — Operations on the 'buildings' resource
- calendars — Operations on the 'calendars' resource
- features — Operations on the 'features' resource
roleAssignments
- delete — Deletes a role assignment.
- get — Retrieves a role assignment.
- insert — Creates a role assignment.
- list — Retrieves a paginated list of all roleAssignments.
roles
- delete — Deletes a role.
- get — Retrieves a role.
- insert — Creates a role.
- list — Retrieves a paginated list of all the roles in a domain.
- patch — Patches a role.
- update — Updates a role.
schemas
- delete — Deletes a schema.
- get — Retrieves a schema.
- insert — Creates a schema.
- list — Retrieves all schemas for a customer.
- patch — Patches a schema.
- update — Updates a schema.
tokens
- delete — Deletes all access tokens issued by a user for an application.
- get — Gets information about an access token issued by a user.
- list — Returns the set of tokens specified user has issued to 3rd party applications.
twoStepVerification
- turnOff — Turns off 2-Step Verification for user.
users
- createGuest — Create a guest user with access to a subset of Workspace capabilities. This feature is currently in Alpha. Please reach out to support if you are interested in trying this feature.
- delete — Deletes a user.
- get — Retrieves a user.
- insert — Creates a user. Mutate calls immediately following user creation might sometimes fail as the user isn't fully created due to propagation delay in our backends. Check the error details for the "User creation is not complete" message to see if this is the case. Retrying the calls after some time can help in this case. If resolveConflictAccount is set to true, a 202 response code means that a conflicting unmanaged account exists and was invited to join the organization.
- list — Retrieves a paginated list of either deleted users or all users in a domain.
- makeAdmin — Makes a user a super administrator.
- patch — Updates a user using patch semantics. The update method should be used instead, because it also supports patch semantics and has better performance. If you're mapping an external identity to a Google identity, use the update method instead of the patch method. This method is unable to clear fields that contain repeated objects (addresses, phones, etc). Use the update method instead.
- signOut — Signs a user out of all web and device sessions and reset their sign-in cookies. User will have to sign in by authenticating again.
- undelete — Undeletes a deleted user.
- update — Updates a user. This method supports patch semantics, meaning that you only need to include the fields you wish to update. Fields that are not present in the request will be preserved, and fields set to null will be cleared. For repeating fields that contain arrays, individual items in the array can't be patched piecemeal; they must be supplied in the request body with the desired values for all items.
- watch — Watches for changes in users list.
- aliases — Operations on the 'aliases' resource
- photos — Operations on the 'photos' resource
verificationCodes
- generate — Generates new backup verification codes for the user.
- invalidate — Invalidates the current backup verification codes for the user.
- list — Returns the current set of valid backup verification codes for the specified user.
Discovering Commands
Before calling any API method, inspect it:
CODEBLOCK1
Use gws schema output to build your --params and --json flags.
admin (directory_v1)
前置条件: 请先阅读 ../gws-shared/SKILL.md 了解认证、全局标志和安全规则。如果该文件缺失,请运行 gws generate-skills 创建。
bash
gws admin [flags]
API 资源
asps
- delete — 删除用户颁发的 ASP。
- get — 获取用户颁发的 ASP 信息。
- list — 列出用户颁发的 ASP。
channels
- stop — 停止通过此频道监控资源。
chromeosdevices
- action — 请改用 BatchChangeChromeOsDeviceStatus。对 Chrome OS 设备执行操作,包括取消配置、禁用和重新启用设备。警告: 取消配置设备将停止设备策略同步并移除设备级打印机。设备取消配置后,必须擦除才能重新注册。
- get — 检索 Chrome OS 设备的属性。
- list — 检索账户内 Chrome OS 设备的分页列表。
- moveDevicesToOu — 将多个 Chrome OS 设备移动或插入到组织单位。一次最多可移动 50 台设备。
- patch — 更新设备的可更新属性,如 annotatedUser、annotatedLocation、notes、orgUnitPath 或 annotatedAssetId。此方法支持 patch 语义。
- update — 更新设备的可更新属性,如 annotatedUser、annotatedLocation、notes、orgUnitPath 或 annotatedAssetId。
customer
- devices — 对 devices 资源的操作
customers
- get — 检索客户。
- patch — 修补客户。
- update — 更新客户。
- chrome — 对 chrome 资源的操作
domainAliases
- delete — 删除客户的域名别名。
- get — 检索客户的域名别名。
- insert — 插入客户的域名别名。
- list — 列出客户的域名别名。
domains
- delete — 删除客户的域名。
- get — 检索客户的域名。
- insert — 插入客户的域名。
- list — 列出客户的域名。
groups
- delete — 删除群组。
- get — 检索群组的属性。
- insert — 创建群组。
- list — 检索域名下或指定用户(通过 userKey)的所有群组(分页)。
- patch — 更新群组的属性。此方法支持 patch 语义。
- update — 更新群组的属性。
- aliases — 对 aliases 资源的操作
members
- delete — 从群组中移除成员。
- get — 检索群组成员的属性。
- hasMember — 检查指定用户是否为群组成员。成员关系可以是直接或嵌套的,但如果为嵌套,memberKey 和 groupKey 必须属于同一域名,否则将返回 Invalid input 错误。要检查包含群组域名外部实体的嵌套成员关系,请使用 Cloud Identity Groups API 中的 checkTransitiveMembership() 方法。
- insert — 将用户添加到指定群组。
- list — 检索群组中所有成员的分页列表。此方法超时时间为 60 分钟。更多信息请参阅排查错误代码。
- patch — 更新指定群组中用户的成员属性。此方法支持 patch 语义。
- update — 更新指定群组中用户的成员关系。
mobiledevices
- action — 对移动设备执行操作,例如远程擦除设备。
- delete — 移除移动设备。
- get — 检索移动设备的属性。
- list — 检索账户中所有用户拥有的移动设备的分页列表。要检索包含公司拥有的设备的列表,请改用 Cloud Identity Devices API。此方法超时时间为 60 分钟。更多信息请参阅排查错误代码。
orgunits
- delete — 移除组织单位。
- get — 检索组织单位。
- insert — 添加组织单位。
- list — 检索账户中所有组织单位的列表。
- patch — 更新组织单位。此方法支持 patch 语义
- update — 更新组织单位。
privileges
- list — 检索客户所有权限的分页列表。
resources
- buildings — 对 buildings 资源的操作
- calendars — 对 calendars 资源的操作
- features — 对 features 资源的操作
roleAssignments
- delete — 删除角色分配。
- get — 检索角色分配。
- insert — 创建角色分配。
- list — 检索所有角色分配的分页列表。
roles
- delete — 删除角色。
- get — 检索角色。
- insert — 创建角色。
- list — 检索域名中所有角色的分页列表。
- patch — 修补角色。
- update — 更新角色。
schemas
- delete — 删除架构。
- get — 检索架构。
- insert — 创建架构。
- list — 检索客户的所有架构。
- patch — 修补架构。
- update — 更新架构。
tokens
- delete — 删除用户为应用程序颁发的所有访问令牌。
- get — 获取用户颁发的访问令牌信息。
- list — 返回指定用户向第三方应用程序颁发的令牌集合。
twoStepVerification
- turnOff — 关闭用户的双重验证。
users
- createGuest — 创建具有访问部分 Workspace 功能权限的访客用户。此功能目前处于 Alpha 阶段。如果您有兴趣尝试此功能,请联系支持。
- delete — 删除用户。
- get — 检索用户。
- insert — 创建用户。由于后端传播延迟,用户创建后立即进行的变更调用有时可能会失败。检查错误详情中是否包含用户创建未完成消息以确认是否为这种情况。在这种情况下,稍后重试调用可能会有所帮助。如果 resolveConflictAccount 设置为 true,则 202 响应代码表示存在冲突的未管理账户,并已邀请其加入组织。
- list — 检索已删除用户或域名中所有用户的分页列表。
- makeAdmin — 将用户设为超级管理员。
- patch — 使用 patch 语义更新用户。应改用 update 方法,因为它也支持 patch 语义且性能更好。如果要将外部身份映射到 Google 身份,请使用 update 方法而非 patch 方法。此方法无法清除包含重复对象(addresses、phones 等)的字段。请改用 update 方法。
- signOut — 将用户从所有 Web 和设备会话中登出,并重置其登录 Cookie。用户需要重新进行身份验证才能登录。
- undelete — 恢复已删除的用户。
- update — 更新用户。此方法支持 patch 语义,即只需包含要更新的字段。请求中未出现的字段将保持不变,设置为 null 的字段将被清除。对于包含数组的重复字段,数组中的单个项目无法逐项修补;必须在请求体中提供所有项目的期望值。
- watch — 监控用户列表