-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #796 from DyfanJones/enrich-error-message
Enrich error message
- Loading branch information
Showing
8 changed files
with
193 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
s3 <- function(config = list()) { | ||
svc <- .s3$operations | ||
svc <- set_config(svc, config) | ||
return(svc) | ||
} | ||
|
||
.s3 <- list() | ||
|
||
.s3$operations <- list() | ||
|
||
.s3$metadata <- list( | ||
service_name = "s3", | ||
endpoints = list("us-gov-west-1" = list(endpoint = "s3.{region}.amazonaws.com", global = FALSE), "us-west-1" = list(endpoint = "s3.{region}.amazonaws.com", global = FALSE), "us-west-2" = list(endpoint = "s3.{region}.amazonaws.com", global = FALSE), "eu-west-1" = list(endpoint = "s3.{region}.amazonaws.com", global = FALSE), "ap-southeast-1" = list(endpoint = "s3.{region}.amazonaws.com", global = FALSE), "ap-southeast-2" = list(endpoint = "s3.{region}.amazonaws.com", global = FALSE), "ap-northeast-1" = list(endpoint = "s3.{region}.amazonaws.com", global = FALSE), "sa-east-1" = list(endpoint = "s3.{region}.amazonaws.com", global = FALSE), "us-east-1" = list(endpoint = "s3.amazonaws.com", global = FALSE), "*" = list(endpoint = "s3.{region}.amazonaws.com", global = FALSE), "cn-*" = list(endpoint = "s3.{region}.amazonaws.com.cn", global = FALSE), "eu-isoe-*" = list(endpoint = "s3.{region}.cloud.adc-e.uk", global = FALSE), "us-iso-*" = list(endpoint = "s3.{region}.c2s.ic.gov", global = FALSE), "us-isob-*" = list(endpoint = "s3.{region}.sc2s.sgov.gov", global = FALSE), "us-isof-*" = list(endpoint = "s3.{region}.csp.hci.ic.gov", global = FALSE)), | ||
service_id = "S3", | ||
api_version = "2006-03-01", | ||
signing_name = "s3", | ||
json_version = "", | ||
target_prefix = "" | ||
) | ||
|
||
.s3$service <- function(config = list()) { | ||
handlers <- new_handlers("restxml", "s3") | ||
new_service(.s3$metadata, handlers, config) | ||
} | ||
|
||
.s3$head_bucket_input <- function(...) { | ||
args <- c(as.list(environment()), list(...)) | ||
shape <- structure(list(Bucket = structure(logical(0), tags = list(location = "uri", locationName = "Bucket", type = "string")), ExpectedBucketOwner = structure(logical(0), tags = list(location = "header", locationName = "x-amz-expected-bucket-owner", type = "string"))), tags = list(type = "structure")) | ||
return(populate(args, shape)) | ||
} | ||
|
||
.s3$head_bucket_output <- function(...) { | ||
args <- c(as.list(environment()), list(...)) | ||
shape <- structure(list(BucketLocationType = structure(logical(0), tags = list(location = "header", locationName = "x-amz-bucket-location-type", type = "string")), BucketLocationName = structure(logical(0), tags = list(location = "header", locationName = "x-amz-bucket-location-name", type = "string")), BucketRegion = structure(logical(0), tags = list(location = "header", locationName = "x-amz-bucket-region", type = "string")), AccessPointAlias = structure(logical(0), tags = list(location = "header", locationName = "x-amz-access-point-alias", type = "boolean", box = TRUE))), tags = list(type = "structure")) | ||
return(populate(args, shape)) | ||
} | ||
|
||
s3_head_bucket <- function(Bucket, ExpectedBucketOwner = NULL) { | ||
op <- new_operation( | ||
name = "HeadBucket", | ||
http_method = "HEAD", | ||
http_path = "/{Bucket}", | ||
paginator = list() | ||
) | ||
input <- .s3$head_bucket_input(Bucket = Bucket, ExpectedBucketOwner = ExpectedBucketOwner) | ||
output <- .s3$head_bucket_output() | ||
config <- get_config() | ||
svc <- .s3$service(config) | ||
request <- new_request(svc, op, input, output) | ||
response <- send_request(request) | ||
return(response) | ||
} | ||
.s3$operations$head_bucket <- s3_head_bucket |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Status | ||
http_statuses <- c( | ||
"100" = "Continue", | ||
"101" = "Switching Protocols", | ||
"102" = "Processing", | ||
"103" = "Early Hints", | ||
"200" = "OK", | ||
"201" = "Created", | ||
"202" = "Accepted", | ||
"203" = "Non-Authoritative Information", | ||
"204" = "No Content", | ||
"205" = "Reset Content", | ||
"206" = "Partial Content", | ||
"207" = "Multi-Status", | ||
"208" = "Already Reported", | ||
"226" = "IM Used", | ||
"300" = "Multiple Choice", | ||
"301" = "Moved Permanently", | ||
"302" = "Found", | ||
"303" = "See Other", | ||
"304" = "Not Modified", | ||
"305" = "Use Proxy", | ||
"307" = "Temporary Redirect", | ||
"308" = "Permanent Redirect", | ||
"400" = "Bad Request", | ||
"401" = "Unauthorized", | ||
"402" = "Payment Required", | ||
"403" = "Forbidden", | ||
"404" = "Not Found", | ||
"405" = "Method Not Allowed", | ||
"406" = "Not Acceptable", | ||
"407" = "Proxy Authentication Required", | ||
"408" = "Request Timeout", | ||
"409" = "Conflict", | ||
"410" = "Gone", | ||
"411" = "Length Required", | ||
"412" = "Precondition Failed", | ||
"413" = "Payload Too Large", | ||
"414" = "URI Too Long", | ||
"415" = "Unsupported Media Type", | ||
"416" = "Range Not Satisfiable", | ||
"417" = "Expectation Failed", | ||
"418" = "I'm a teapot", | ||
"421" = "Misdirected Request", | ||
"422" = "Unprocessable Entity", | ||
"423" = "Locked", | ||
"424" = "Failed Dependency", | ||
"425" = "Too Early", | ||
"426" = "Upgrade Required", | ||
"428" = "Precondition Required", | ||
"429" = "Too Many Requests", | ||
"451" = "Unavailable For Legal Reasons", | ||
"500" = "Internal Server Error", | ||
"501" = "Not Implemented", | ||
"502" = "Bad Gateway", | ||
"503" = "Service Unavailable", | ||
"504" = "Gateway Timeout", | ||
"505" = "HTTP Version Not Supported", | ||
"506" = "Variant Also Negotiates", | ||
"507" = "Insufficient Storage", | ||
"508" = "Loop Detected", | ||
"510" = "Not Extended", | ||
"511" = "Network Authentication Required" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters