# This file was generated by Rcpp::compileAttributes
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
#' Set the access_key and secret_key
#'
#' @details Before any other function use S3Connect to set
#' the access and secret key.
#' @param access_key Put your AWS access_key here to connect
#' to S3.
#' @param secret_key Put your AWS secret_key here to connect
#' to S3.
#' @param hostname Put a hostname such as 's3-eu-west-1.amazonaws.com'
#' to specify a name other than s3.amazonaws.com
#' @return There is no return currently.
#' @export
S3_connect <- function(access_key, secret_key, hostname = "s3.amazonaws.com") {
invisible(.Call('RS3_S3Connect', PACKAGE = 'RS3', access_key, secret_key, hostname))
}
#' Test the bucket and connection
#'
#' @details This function allows you to test to see if everything is working correctly.
#' It tests that your two keys are correct.
#' @param bucketName Put a bucketName that exists that you use to test it.
#' @return It will return all the headers of the call
#' @export
S3_test_bucket <- function(bucketName) {
invisible(.Call('RS3_test_bucket', PACKAGE = 'RS3', bucketName))
}
#' Create a new bucket
#'
#' @details Add a new bucket with ACL set.
#' @param bucketName The name of the new bucket you want to create.
#' @param acl The 'canned' acl's that you want. You can use 'private'
#' 'public-read', 'public-read-write', and 'authenticated-read'. It defaults
#' to private.
#' @return Returns 1 if successful 0 with error if there was an error.
#' @export
S3_create_bucket <- function(bucketName, acl = "private") {
.Call('RS3_create_bucket', PACKAGE = 'RS3', bucketName, acl)
}
#' Delete a bucket that you have.
#'
#' @details Make sure the name is correct before calling. As it is irreversable.
#' @param bucketName Pass it the name of the bucket to be deleted
#' @return Returns 1 if successful
#' @export
S3_delete_bucket <- function(bucketName) {
invisible(.Call('RS3_delete_bucket', PACKAGE = 'RS3', bucketName))
}
#' List all contents of the bucket
#'
#' @details It will list all the contents of the bucket. In the future it will be in a data frame.
#' @param bucketName The name of the bucket you want listed.
#' @param prefix If you want only a certain part of the bucket, for example
#' everything within "/blogs/test", then put that.
#' @param allDetails True/False if you want to see all the details or condensed version.
#' @return Outputs in command line all info.
#' @export
S3_list_bucket <- function(bucketName, prefix = "", allDetails = 0L) {
.Call('RS3_list_bucket', PACKAGE = 'RS3', bucketName, prefix, allDetails)
}
#' Delete's a file/object within the bucket
#'
#' @details It will delete an object within the bucket.
#' @param bucketName The name of the bucket that contains the file/object
#' @param key The name of the file and location of it. For example "filename"
#' will delete a file named filename in the root of the bucket. "test/filename"
#' will delete one within the test folder.
#' @return returns 1 if successful.
#' @export
S3_delete_object <- function(bucketName, key) {
.Call('RS3_delete_object', PACKAGE = 'RS3', bucketName, key)
}
#' Uploads an object to the S3 bucket specified.
#'
#' @details Uploads a file to the S3 bucket you specify in the location specified.
#' @param bucketName The name of the bucket you want to upload to.
#' @param storage_location The location you want to place the file. For example
#' "file.newname" uploads it with the name file.newname. Do not start with a "/"
#' unless you want a new blank folder.
#' @param filename The name of the file to be uploaded. This is typically the location
#' @param contentType The type of content you are uploading. (Optional)
#' on your computer.
#' @return Returns 1 if successful.
#' @export
S3_put_object <- function(bucketName, storage_location, filename, contentType = 0L) {
.Call('RS3_put_object', PACKAGE = 'RS3', bucketName, storage_location, filename, contentType)
}
#' Copy an object from one bucket to another.
#'
#' @details This function copies a file from one bucket to another
#' bucket and can place it within a new folder.
#' @param sourceBucketName The name of the bucket the file is in originally.
#' @param sourceKey The location the file is including folder as well as the
#' file name.
#' @param destinationBucketName The name of the bucket you want the file copied to.
#' @param destinationKey The location you want the file copied too.
#' @return Returns 1 if successful
#' @export
S3_copy_object <- function(sourceBucketName, sourceKey, destinationBucketName, destinationKey) {
.Call('RS3_copy_object', PACKAGE = 'RS3', sourceBucketName, sourceKey, destinationBucketName, destinationKey)
}
#' Download a file from a bucket
#'
#' @details This function downloads a file from the bucket that you specify.
#' @param bucketName The name of the bucket where the file currently is.
#' @param key The location of the file for example "test/filename" is
#' a file located in the folder test.
#' @param filename The name of the location you want the file downloaded to.
#' @return Returns 1 if successful.
#' @export
S3_get_object <- function(bucketName, key, filename = 0L) {
.Call('RS3_get_object', PACKAGE = 'RS3', bucketName, key, filename)
}
#' Gets the response properties of the object.
#'
#' @details This function lists all the properties of the object.
#' @param bucketName The name of the bucket where the file lies.
#' @param key The location of the file
#' @return Returns the headers of the file.
#' @export
S3_head_object <- function(bucketName, key) {
.Call('RS3_head_object', PACKAGE = 'RS3', bucketName, key)
}
#' Get ACL of bucket location
#'
#' @details This function gets the ACL of a file and puts all
#' the information into a file. View the AWS documentation on what ACL is \href{http://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html}{here.}
#' @param bucketName The name of the bucket
#' @param key The location of the folder/file.
#' @param filename The location you want to store the file.
#' @return Places ACL information into the file you chose and
#' returns a 1
#' @export
S3_get_acl <- function(bucketName, key, filename = 0L) {
.Call('RS3_get_acl', PACKAGE = 'RS3', bucketName, key, filename)
}
#' Set The ACL of bucket
#'
#' @details returns the settings for logging. View the AWS documentation on what ACL is \href{http://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html}{here.}
#' @param bucketName The name of the bucket you want the settings
#' @param key The location of the folder/file
#' @param filename A file with ACL configs in
#' @return Returns 1 if success
#' @export
S3_set_acl <- function(bucketName, key, filename) {
.Call('RS3_set_acl', PACKAGE = 'RS3', bucketName, key, filename)
}
#' Get logging Settings of bucket
#'
#' @details returns the settings for logging.
#' @param bucketName The name of the bucket you want the settings
#' @param filename The location to place the logging settings into
#' @return Returns a file with logging settings.
#' @export
S3_get_logging <- function(bucketName, filename) {
.Call('RS3_get_logging', PACKAGE = 'RS3', bucketName, filename)
}
#' Set the logging Settings for a bucket
#'
#' @details Set the logging settings for a bucket.
#' @param bucketName The name of the bucket to set the logging.
#' @param targetBucket The location of the bucket where you
#' want the logs to go.
#' @param filename The file with the logging settings inside
#' @return returns a 1 if successful
#' @export
S3_set_logging <- function(bucketName, targetBucket, filename) {
.Call('RS3_set_logging', PACKAGE = 'RS3', bucketName, targetBucket, filename)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.