DescribeSharedDirectoriesCommand

Returns the shared directories in your account.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { DirectoryServiceClient, DescribeSharedDirectoriesCommand } from "@aws-sdk/client-directory-service"; // ES Modules import
// const { DirectoryServiceClient, DescribeSharedDirectoriesCommand } = require("@aws-sdk/client-directory-service"); // CommonJS import
const client = new DirectoryServiceClient(config);
const input = { // DescribeSharedDirectoriesRequest
  OwnerDirectoryId: "STRING_VALUE", // required
  SharedDirectoryIds: [ // DirectoryIds
    "STRING_VALUE",
  ],
  NextToken: "STRING_VALUE",
  Limit: Number("int"),
};
const command = new DescribeSharedDirectoriesCommand(input);
const response = await client.send(command);
// { // DescribeSharedDirectoriesResult
//   SharedDirectories: [ // SharedDirectories
//     { // SharedDirectory
//       OwnerAccountId: "STRING_VALUE",
//       OwnerDirectoryId: "STRING_VALUE",
//       ShareMethod: "ORGANIZATIONS" || "HANDSHAKE",
//       SharedAccountId: "STRING_VALUE",
//       SharedDirectoryId: "STRING_VALUE",
//       ShareStatus: "Shared" || "PendingAcceptance" || "Rejected" || "Rejecting" || "RejectFailed" || "Sharing" || "ShareFailed" || "Deleted" || "Deleting",
//       ShareNotes: "STRING_VALUE",
//       CreatedDateTime: new Date("TIMESTAMP"),
//       LastUpdatedDateTime: new Date("TIMESTAMP"),
//     },
//   ],
//   NextToken: "STRING_VALUE",
// };

DescribeSharedDirectoriesCommand Input

Parameter
Type
Description
OwnerDirectoryId
Required
string | undefined

Returns the identifier of the directory in the directory owner account.

Limit
number | undefined

The number of shared directories to return in the response object.

NextToken
string | undefined

The DescribeSharedDirectoriesResult.NextToken value from a previous call to DescribeSharedDirectories. Pass null if this is the first call.

SharedDirectoryIds
string[] | undefined

A list of identifiers of all shared directories in your account.

DescribeSharedDirectoriesCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
NextToken
string | undefined

If not null, token that indicates that more results are available. Pass this value for the NextToken parameter in a subsequent call to DescribeSharedDirectories to retrieve the next set of items.

SharedDirectories
SharedDirectory[] | undefined

A list of all shared directories in your account.

Throws

Name
Fault
Details
ClientException
client

A client exception has occurred.

EntityDoesNotExistException
client

The specified entity could not be found.

InvalidNextTokenException
client

The NextToken value is not valid.

InvalidParameterException
client

One or more parameters are not valid.

ServiceException
server

An exception has occurred in Directory Service.

UnsupportedOperationException
client

The operation is not supported.

DirectoryServiceServiceException
Base exception class for all service exceptions from DirectoryService service.