Copyright | (c) 2017-2023 MinIO Dev Team |
---|---|
License | Apache 2.0 |
Maintainer | MinIO Dev Team <dev@min.io> |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Lower-level API for S3 compatible object stores. Start with Network.Minio
and use this only if needed.
Synopsis
- type Region = Text
- getLocation :: Bucket -> Minio Region
- getService :: Minio [BucketInfo]
- data ListObjectsResult = ListObjectsResult {
- lorHasMore :: Bool
- lorNextToken :: Maybe Text
- lorObjects :: [ObjectInfo]
- lorCPrefixes :: [Text]
- data ListObjectsV1Result = ListObjectsV1Result {
- lorHasMore' :: Bool
- lorNextMarker :: Maybe Text
- lorObjects' :: [ObjectInfo]
- lorCPrefixes' :: [Text]
- listObjects' :: Bucket -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Int -> Minio ListObjectsResult
- listObjectsV1' :: Bucket -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Int -> Minio ListObjectsV1Result
- headBucket :: Bucket -> Minio Bool
- getObject' :: Bucket -> Object -> Query -> [Header] -> Minio GetObjectResponse
- headObject :: Bucket -> Object -> [Header] -> Minio ObjectInfo
- putBucket :: Bucket -> Region -> Minio ()
- type ETag = Text
- maxSinglePutObjectSizeBytes :: Int64
- putObjectSingle' :: Bucket -> Object -> [Header] -> ByteString -> Minio ETag
- putObjectSingle :: Bucket -> Object -> [Header] -> Handle -> Int64 -> Int64 -> Minio ETag
- copyObjectSingle :: Bucket -> Object -> SourceInfo -> [Header] -> Minio (ETag, UTCTime)
- type UploadId = Text
- type PartTuple = (PartNumber, ETag)
- data Payload
- type PartNumber = Int16
- newMultipartUpload :: Bucket -> Object -> [Header] -> Minio UploadId
- putObjectPart :: Bucket -> Object -> UploadId -> PartNumber -> [Header] -> Payload -> Minio PartTuple
- copyObjectPart :: DestinationInfo -> SourceInfo -> UploadId -> PartNumber -> [Header] -> Minio (ETag, UTCTime)
- completeMultipartUpload :: Bucket -> Object -> UploadId -> [PartTuple] -> Minio ETag
- abortMultipartUpload :: Bucket -> Object -> UploadId -> Minio ()
- data ListUploadsResult = ListUploadsResult {
- lurHasMore :: Bool
- lurNextKey :: Maybe Text
- lurNextUpload :: Maybe Text
- lurUploads :: [(Object, UploadId, UTCTime)]
- lurCPrefixes :: [Text]
- listIncompleteUploads' :: Bucket -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Int -> Minio ListUploadsResult
- data ListPartsResult = ListPartsResult {
- lprHasMore :: Bool
- lprNextPart :: Maybe Int
- lprParts :: [ObjectPartInfo]
- listIncompleteParts' :: Bucket -> Object -> UploadId -> Maybe Text -> Maybe Text -> Minio ListPartsResult
- deleteBucket :: Bucket -> Minio ()
- deleteObject :: Bucket -> Object -> Minio ()
- type UrlExpiry = Int
- makePresignedUrl :: UrlExpiry -> Method -> Maybe Bucket -> Maybe Object -> Maybe Region -> Query -> RequestHeaders -> Minio ByteString
- presignedPutObjectUrl :: Bucket -> Object -> UrlExpiry -> RequestHeaders -> Minio ByteString
- presignedGetObjectUrl :: Bucket -> Object -> UrlExpiry -> Query -> RequestHeaders -> Minio ByteString
- presignedHeadObjectUrl :: Bucket -> Object -> UrlExpiry -> RequestHeaders -> Minio ByteString
- data PostPolicyCondition
- ppCondBucket :: Bucket -> PostPolicyCondition
- ppCondContentLengthRange :: Int64 -> Int64 -> PostPolicyCondition
- ppCondContentType :: Text -> PostPolicyCondition
- ppCondKey :: Object -> PostPolicyCondition
- ppCondKeyStartsWith :: Object -> PostPolicyCondition
- ppCondSuccessActionStatus :: Int -> PostPolicyCondition
- data PostPolicy = PostPolicy {}
- data PostPolicyError
- newPostPolicy :: UTCTime -> [PostPolicyCondition] -> Either PostPolicyError PostPolicy
- showPostPolicy :: PostPolicy -> ByteString
- presignedPostPolicy :: PostPolicy -> Minio (ByteString, HashMap Text ByteString)
- getBucketPolicy :: Bucket -> Minio Text
- setBucketPolicy :: Bucket -> Text -> Minio ()
- data Notification = Notification {}
- data NotificationConfig = NotificationConfig {}
- type Arn = Text
- data Event
- newtype Filter = Filter {}
- newtype FilterKey = FilterKey {
- fkKey :: FilterRules
- newtype FilterRules = FilterRules {
- frFilterRules :: [FilterRule]
- data FilterRule = FilterRule {}
- getBucketNotification :: Bucket -> Minio Notification
- putBucketNotification :: Bucket -> Notification -> Minio ()
- removeAllBucketNotification :: Bucket -> Minio ()
Documentation
Listing buckets
getService :: Minio [BucketInfo] Source #
Fetch all buckets from the service.
Listing objects
data ListObjectsResult Source #
Represents result from a listing of objects in a bucket.
ListObjectsResult | |
|
Instances
Show ListObjectsResult Source # | |
Defined in Network.Minio.Data showsPrec :: Int -> ListObjectsResult -> ShowS # show :: ListObjectsResult -> String # showList :: [ListObjectsResult] -> ShowS # | |
Eq ListObjectsResult Source # | |
Defined in Network.Minio.Data (==) :: ListObjectsResult -> ListObjectsResult -> Bool # (/=) :: ListObjectsResult -> ListObjectsResult -> Bool # |
data ListObjectsV1Result Source #
Represents result from a listing of objects version 1 in a bucket.
ListObjectsV1Result | |
|
Instances
Show ListObjectsV1Result Source # | |
Defined in Network.Minio.Data showsPrec :: Int -> ListObjectsV1Result -> ShowS # show :: ListObjectsV1Result -> String # showList :: [ListObjectsV1Result] -> ShowS # | |
Eq ListObjectsV1Result Source # | |
Defined in Network.Minio.Data (==) :: ListObjectsV1Result -> ListObjectsV1Result -> Bool # (/=) :: ListObjectsV1Result -> ListObjectsV1Result -> Bool # |
listObjects' :: Bucket -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Int -> Minio ListObjectsResult Source #
List objects in a bucket matching prefix up to delimiter, starting from nextToken.
listObjectsV1' :: Bucket -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Int -> Minio ListObjectsV1Result Source #
List objects in a bucket matching prefix up to delimiter, starting from nextMarker.
Retrieving buckets
Retrieving objects
getObject' :: Bucket -> Object -> Query -> [Header] -> Minio GetObjectResponse Source #
GET an object from the service and return parsed ObjectInfo and a conduit source for the object content
headObject :: Bucket -> Object -> [Header] -> Minio ObjectInfo Source #
Get metadata of an object.
Creating buckets and objects
maxSinglePutObjectSizeBytes :: Int64 Source #
Single PUT object size.
putObjectSingle' :: Bucket -> Object -> [Header] -> ByteString -> Minio ETag Source #
PUT an object into the service. This function performs a single
PUT object call and uses a strict ByteString as the object
data. putObjectSingle
is preferable as the object data will not
be resident in memory.
putObjectSingle :: Bucket -> Object -> [Header] -> Handle -> Int64 -> Int64 -> Minio ETag Source #
PUT an object into the service. This function performs a single PUT object call, and so can only transfer objects upto 5GiB.
copyObjectSingle :: Bucket -> Object -> SourceInfo -> [Header] -> Minio (ETag, UTCTime) Source #
Performs server-side copy of an object that is upto 5GiB in size. If the object is greater than 5GiB, this function throws the error returned by the server.
Multipart Upload APIs
type PartTuple = (PartNumber, ETag) Source #
A type to represent a part-number and etag.
Represents different kinds of payload that are used with S3 API requests.
type PartNumber = Int16 Source #
A type alias to represent a part-number for multipart upload
newMultipartUpload :: Bucket -> Object -> [Header] -> Minio UploadId Source #
Create a new multipart upload.
putObjectPart :: Bucket -> Object -> UploadId -> PartNumber -> [Header] -> Payload -> Minio PartTuple Source #
PUT a part of an object as part of a multipart upload.
copyObjectPart :: DestinationInfo -> SourceInfo -> UploadId -> PartNumber -> [Header] -> Minio (ETag, UTCTime) Source #
Performs server-side copy of an object or part of an object as an upload part of an ongoing multi-part upload.
completeMultipartUpload :: Bucket -> Object -> UploadId -> [PartTuple] -> Minio ETag Source #
Complete a multipart upload.
data ListUploadsResult Source #
Represents result from a listing of incomplete uploads to a bucket.
ListUploadsResult | |
|
Instances
Show ListUploadsResult Source # | |
Defined in Network.Minio.Data showsPrec :: Int -> ListUploadsResult -> ShowS # show :: ListUploadsResult -> String # showList :: [ListUploadsResult] -> ShowS # | |
Eq ListUploadsResult Source # | |
Defined in Network.Minio.Data (==) :: ListUploadsResult -> ListUploadsResult -> Bool # (/=) :: ListUploadsResult -> ListUploadsResult -> Bool # |
listIncompleteUploads' :: Bucket -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Int -> Minio ListUploadsResult Source #
List incomplete multipart uploads.
data ListPartsResult Source #
Represents result from a listing of object parts of an ongoing multipart upload.
ListPartsResult | |
|
Instances
Show ListPartsResult Source # | |
Defined in Network.Minio.Data showsPrec :: Int -> ListPartsResult -> ShowS # show :: ListPartsResult -> String # showList :: [ListPartsResult] -> ShowS # | |
Eq ListPartsResult Source # | |
Defined in Network.Minio.Data (==) :: ListPartsResult -> ListPartsResult -> Bool # (/=) :: ListPartsResult -> ListPartsResult -> Bool # |
listIncompleteParts' :: Bucket -> Object -> UploadId -> Maybe Text -> Maybe Text -> Minio ListPartsResult Source #
List parts of an ongoing multipart upload.
Deletion APIs
deleteBucket :: Bucket -> Minio () Source #
DELETE a bucket from the service.
Presigned Operations
Time to expire for a presigned URL. It interpreted as a number of seconds. The maximum duration that can be specified is 7 days.
makePresignedUrl :: UrlExpiry -> Method -> Maybe Bucket -> Maybe Object -> Maybe Region -> Query -> RequestHeaders -> Minio ByteString Source #
Generate a presigned URL. This function allows for advanced usage - for simple cases prefer the `presigned*Url` functions.
If region is Nothing, it is picked up from the connection information (no check of bucket existence is performed).
All extra query parameters or headers are signed, and therefore are required to be sent when the generated URL is actually used.
presignedPutObjectUrl :: Bucket -> Object -> UrlExpiry -> RequestHeaders -> Minio ByteString Source #
Generate a URL with authentication signature to PUT (upload) an object. Any extra headers if passed, are signed, and so they are required when the URL is used to upload data. This could be used, for example, to set user-metadata on the object.
For a list of possible headers to pass, please refer to the PUT object REST API AWS S3 documentation.
presignedGetObjectUrl :: Bucket -> Object -> UrlExpiry -> Query -> RequestHeaders -> Minio ByteString Source #
Generate a URL with authentication signature to GET (download) an object. All extra query parameters and headers passed here will be signed and are required when the generated URL is used. Query parameters could be used to change the response headers sent by the server. Headers can be used to set Etag match conditions among others.
For a list of possible request parameters and headers, please refer to the GET object REST API AWS S3 documentation.
presignedHeadObjectUrl :: Bucket -> Object -> UrlExpiry -> RequestHeaders -> Minio ByteString Source #
Generate a URL with authentication signature to make a HEAD request on an object. This is used to fetch metadata about an object. All extra headers passed here will be signed and are required when the generated URL is used.
For a list of possible headers to pass, please refer to the HEAD object REST API AWS S3 documentation.
data PostPolicyCondition Source #
Represents individual conditions in a Post Policy document.
Instances
ToJSON PostPolicyCondition Source # | |
Defined in Network.Minio.PresignedOperations toJSON :: PostPolicyCondition -> Value # toEncoding :: PostPolicyCondition -> Encoding # toJSONList :: [PostPolicyCondition] -> Value # toEncodingList :: [PostPolicyCondition] -> Encoding # | |
Show PostPolicyCondition Source # | |
Defined in Network.Minio.PresignedOperations showsPrec :: Int -> PostPolicyCondition -> ShowS # show :: PostPolicyCondition -> String # showList :: [PostPolicyCondition] -> ShowS # | |
Eq PostPolicyCondition Source # | |
Defined in Network.Minio.PresignedOperations (==) :: PostPolicyCondition -> PostPolicyCondition -> Bool # (/=) :: PostPolicyCondition -> PostPolicyCondition -> Bool # |
ppCondBucket :: Bucket -> PostPolicyCondition Source #
Set the bucket name that the upload should use.
ppCondContentLengthRange :: Int64 -> Int64 -> PostPolicyCondition Source #
Set the content length range constraint with minimum and maximum byte count values.
ppCondContentType :: Text -> PostPolicyCondition Source #
Set the content-type header for the upload.
ppCondKey :: Object -> PostPolicyCondition Source #
Set the object name constraint for the upload.
ppCondKeyStartsWith :: Object -> PostPolicyCondition Source #
Set the object name prefix constraint for the upload.
ppCondSuccessActionStatus :: Int -> PostPolicyCondition Source #
Status code that the S3-server should send on a successful POST upload
data PostPolicy Source #
A PostPolicy is required to perform uploads via browser forms.
Instances
ToJSON PostPolicy Source # | |
Defined in Network.Minio.PresignedOperations toJSON :: PostPolicy -> Value # toEncoding :: PostPolicy -> Encoding # toJSONList :: [PostPolicy] -> Value # toEncodingList :: [PostPolicy] -> Encoding # | |
Show PostPolicy Source # | |
Defined in Network.Minio.PresignedOperations showsPrec :: Int -> PostPolicy -> ShowS # show :: PostPolicy -> String # showList :: [PostPolicy] -> ShowS # | |
Eq PostPolicy Source # | |
Defined in Network.Minio.PresignedOperations (==) :: PostPolicy -> PostPolicy -> Bool # (/=) :: PostPolicy -> PostPolicy -> Bool # |
data PostPolicyError Source #
Possible validation errors when creating a PostPolicy.
Instances
Show PostPolicyError Source # | |
Defined in Network.Minio.PresignedOperations showsPrec :: Int -> PostPolicyError -> ShowS # show :: PostPolicyError -> String # showList :: [PostPolicyError] -> ShowS # | |
Eq PostPolicyError Source # | |
Defined in Network.Minio.PresignedOperations (==) :: PostPolicyError -> PostPolicyError -> Bool # (/=) :: PostPolicyError -> PostPolicyError -> Bool # |
newPostPolicy :: UTCTime -> [PostPolicyCondition] -> Either PostPolicyError PostPolicy Source #
This function creates a PostPolicy after validating its arguments.
showPostPolicy :: PostPolicy -> ByteString Source #
Convert Post Policy to a string (e.g. for printing).
presignedPostPolicy :: PostPolicy -> Minio (ByteString, HashMap Text ByteString) Source #
Generate a presigned URL and POST policy to upload files via a browser. On success, this function returns a URL and POST form-data.
Bucket Policies
setBucketPolicy :: Bucket -> Text -> Minio () Source #
Set a new policy on a bucket. As a special condition if the policy is empty then we treat it as policy DELETE operation.
Bucket Notifications
data Notification Source #
A data-type to represent bucket notification configuration. It is a collection of queue, topic or lambda function configurations. The structure of the types follow closely the XML representation described at https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTnotification.html
Instances
Show Notification Source # | |
Defined in Network.Minio.Data showsPrec :: Int -> Notification -> ShowS # show :: Notification -> String # showList :: [Notification] -> ShowS # | |
Eq Notification Source # | |
Defined in Network.Minio.Data (==) :: Notification -> Notification -> Bool # (/=) :: Notification -> Notification -> Bool # |
data NotificationConfig Source #
A data-type representing the configuration for a particular notification system. It could represent a Queue, Topic or Lambda Function configuration.
Instances
Show NotificationConfig Source # | |
Defined in Network.Minio.Data showsPrec :: Int -> NotificationConfig -> ShowS # show :: NotificationConfig -> String # showList :: [NotificationConfig] -> ShowS # | |
Eq NotificationConfig Source # | |
Defined in Network.Minio.Data (==) :: NotificationConfig -> NotificationConfig -> Bool # (/=) :: NotificationConfig -> NotificationConfig -> Bool # |
A data-type for events that can occur in the object storage server. Reference: https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html#supported-notification-event-types
ObjectCreated | |
ObjectCreatedPut | |
ObjectCreatedPost | |
ObjectCreatedCopy | |
ObjectCreatedMultipartUpload | |
ObjectRemoved | |
ObjectRemovedDelete | |
ObjectRemovedDeleteMarkerCreated | |
ReducedRedundancyLostObject |
Filter data type - part of notification configuration
FilterKey contains FilterRules, and is part of a Filter.
Instances
newtype FilterRules Source #
FilterRules represents a collection of FilterRule
s.
Instances
Show FilterRules Source # | |
Defined in Network.Minio.Data showsPrec :: Int -> FilterRules -> ShowS # show :: FilterRules -> String # showList :: [FilterRules] -> ShowS # | |
Eq FilterRules Source # | |
Defined in Network.Minio.Data (==) :: FilterRules -> FilterRules -> Bool # (/=) :: FilterRules -> FilterRules -> Bool # |
data FilterRule Source #
A filter rule that can act based on the suffix or prefix of an object. As an example, let's create two filter rules:
let suffixRule = FilterRule "suffix" ".jpg" let prefixRule = FilterRule "prefix" "images/"
The suffixRule
restricts the notification to be triggered only
for objects having a suffix of ".jpg", and the prefixRule
restricts it to objects having a prefix of "images/".
Instances
Show FilterRule Source # | |
Defined in Network.Minio.Data showsPrec :: Int -> FilterRule -> ShowS # show :: FilterRule -> String # showList :: [FilterRule] -> ShowS # | |
Eq FilterRule Source # | |
Defined in Network.Minio.Data (==) :: FilterRule -> FilterRule -> Bool # (/=) :: FilterRule -> FilterRule -> Bool # |
getBucketNotification :: Bucket -> Minio Notification Source #
Retrieve the notification configuration on a bucket.
putBucketNotification :: Bucket -> Notification -> Minio () Source #
Set the notification configuration on a bucket.
removeAllBucketNotification :: Bucket -> Minio () Source #
Remove all notifications configured on a bucket.