EFS / Client / create_mount_session
create_mount_session¶
- EFS.Client.create_mount_session(**kwargs)¶
Creates a mount session for an Amazon EFS file system and returns a set of endpoints that you can use to mount the file system. Each endpoint includes an IP address, a port, and a mount token that a client presents when it connects to the endpoint.
To create a mount session, the file system’s lifecycle state must be
available. For more information, see DescribeFileSystems.This operation requires permissions for the
elasticfilesystem:CreateMountSessionaction.See also: AWS API Documentation
Request Syntax
response = client.create_mount_session( FileSystemId='string', PreferredAvailabilityZoneId='string', NetworkOrigin='AWS_NETWORK'|'EXTERNAL_NETWORK' )
- Parameters:
FileSystemId (string) –
[REQUIRED]
The ID of the file system for which to create the mount session.
PreferredAvailabilityZoneId (string) – The ID of the Availability Zone (for example,
use1-az1) in which you prefer the returned endpoints to be located. The Availability Zone must be in the same Amazon Web Services Region as the file system. This preference is best effort: if Amazon EFS can’t provide an endpoint in the preferred Availability Zone, it returns endpoints in another Availability Zone instead of failing the request. If you don’t specify a value, Amazon EFS returns endpoints without an Availability Zone preference.NetworkOrigin (string) – Indicates whether the client connects to the file system from within the Amazon Web Services Cloud (
AWS_NETWORK). External network (EXTERNAL_NETWORK) connections are not supported.
- Return type:
dict
- Returns:
Response Syntax
{ 'FileSystemId': 'string', 'PreferredAvailabilityZoneId': 'string', 'Endpoints': [ { 'AvailabilityZoneId': 'string', 'Ipv4Address': 'string', 'Ipv6Address': 'string', 'Port': 123, 'MountToken': 'string', 'IssuedAt': datetime(2015, 1, 1) }, ] }
Response Structure
(dict) –
The endpoints that you can use to mount the file system, and the file system and Availability Zone that they apply to.
FileSystemId (string) –
The ID of the file system that the mount session applies to.
PreferredAvailabilityZoneId (string) –
The ID of the preferred Availability Zone that was specified in the request, if any. The Availability Zone of an individual endpoint can differ from this value.
Endpoints (list) –
The endpoints that you can use to mount the file system. Each endpoint includes an IP address, a port, and a mount token.
(dict) –
Describes a single endpoint that a client can use to mount an Amazon EFS file system. An endpoint includes the network address, port, and mount token for the connection.
AvailabilityZoneId (string) –
The ID of the Availability Zone in which the endpoint is located.
Ipv4Address (string) –
The IPv4 address to connect to for this endpoint.
Ipv6Address (string) –
The IPv6 address to connect to for this endpoint.
Port (integer) –
The port to connect to for this endpoint.
MountToken (string) –
An opaque token that the client presents when it connects to this endpoint to mount the file system. Treat the mount token as a credential and keep it secret.
IssuedAt (datetime) –
The time at which this endpoint was issued.
Exceptions
EFS.Client.exceptions.BadRequestEFS.Client.exceptions.FileSystemNotFoundEFS.Client.exceptions.IncorrectFileSystemLifeCycleStateEFS.Client.exceptions.InternalServerErrorEFS.Client.exceptions.ThrottlingException