DescribeMountTargetsCommand

Returns the descriptions of all the current mount targets, or a specific mount target, for a file system. When requesting all of the current mount targets, the order of mount targets returned in the response is unspecified.

This operation requires permissions for the elasticfilesystem:DescribeMountTargets action, on either the file system ID that you specify in FileSystemId, or on the file system of the mount target that you specify in MountTargetId.

Example Syntax

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

import { EFSClient, DescribeMountTargetsCommand } from "@aws-sdk/client-efs"; // ES Modules import
// const { EFSClient, DescribeMountTargetsCommand } = require("@aws-sdk/client-efs"); // CommonJS import
const client = new EFSClient(config);
const input = { // DescribeMountTargetsRequest
  MaxItems: Number("int"),
  Marker: "STRING_VALUE",
  FileSystemId: "STRING_VALUE",
  MountTargetId: "STRING_VALUE",
  AccessPointId: "STRING_VALUE",
};
const command = new DescribeMountTargetsCommand(input);
const response = await client.send(command);
// { // DescribeMountTargetsResponse
//   Marker: "STRING_VALUE",
//   MountTargets: [ // MountTargetDescriptions
//     { // MountTargetDescription
//       OwnerId: "STRING_VALUE",
//       MountTargetId: "STRING_VALUE", // required
//       FileSystemId: "STRING_VALUE", // required
//       SubnetId: "STRING_VALUE", // required
//       LifeCycleState: "creating" || "available" || "updating" || "deleting" || "deleted" || "error", // required
//       IpAddress: "STRING_VALUE",
//       NetworkInterfaceId: "STRING_VALUE",
//       AvailabilityZoneId: "STRING_VALUE",
//       AvailabilityZoneName: "STRING_VALUE",
//       VpcId: "STRING_VALUE",
//     },
//   ],
//   NextMarker: "STRING_VALUE",
// };

Example Usage

 Loading code editor

DescribeMountTargetsCommand Input

Parameter
Type
Description
AccessPointId
string | undefined

(Optional) The ID of the access point whose mount targets that you want to list. It must be included in your request if a FileSystemId or MountTargetId is not included in your request. Accepts either an access point ID or ARN as input.

FileSystemId
string | undefined

(Optional) ID of the file system whose mount targets you want to list (String). It must be included in your request if an AccessPointId or MountTargetId is not included. Accepts either a file system ID or ARN as input.

Marker
string | undefined

(Optional) Opaque pagination token returned from a previous DescribeMountTargets operation (String). If present, it specifies to continue the list from where the previous returning call left off.

MaxItems
number | undefined

(Optional) Maximum number of mount targets to return in the response. Currently, this number is automatically set to 10, and other values are ignored. The response is paginated at 100 per page if you have more than 100 mount targets.

MountTargetId
string | undefined

(Optional) ID of the mount target that you want to have described (String). It must be included in your request if FileSystemId is not included. Accepts either a mount target ID or ARN as input.

DescribeMountTargetsCommand Output

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

If the request included the Marker, the response returns that value in this field.

MountTargets
MountTargetDescription[] | undefined

Returns the file system's mount targets as an array of MountTargetDescription objects.

NextMarker
string | undefined

If a value is present, there are more mount targets to return. In a subsequent request, you can provide Marker in your request with this value to retrieve the next set of mount targets.

Throws

Name
Fault
Details
AccessPointNotFound
client

Returned if the specified AccessPointId value doesn't exist in the requester's Amazon Web Services account.

BadRequest
client

Returned if the request is malformed or contains an error such as an invalid parameter value or a missing required parameter.

FileSystemNotFound
client

Returned if the specified FileSystemId value doesn't exist in the requester's Amazon Web Services account.

InternalServerError
server

Returned if an error occurred on the server side.

MountTargetNotFound
client

Returned if there is no mount target with the specified ID found in the caller's Amazon Web Services account.

EFSServiceException
Base exception class for all service exceptions from EFS service.