createAccessPoint method

Future<AccessPointDescription> createAccessPoint({
  1. required String fileSystemId,
  2. String? clientToken,
  3. PosixUser? posixUser,
  4. RootDirectory? rootDirectory,
  5. List<Tag>? tags,
})

Creates an EFS access point. An access point is an application-specific view into an EFS file system that applies an operating system user and group, and a file system path, to any file system request made through the access point. The operating system user and group override any identity information provided by the NFS client. The file system path is exposed as the access point's root directory. Applications using the access point can only access data in its own directory and below. To learn more, see Mounting a File System Using EFS Access Points.

This operation requires permissions for the elasticfilesystem:CreateAccessPoint action.

May throw BadRequest. May throw AccessPointAlreadyExists. May throw IncorrectFileSystemLifeCycleState. May throw InternalServerError. May throw FileSystemNotFound. May throw AccessPointLimitExceeded.

Parameter fileSystemId : The ID of the EFS file system that the access point provides access to.

Parameter clientToken : A string of up to 64 ASCII characters that Amazon EFS uses to ensure idempotent creation.

Parameter posixUser : The operating system user and group applied to all file system requests made using the access point.

Parameter rootDirectory : Specifies the directory on the Amazon EFS file system that the access point exposes as the root directory of your file system to NFS clients using the access point. The clients using the access point can only access the root directory and below. If the RootDirectory > Path specified does not exist, EFS creates it and applies the CreationInfo settings when a client connects to an access point. When specifying a RootDirectory, you need to provide the Path, and the CreationInfo is optional.

Parameter tags : Creates tags associated with the access point. Each tag is a key-value pair.

Implementation

Future<AccessPointDescription> createAccessPoint({
  required String fileSystemId,
  String? clientToken,
  PosixUser? posixUser,
  RootDirectory? rootDirectory,
  List<Tag>? tags,
}) async {
  ArgumentError.checkNotNull(fileSystemId, 'fileSystemId');
  _s.validateStringLength(
    'fileSystemId',
    fileSystemId,
    0,
    128,
    isRequired: true,
  );
  _s.validateStringLength(
    'clientToken',
    clientToken,
    1,
    64,
  );
  final $payload = <String, dynamic>{
    'FileSystemId': fileSystemId,
    'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (posixUser != null) 'PosixUser': posixUser,
    if (rootDirectory != null) 'RootDirectory': rootDirectory,
    if (tags != null) 'Tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/2015-02-01/access-points',
    exceptionFnMap: _exceptionFns,
  );
  return AccessPointDescription.fromJson(response);
}