Skip to content

Latest commit

 

History

History
109 lines (87 loc) · 2.83 KB

Api.md

File metadata and controls

109 lines (87 loc) · 2.83 KB

ZIO AWS S3 API Overview

All AWS methods are wrapped into a ZIO Task:

  type AwsTask[+A] = RIO[R, A]
  1. Create an async S3 client
  def createClient(region: Region, endpoint: String): AwsTask[S3AsyncClient]
  1. Create S3 bucket with the given name
  def createBucket(buck: String): AwsTask[CreateBucketResponse]
  1. Delete the bucket with the given name
  def delBucket(buck: String): AwsTask[DeleteBucketResponse]
  1. Obtain a list of all buckets owned by the authenticated sender
  def listBuckets: AwsTask[ListBucketsResponse]
  1. List all objects in a Bucket
  def listBucketObjects(buck: String, prefix: String): AwsTask[ListObjectsV2Response]
  1. List all object keys in a Bucket
  def listObjectsKeys(buck: String, prefix: String): AwsTask[List[String]]
  1. Look up for an object. True if present
  def lookupObject(buck: String, prefix: String, key: String): AwsTask[Boolean]
  1. Setup redirection for a single object
def redirectObject(buck: String, prefix: String, key: String, url: String): AwsTask[CopyObjectResponse]
  1. Setup redirection for all objects with a common prefix
def redirectPack(buck: String, prefix: String, url: String): AwsTask[Unit]
  1. Copy object
def copyObject(buck: String, dstPrefix: String, srcKey: String, dstKey: String)
  : AwsTask[CopyObjectResponse]
  1. Put a file with a key into a Bucket
  def putObject(buck: String, key: String, file: String): AwsTask[PutObjectResponse]
  1. Get a file with a key from a Bucket
  def getObject(buck: String, key: String, file: String): AwsTask[GetObjectResponse]
  1. Delete object by key from a Bucket
  def delObject(buck: String, key: String): AwsTask[DeleteObjectResponse]
  1. Delete all objects in the bucket which share the same prefix
  def delAllObjects(buck: String, prefix: String): AwsTask[Unit]
  1. Get current ACL settings
  def getObjectAcl(buck: String, key: String): AwsTask[GetObjectAclResponse]
  1. Put new ACL settings
def putObjectAcl(buck: String, key: String, owner: Owner, grants: JList[Grant])
  : AwsTask[PutObjectAclResponse]
  1. Block all objects with ACL remove permission for a group of objects under the common prefix
  def blockPack(buck: String, prefix: String): AwsTask[Unit]
  1. Unblock all objects with ACL remove permission for a group of objects under the common path
  def unblockPack(buck: String, prefix: String): AwsTask[Unit]
  1. Get ACL for each object in a path
  def getPackAcl(buck: String, prefix: String): AwsTask[List[GetObjectAclResponse]]
  1. Put ACL for each object in a path
def putPackAcl(buck: String, prefix: String, block: Boolean): AwsTask[List[PutObjectAclResponse]]