AWS 文档 AWS SDK示例 GitHub 存储库中还有更多SDK示例
本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
与 AWS SDK或DescribeWorkspaceDirectories
一起使用 CLI
以下代码示例演示如何使用 DescribeWorkspaceDirectories
。
- CLI
-
- AWS CLI
-
描述已注册的目录
以下
describe-workspace-directories
示例描述了指定的注册目录。aws workspaces describe-workspace-directories \ --directory-ids
d-926722edaf
输出:
{ "Directories": [ { "DirectoryId": "d-926722edaf", "Alias": "d-926722edaf", "DirectoryName": "example.com", "RegistrationCode": "WSpdx+9RJ8JT", "SubnetIds": [ "subnet-9d19c4c6", "subnet-500d5819" ], "DnsIpAddresses": [ "172.16.1.140", "172.16.0.30" ], "CustomerUserName": "Administrator", "IamRoleId": "arn:aws:iam::123456789012:role/workspaces_DefaultRole", "DirectoryType": "SIMPLE_AD", "WorkspaceSecurityGroupId": "sg-0d89e927e5645d7c5", "State": "REGISTERED", "WorkspaceCreationProperties": { "EnableWorkDocs": false, "EnableInternetAccess": false, "UserEnabledAsLocalAdministrator": true, "EnableMaintenanceMode": true }, "WorkspaceAccessProperties": { "DeviceTypeWindows": "ALLOW", "DeviceTypeOsx": "ALLOW", "DeviceTypeWeb": "DENY", "DeviceTypeIos": "ALLOW", "DeviceTypeAndroid": "ALLOW", "DeviceTypeChromeOs": "ALLOW", "DeviceTypeZeroClient": "ALLOW", "DeviceTypeLinux": "DENY" }, "Tenancy": "SHARED", "SelfservicePermissions": { "RestartWorkspace": "ENABLED", "IncreaseVolumeSize": "DISABLED", "ChangeComputeType": "DISABLED", "SwitchRunningMode": "DISABLED", "RebuildWorkspace": "DISABLED" } } ] }
有关更多信息,请参阅《Amazon 管理指南》 WorkSpaces中的 WorkSpaces 管理目录。
-
有关API详细信息,请参阅AWS CLI 命令参考DescribeWorkspaceDirectories
中的。
-
- PowerShell
-
- 用于 PowerShell
-
示例 1:此示例列出了已注册目录的目录详细信息
Get-WKSWorkspaceDirectory
输出:
Alias : TestWorkspace CustomerUserName : Administrator DirectoryId : d-123414a369 DirectoryName : TestDirectory.com DirectoryType : MicrosoftAD DnsIpAddresses : {172.31.43.45, 172.31.2.97} IamRoleId : arn:aws:iam::761234567801:role/workspaces_RoleDefault IpGroupIds : {} RegistrationCode : WSpdx+4RRT43 SelfservicePermissions : Amazon.WorkSpaces.Model.SelfservicePermissions State : REGISTERED SubnetIds : {subnet-1m3m7b43, subnet-ard11aba} Tenancy : SHARED WorkspaceAccessProperties : Amazon.WorkSpaces.Model.WorkspaceAccessProperties WorkspaceCreationProperties : Amazon.WorkSpaces.Model.DefaultWorkspaceCreationProperties WorkspaceSecurityGroupId : sg-0ed2441234a123c43
-
有关API详细信息,请参阅 AWS Tools for PowerShell Cmdlet 参考DescribeWorkspaceDirectories中的。
-
DescribeWorkspaceBundles
DescribeWorkspaces