From 406a75e849613e0c79c8e98d951db9fb937e2b13 Mon Sep 17 00:00:00 2001 From: Larefly Date: Mon, 16 Dec 2024 21:50:14 +0000 Subject: [PATCH] switch vendor from aws-sdk-js to botocore (#852) * migrate vendor api from aws-sdk-js to botocore * add botocore to submodules * migrate vendor from aws-sdk-js to botocore * update services and remove deprecated aws services * remove aws-sdk-js as vendor api * update r docs to reflect botocore * fixed usage * typo --- .gitmodules | 6 +- Makefile | 2 +- make.paws/DESCRIPTION | 2 +- make.paws/R/aws_services.R | 12 +- make.paws/R/make_sdk.R | 15 +- make.paws/R/paws_helper_fun.R | 4 +- make.paws/R/read_api.R | 78 ++- make.paws/inst/extdata/old_packages.yml | 543 ++++++++++++++++++++ make.paws/inst/extdata/packages.yml | 54 +- make.paws/man/category_service_ops_count.Rd | 4 +- make.paws/man/list_aws_services.Rd | 8 +- make.paws/man/make_sdk.Rd | 2 +- make.paws/man/paws_new_services.Rd | 2 +- make.paws/tests/testthat/test_make_sdk.R | 17 +- make.paws/tests/testthat/test_read_api.R | 55 +- vendor/aws-sdk-js | 1 - 16 files changed, 718 insertions(+), 87 deletions(-) create mode 100644 make.paws/inst/extdata/old_packages.yml delete mode 160000 vendor/aws-sdk-js diff --git a/.gitmodules b/.gitmodules index 2438a99c95..f7c04f6f50 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "vendor/aws-sdk-js"] - path = vendor/aws-sdk-js - url = https://github.com/aws/aws-sdk-js +[submodule "vendor/botocore"] + path = vendor/botocore + url = https://github.com/boto/botocore diff --git a/Makefile b/Makefile index 2a73d7fd98..26eb6332af 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -IN_DIR := ./vendor/aws-sdk-js +IN_DIR := ./vendor/botocore OUT_DIR := ./cran DOC_DIR := ./paws CRAN_DIR := ./cran diff --git a/make.paws/DESCRIPTION b/make.paws/DESCRIPTION index 79ef2600ad..fded50c21c 100644 --- a/make.paws/DESCRIPTION +++ b/make.paws/DESCRIPTION @@ -1,7 +1,7 @@ Package: make.paws Type: Package Title: Generate Paws AWS SDKs for R -Version: 0.9.2 +Version: 0.10.0 Authors@R: c( person("David", "Kretch", email = "david.kretch@gmail.com", role = "aut"), person("Adam", "Banker", email = "adam.banker39@gmail.com", role = "aut"), diff --git a/make.paws/R/aws_services.R b/make.paws/R/aws_services.R index b1f733da7c..cfa284ac44 100644 --- a/make.paws/R/aws_services.R +++ b/make.paws/R/aws_services.R @@ -3,13 +3,13 @@ NULL #' @import data.table -#' @title Helper function to list all aws services and operations from awds js sdk +#' @title Helper function to list all aws services and operations from aws botocore #' -#' @param in_dir Directory containing aws js sdk. +#' @param in_dir Directory containing aws botocore. #' #' @export -list_aws_services <- function(in_dir = "../vendor/aws-sdk-js") { - apis <- list_apis(file.path(in_dir, "apis")) +list_aws_services <- function(in_dir = "../vendor/botocore") { + apis <- list_apis(fs::path(in_dir, "botocore", "data")) aws_service_ops <- lapply(apis, function(x) { api <- read_api(x, in_dir) data.frame( @@ -24,10 +24,10 @@ list_aws_services <- function(in_dir = "../vendor/aws-sdk-js") { #' @title Helper function to count all operations by service and category #' -#' @param in_dir Directory containing aws js sdk. +#' @param in_dir Directory containing aws botocore. #' #' @export -category_service_ops_count <- function(in_dir = "../vendor/aws-sdk-js") { +category_service_ops_count <- function(in_dir = "../vendor/botocore") { aws_service_ops <- list_aws_services(in_dir) paws_cat <- lapply(get_categories(), function(x) { data.frame(name = rep(x$name, length(x$services)), services = x$services) diff --git a/make.paws/R/make_sdk.R b/make.paws/R/make_sdk.R index bbdb627751..bc46bbb022 100644 --- a/make.paws/R/make_sdk.R +++ b/make.paws/R/make_sdk.R @@ -12,14 +12,14 @@ #' @name make_sdk #' @export make_sdk <- function( - in_dir = "./vendor/aws-sdk-js", + in_dir = "./vendor/botocore", out_sdk_dir = "./cran", out_doc_dir = "./paws", apis = character(0), only_cran = TRUE, cache_dir = "./cache") { if (length(apis) == 0) { - apis <- list_apis(file.path(in_dir, "apis")) + apis <- list_apis(fs::path(in_dir, "botocore", "data")) } # Get the category-level packages that the SDK is separated into. @@ -97,12 +97,17 @@ write_skeleton <- function(path, version) { } # Return the names of the APIs available in the given directory. -list_apis <- function(path) { +list_apis_old <- function(path) { files <- list.files(file.path(path), pattern = ".*\\.normal\\.json") apis <- unique(gsub("(.+)-\\d{4}.*", "\\1", files)) return(apis) } +list_apis <- function(path) { + return(fs::path_file(fs::dir_ls(path, type = "dir"))) +} + + # Create the package's R directory. use_r_dir <- function(path) { r_dir <- file.path(path, "R") @@ -145,7 +150,7 @@ use_package_doc <- function(path) { package <- methods::getPackageName() template <- system_file("templates/package.R", package = package) to <- file.path(path, "R", paste0(basename(path), "_package.R")) - fs::file_copy(template, to, overwrite = T) + fs::file_copy(template, to, overwrite = TRUE) } # Create a dummy NAMESPACE file. @@ -153,7 +158,7 @@ use_namespace <- function(path) { package <- methods::getPackageName() template <- system_file("templates/NAMESPACE", package = package) to <- file.path(path, "NAMESPACE") - fs::file_copy(template, to, overwrite = T) + fs::file_copy(template, to, overwrite = TRUE) } # Return the authors from this package. diff --git a/make.paws/R/paws_helper_fun.R b/make.paws/R/paws_helper_fun.R index 1352417f62..dedab02322 100644 --- a/make.paws/R/paws_helper_fun.R +++ b/make.paws/R/paws_helper_fun.R @@ -65,10 +65,10 @@ paws_service_param_fn <- function(dir = "../paws.common") { #' @title lists new services from AWS #' @param in_dir Directory containing AWS API input files. #' @export -paws_new_services <- function(in_dir = "../vendor/aws-sdk-js") { +paws_new_services <- function(in_dir = "../vendor/botocore") { existing_apis <- yaml::read_yaml(system.file("extdata/packages.yml", package = "make.paws")) existing_apis <- unlist(lapply(existing_apis, \(x) x$services)) - new_apis <- list_apis(file.path(in_dir, "apis")) + new_apis <- list_apis(file.path(in_dir, "botocore", "data")) return(setdiff(new_apis, existing_apis)) } diff --git a/make.paws/R/read_api.R b/make.paws/R/read_api.R index b8b56008d6..7852002904 100644 --- a/make.paws/R/read_api.R +++ b/make.paws/R/read_api.R @@ -1,7 +1,7 @@ # Read a given API's definition and documentation files. # aws-sdk-js deprecated and apis is not being updated # TODO: short term migrate to botocore jsons -read_api <- function(api_name, path) { +read_api_old <- function(api_name, path) { api_path <- file.path(path, "apis") region_config_path <- file.path(path, "lib/region_config_data.json") @@ -28,6 +28,33 @@ read_api <- function(api_name, path) { return(api) } +read_api <- function(api_name, path) { + api_path <- file.path(path, "botocore", "data") + region_config_path <- file.path(api_path, "endpoints.json") + + version <- get_latest_api_version_v2(api_name, api_path) + files <- get_api_files_v2(version, api_name, api_path) + if (length(version) == 0 || length(files) == 0) stop("Invalid API") + + api <- jsonlite::read_json(files$service) + api <- fix_operation_names(api) + + if (!is.null(files$examples)) { + examples <- jsonlite::read_json(files$examples) + api <- merge_examples(api, examples$examples) + } + if (!is.null(files$paginators)) { + paginators <- jsonlite::read_json(files$paginators) + api <- merge_paginators(api, paginators$pagination) + } + api <- merge_eventstream(api) + region_config <- jsonlite::read_json(region_config_path) + api <- merge_region_config_v2(api, region_config) + api <- fix_region_config(api) + + return(api) +} + # Returns the latest version of the given API. get_latest_api_version <- function(name, path) { files <- list.files(path, pattern = sprintf("^%s-.{10}.normal.json", name)) @@ -36,6 +63,12 @@ get_latest_api_version <- function(name, path) { return(latest) } +get_latest_api_version_v2 <- function(api_name, path) { + dir_ls <- list.files(file.path(path, api_name)) + if (length(dir_ls) == 0) stop("Invalid API") + return(max(as.Date(dir_ls))) +} + # Returns a list of API files for a given API version. get_api_files <- function(version, path) { files <- list.files(path, pattern = sprintf("^%s", version), full.names = TRUE) @@ -45,6 +78,13 @@ get_api_files <- function(version, path) { return(files) } +get_api_files_v2 <- function(version, api_name, api_path) { + files <- list.files(file.path(api_path, api_name, version), full.names = TRUE) + types <- gsub("(-\\d.json)$", "", basename(files)) + names(files) <- types + return(as.list(files)) +} + # Returns an API object with examples merged into the corresponding operations. merge_examples <- function(api, examples) { for (name in names(examples)) { @@ -67,18 +107,18 @@ merge_paginators <- function(api, paginators) { merge_eventstream <- function(api) { flat_shape <- unlist(api$shapes) - eventstream <- flat_shape[endsWith(names(flat_shape),"eventstream")] + eventstream <- flat_shape[endsWith(names(flat_shape), "eventstream")] names(eventstream) <- stringr::str_extract(names(eventstream), "([a-zA-Z]+)") shape <- flat_shape[endsWith(names(flat_shape), "shape")] shape <- shape[shape %in% names(eventstream)] names(shape) <- gsub( - "Output$|Response$", "", stringr::str_extract(names(shape), "([a-zA-Z]+)") + "Output$|Response$|Request$", "", stringr::str_extract(names(shape), "([a-zA-Z]+)") ) names(eventstream) <- names(shape) - for (nms in names(eventstream)) { - api$operations[[nms]]$eventstream <- eventstream[nms] + for (nms in unique(names(eventstream))) { + api$operations[[nms]]$eventstream <- eventstream[[nms]] } return(api) } @@ -111,6 +151,34 @@ merge_region_config <- function(api, region_config) { return(api) } +merge_region_config_v2 <- function(api, region_config) { + service <- service_name(api) + endpoint_prefix <- api$metadata$endpointPrefix + ep <- list() + for (partition in region_config$partitions) { + dnsSuffix <- partition$dnsSuffix + hostname <- partition$defaults$hostname + region_regex <- gsub("\\", "\\\\", partition$regionRegex, fixed = T) + if (!is.null(global <- partition$services[[endpoint_prefix]]$endpoints[["aws-global"]])) { + endpoint <- build_endpoint(endpoint_prefix, global$hostname, dnsSuffix) + endpoint <- list(endpoint = endpoint, global = TRUE) + ep[["aws-global"]] <- endpoint + if (!is.null(region_name <- global$credentialScope$region)) { + ep[[region_name]] <- endpoint + } + } + endpoint <- list(endpoint = build_endpoint(endpoint_prefix, hostname, dnsSuffix), global = FALSE) + ep[[region_regex]] <- endpoint + } + api$region_config <- ep + return(api) +} + +build_endpoint <- function(service, hostname, dnsSuffix) { + endpoint <- gsub("{service}", service, hostname, fixed = TRUE) + gsub("{dnsSuffix}", dnsSuffix, endpoint, fixed = TRUE) +} + # Make sure each operation has an exportable name. CloudFront's operation `name` # element is incorrect in this regard, e.g. they have values like # "OperationName2017_01_01". diff --git a/make.paws/inst/extdata/old_packages.yml b/make.paws/inst/extdata/old_packages.yml new file mode 100644 index 0000000000..5f944432d1 --- /dev/null +++ b/make.paws/inst/extdata/old_packages.yml @@ -0,0 +1,543 @@ +--- +- name: compute + services: + - apprunner + - batch + - braket + - compute-optimizer + - ec2 + - ec2-instance-connect + - ecr + - ecr-public + - ecs + - eks + - elasticbeanstalk + - emr-containers + - emr-serverless + - imagebuilder + - lambda + - lightsail + - proton + - serverlessrepo + title: "'Amazon Web Services' Compute Services" + description: >- + Interface to 'Amazon Web Services' compute services, including + 'Elastic Compute Cloud' ('EC2'), 'Lambda' functions-as-a-service, + containers, batch processing, and more . + +- name: storage + services: + - backup + - backupstorage + - dlm + - ebs + - elasticfilesystem + - finspace-data + - fsx + - glacier + - omics + - rbin + - s3 + - s3control + - s3outposts + - storagegateway + title: "'Amazon Web Services' Storage Services" + description: >- + Interface to 'Amazon Web Services' storage services, including 'Simple + Storage Service' ('S3') and more . + +- name: database + services: + - dax + - docdb + - docdb-elastic + - dynamodb + - streams.dynamodb + - elasticache + - keyspaces + - lakeformation + - memorydb + - neptune + - neptunedata + - qldb + - qldb-session + - rds + - rds-data + - redshift + - redshift-data + - redshift-serverless + - sdb + - timestream-query + - timestream-write + title: "'Amazon Web Services' Database Services" + description: >- + Interface to 'Amazon Web Services' database services, including 'Relational + Database Service' ('RDS'), 'DynamoDB' 'NoSQL' database, and more + . + +- name: migration + services: + - appflow + - appintegrations + - cleanrooms + - dataexchange + - datasync + - discovery + - dms + - importexport + - m2 + - mgn + - AWSMigrationHub + - migrationhub-config + - migration-hub-refactor-spaces + - migrationhuborchestrator + - migrationhubstrategy + - sms + - snowball + - snow-device-management + - transfer + title: "'Amazon Web Services' Migration & Transfer Services" + description: >- + Interface to 'Amazon Web Services' migration & transfer services, including + file and database migration to 'Amazon Web Services' + . + +- name: networking + services: + - apigateway + - apigatewaymanagementapi + - apigatewayv2 + - appfabric + - appmesh + - arc-zonal-shift + - backup-gateway + - cloudfront + - directconnect + - elasticloadbalancing + - elasticloadbalancingv2 + - globalaccelerator + - network-firewall + - networkmanager + - route53 + - route53domains + - route53-recovery-cluster + - route53-recovery-control-config + - route53-recovery-readiness + - route53resolver + - servicediscovery + - tnb + - vpc-lattice + title: "'Amazon Web Services' Networking & Content Delivery Services" + description: >- + Interface to 'Amazon Web Services' networking and content delivery services, + including 'Route 53' Domain Name System service, 'CloudFront' content + delivery, load balancing, and more . + +- name: developer.tools + services: + - cloud9 + - cloudcontrol + - codebuild + - codeartifact + - codecommit + - codecatalyst + - codedeploy + - codeguruprofiler + - codeguru-reviewer + - codeguru-security + - codepipeline + - codestar + - codestar-connections + - codestar-notifications + - drs + - devops-guru + - fis + - wellarchitected + - xray + title: "'Amazon Web Services' Developer Tools Services" + description: >- + Interface to 'Amazon Web Services' developer tools services, including + version control, continuous integration and deployment, and more + . + +- name: robotics + services: + - robomaker + title: "'Amazon Web Services' Robotics Services" + description: >- + Interface to 'Amazon Web Services' robotics services, including the + 'RobotMaker' API for developing, testing, and deploying intelligent robotics + applications . + +- name: blockchain + services: + - managedblockchain + - managedblockchain-query + title: "'Amazon Web Services' Blockchain Services" + description: >- + Interface to 'Amazon Web Services' blockchain services, including + 'BlockChain' API for creating and managing blockchain networks using + open-source frameworks . + +- name: satellite + services: + - groundstation + title: "'Amazon Web Services' Satellite Services" + description: >- + Interface to 'Amazon Web Services' satellite services, including the + 'groundstation' API for control satellite communications, downlink and + process satellite data applications . + +- name: management + services: + - amp + - application-autoscaling + - application-insights + - applicationcostprofiler + - auditmanager + - autoscaling + - autoscaling-plans + - cloudformation + - cloudtrail + - cloudtrail-data + - config + - controltower + - events + - evidently + - finspace + - grafana + - health + - license-manager + - license-manager-user-subscriptions + - license-manager-linux-subscriptions + - logs + - internetmonitor + - monitoring + - oam + - opsworks + - opsworkscm + - organizations + - pi + - resiliencehub + - resource-groups + - resourcegroupstaggingapi + - rum + - service-quotas + - servicecatalog + - servicecatalog-appregistry + - ssm + - ssm-contacts + - ssm-incidents + - ssm-sap + - support + - support-app + - synthetics + title: "'Amazon Web Services' Management & Governance Services" + description: >- + Interface to 'Amazon Web Services' management and governance services, + including 'CloudWatch' application and infrastructure monitoring, 'Auto + Scaling' for automatically scaling resources, and more + . + +- name: media.services + services: + - elastictranscoder + - kinesisvideo + - kinesis-video-archived-media + - kinesis-video-media + - kinesis-video-signaling + - kinesis-video-webrtc-storage + - mediaconnect + - mediaconvert + - medialive + - mediapackage + - mediapackagev2 + - mediapackage-vod + - mediastore + - mediastore-data + - mediatailor + title: "'Amazon Web Services' Media Services Services" + description: >- + Interface to 'Amazon Web Services' media services services, including + 'Kinesis' video stream capture and processing, format conversion, + and more . + +- name: machine.learning + services: + - comprehend + - comprehendmedical + - elastic-inference + - forecastquery + - forecast + - frauddetector + - lex-models + - models.lex.v2 + - runtime.lex + - runtime.lex.v2 + - lookoutequipment + - lookoutmetrics + - machinelearning + - panorama + - personalize + - personalize-events + - personalize-runtime + - polly + - rekognition + - sagemaker + - sagemaker-a2i-runtime + - sagemaker-edge + - sagemaker-featurestore-runtime + - sagemaker-geospatial + - sagemaker-metrics + - runtime.sagemaker + - textract + - transcribe + - translate + - voice-id + - bedrock + - bedrock-runtime + title: "'Amazon Web Services' Machine Learning Services" + description: >- + Interface to 'Amazon Web Services' machine learning services, including + 'SageMaker' managed machine learning service, natural language processing, + speech recognition, translation, and more + . + +- name: analytics + services: + - athena + - cloudsearch + - cloudsearchdomain + - datapipeline + - datazone + - es + - elasticmapreduce + - entityresolution + - firehose + - glue + - databrew + - healthlake + - ivs + - ivs-realtime + - kafka + - kafkaconnect + - kendra + - kendra-ranking + - kinesis + - kinesisanalytics + - kinesisanalyticsv2 + - mturk-requester + - opensearch + - opensearchserverless + - osis + - quicksight + title: "'Amazon Web Services' Analytics Services" + description: >- + Interface to 'Amazon Web Services' 'analytics' services, including 'Elastic + MapReduce' 'Hadoop' and 'Spark' big data service, 'Elasticsearch' + search engine, and more . + +- name: security.identity + services: + - accessanalyzer + - account + - acm + - acm-pca + - clouddirectory + - cloudhsm + - cloudhsmv2 + - cognito-identity + - cognito-idp + - cognito-sync + - detective + - ds + - fms + - guardduty + - iam + - identitystore + - inspector + - inspector2 + - kms + - macie + - macie2 + - pca-connector-ad + - ram + - rolesanywhere + - secretsmanager + - securityhub + - securitylake + - shield + - sso + - sso-admin + - sso-oidc + - sts + - verifiedpermissions + - waf + - waf-regional + - wafv2 + title: "'Amazon Web Services' Security, Identity, & Compliance Services" + description: >- + Interface to 'Amazon Web Services' security, identity, and compliance + services, including the 'Identity & Access Management' ('IAM') service for + managing access to services and resources, and more + . + +- name: mobile + services: + - amplify + - amplifybackend + - amplifyuibuilder + - appconfig + - appconfigdata + - appsync + - devicefarm + - honeycode + - mobile + - mobileanalytics + - privatenetworks + title: "'Amazon Web Services' Mobile Services" + description: >- + Interface to 'Amazon Web Services' mobile services, including the 'Amplify' + library for mobile applications, 'AppSync' back-end for mobile + applications, and more . + +- name: ar.vr + services: + title: "'Amazon Web Services' AR & VR Services" + description: "" + +- name: application.integration + services: + - eventbridge + - location + - mq + - mwaa + - pipes + - resource-explorer-2 + - schemas + - scheduler + - states + - sns + - sqs + - swf + title: "'Amazon Web Services' Application Integration Services" + description: >- + Interface to 'Amazon Web Services' application integration services, + including 'Simple Queue Service' ('SQS') message queue, 'Simple Notification + Service' ('SNS') publish/subscribe messaging, and more + . + +- name: cost.management + services: + - billingconductor + - budgets + - cur + - ce + - marketplace-catalog + - marketplacecommerceanalytics + - entitlement.marketplace + - meteringmarketplace + - pricing + - savingsplans + - payment-cryptography + - payment-cryptography-data + title: "'Amazon Web Services' Cost Management Services" + description: >- + Interface to 'Amazon Web Services' cost management services, including + cost and usage reports, budgets, pricing, and more + . + +- name: customer.engagement + services: + - connect + - connectcampaigns + - connectcases + - connect-contact-lens + - connectparticipant + - email + - wisdom + - customer-profiles + - pinpoint + - pinpoint-email + - pinpoint-sms-voice-v2 + - sesv2 + - sms-voice + title: "'Amazon Web Services' Customer Engagement Services" + description: >- + Interface to 'Amazon Web Services' customer engagement services, including + 'Simple Email Service', 'Connect' contact center service, and more + . + +- name: business.applications + services: + - alexaforbusiness + - chime + - chime-sdk-identity + - chime-sdk-media-pipelines + - chime-sdk-meetings + - chime-sdk-messaging + - chime-sdk-voice + - lookoutvision + - outposts + - medical-imaging + - workmail + title: "'Amazon Web Services' Business Applications Services" + description: >- + Interface to 'Amazon Web Services' business applications services, including + online meetings and video conferencing, email and calendar service, + and more . + +- name: end.user.computing + services: + - appstream + - ivschat + - nimble + - workdocs + - worklink + - workmail + - workmailmessageflow + - workspaces + - workspaces-web + title: "'Amazon Web Services' End User Computing Services" + description: >- + Interface to 'Amazon Web Services' end user computing services, including + collaborative document editing, mobile intranet, and more + . + +- name: internet.of.things + services: + - greengrass + - greengrassv2 + - iot + - iot1click-devices + - iot1click-projects + - iotanalytics + - iot-data + - iotdeviceadvisor + - iotevents + - iotevents-data + - iotfleethub + - iotfleetwise + - iot-jobs-data + - iot-roborunner + - iotsecuretunneling + - iotsitewise + - iotthingsgraph + - iottwinmaker + - iotwireless + - signer + title: "'Amazon Web Services' Internet of Things Services" + description: >- + Interface to 'Amazon Web Services' internet of things ('IoT') services, + including data collection, management, and analysis for IoT devices. + . + +- name: game.development + services: + - gamelift + - gamesparks + - simspaceweaver + title: "'Amazon Web Services' Game Development Services" + description: >- + Interface to 'Amazon Web Services' game development services, including + 'GameLift' game server hosting . diff --git a/make.paws/inst/extdata/packages.yml b/make.paws/inst/extdata/packages.yml index 5f944432d1..aa46c28e03 100644 --- a/make.paws/inst/extdata/packages.yml +++ b/make.paws/inst/extdata/packages.yml @@ -28,10 +28,9 @@ - name: storage services: - backup - - backupstorage - dlm - ebs - - elasticfilesystem + - efs - finspace-data - fsx - glacier @@ -52,7 +51,7 @@ - docdb - docdb-elastic - dynamodb - - streams.dynamodb + - dynamodbstreams - elasticache - keyspaces - lakeformation @@ -87,7 +86,7 @@ - importexport - m2 - mgn - - AWSMigrationHub + - mgh - migrationhub-config - migration-hub-refactor-spaces - migrationhuborchestrator @@ -112,14 +111,16 @@ - arc-zonal-shift - backup-gateway - cloudfront + - cloudfront-keyvaluestore - directconnect - - elasticloadbalancing - - elasticloadbalancingv2 + - elb + - elbv2 - globalaccelerator - network-firewall - networkmanager - route53 - route53domains + - route53profiles - route53-recovery-cluster - route53-recovery-control-config - route53-recovery-readiness @@ -146,7 +147,7 @@ - codeguru-reviewer - codeguru-security - codepipeline - - codestar + - codeconnections - codestar-connections - codestar-notifications - drs @@ -193,6 +194,7 @@ - amp - application-autoscaling - application-insights + - application-signals - applicationcostprofiler - auditmanager - autoscaling @@ -202,7 +204,6 @@ - cloudtrail-data - config - controltower - - events - evidently - finspace - grafana @@ -212,7 +213,7 @@ - license-manager-linux-subscriptions - logs - internetmonitor - - monitoring + - cloudwatch - oam - opsworks - opsworkscm @@ -271,9 +272,9 @@ - forecast - frauddetector - lex-models - - models.lex.v2 - - runtime.lex - - runtime.lex.v2 + - lexv2-models + - lex-runtime + - lexv2-runtime - lookoutequipment - lookoutmetrics - machinelearning @@ -289,12 +290,14 @@ - sagemaker-featurestore-runtime - sagemaker-geospatial - sagemaker-metrics - - runtime.sagemaker + - sagemaker-runtime - textract - transcribe - translate - voice-id - bedrock + - bedrock-agent + - bedrock-agent-runtime - bedrock-runtime title: "'Amazon Web Services' Machine Learning Services" description: >- @@ -311,7 +314,7 @@ - datapipeline - datazone - es - - elasticmapreduce + - emr - entityresolution - firehose - glue @@ -326,7 +329,7 @@ - kinesis - kinesisanalytics - kinesisanalyticsv2 - - mturk-requester + - mturk - opensearch - opensearchserverless - osis @@ -343,6 +346,7 @@ - account - acm - acm-pca + - cleanroomsml - clouddirectory - cloudhsm - cloudhsmv2 @@ -358,7 +362,6 @@ - inspector - inspector2 - kms - - macie - macie2 - pca-connector-ad - ram @@ -391,9 +394,6 @@ - appconfigdata - appsync - devicefarm - - honeycode - - mobile - - mobileanalytics - privatenetworks title: "'Amazon Web Services' Mobile Services" description: >- @@ -408,7 +408,7 @@ - name: application.integration services: - - eventbridge + - events - location - mq - mwaa @@ -416,7 +416,7 @@ - resource-explorer-2 - schemas - scheduler - - states + - stepfunctions - sns - sqs - swf @@ -430,12 +430,13 @@ - name: cost.management services: - billingconductor + - billing - budgets - cur - ce - marketplace-catalog - marketplacecommerceanalytics - - entitlement.marketplace + - marketplace-entitlement - meteringmarketplace - pricing - savingsplans @@ -451,15 +452,16 @@ services: - connect - connectcampaigns + - connectcampaignsv2 - connectcases - connect-contact-lens - connectparticipant - - email - wisdom - customer-profiles - pinpoint - pinpoint-email - pinpoint-sms-voice-v2 + - ses - sesv2 - sms-voice title: "'Amazon Web Services' Customer Engagement Services" @@ -470,7 +472,6 @@ - name: business.applications services: - - alexaforbusiness - chime - chime-sdk-identity - chime-sdk-media-pipelines @@ -490,10 +491,9 @@ - name: end.user.computing services: - appstream + - chatbot - ivschat - - nimble - workdocs - - worklink - workmail - workmailmessageflow - workspaces @@ -519,7 +519,6 @@ - iotfleethub - iotfleetwise - iot-jobs-data - - iot-roborunner - iotsecuretunneling - iotsitewise - iotthingsgraph @@ -535,7 +534,6 @@ - name: game.development services: - gamelift - - gamesparks - simspaceweaver title: "'Amazon Web Services' Game Development Services" description: >- diff --git a/make.paws/man/category_service_ops_count.Rd b/make.paws/man/category_service_ops_count.Rd index 843cc9a60b..c94b9dd716 100644 --- a/make.paws/man/category_service_ops_count.Rd +++ b/make.paws/man/category_service_ops_count.Rd @@ -4,10 +4,10 @@ \alias{category_service_ops_count} \title{Helper function to count all operations by service and category} \usage{ -category_service_ops_count(in_dir = "../vendor/aws-sdk-js") +category_service_ops_count(in_dir = "../vendor/botocore") } \arguments{ -\item{in_dir}{Directory containing aws js sdk.} +\item{in_dir}{Directory containing botocore.} } \description{ Helper function to count all operations by service and category diff --git a/make.paws/man/list_aws_services.Rd b/make.paws/man/list_aws_services.Rd index 7673601e9a..96677d1680 100644 --- a/make.paws/man/list_aws_services.Rd +++ b/make.paws/man/list_aws_services.Rd @@ -2,13 +2,13 @@ % Please edit documentation in R/aws_services.R \name{list_aws_services} \alias{list_aws_services} -\title{Helper function to list all aws services and operations from awds js sdk} +\title{Helper function to list all aws services and operations from aws botocore} \usage{ -list_aws_services(in_dir = "../vendor/aws-sdk-js") +list_aws_services(in_dir = "../vendor/botocore") } \arguments{ -\item{in_dir}{Directory containing aws js sdk.} +\item{in_dir}{Directory containing aws botocore.} } \description{ -Helper function to list all aws services and operations from awds js sdk +Helper function to list all aws services and operations from aws botocore } diff --git a/make.paws/man/make_sdk.Rd b/make.paws/man/make_sdk.Rd index dce1f5d2d1..45ca4b90a6 100644 --- a/make.paws/man/make_sdk.Rd +++ b/make.paws/man/make_sdk.Rd @@ -5,7 +5,7 @@ \title{Make the AWS SDK R package} \usage{ make_sdk( - in_dir = "./vendor/aws-sdk-js", + in_dir = "./vendor/botocore", out_sdk_dir = "./cran", out_doc_dir = "./paws", apis = character(0), diff --git a/make.paws/man/paws_new_services.Rd b/make.paws/man/paws_new_services.Rd index 0d7ce81566..c20e05c8b6 100644 --- a/make.paws/man/paws_new_services.Rd +++ b/make.paws/man/paws_new_services.Rd @@ -4,7 +4,7 @@ \alias{paws_new_services} \title{lists new services from AWS} \usage{ -paws_new_services(in_dir = "../vendor/aws-sdk-js") +paws_new_services(in_dir = "../vendor/botocore") } \arguments{ \item{in_dir}{Directory containing AWS API input files.} diff --git a/make.paws/tests/testthat/test_make_sdk.R b/make.paws/tests/testthat/test_make_sdk.R index 967cb02397..ea4b41ea36 100644 --- a/make.paws/tests/testthat/test_make_sdk.R +++ b/make.paws/tests/testthat/test_make_sdk.R @@ -63,8 +63,9 @@ api <- list( ), documentation = "AWS Foo is an example AWS API." ) -api_path <- file.path(path_in, "apis", "foo-2018-11-01.normal.json") -dir.create(dirname(api_path), recursive = TRUE) + +api_path <- file.path(path_in, "botocore", "data","foo", "2018-11-01", "service-2.json") +dir.create(dirname(api_path), recursive = TRUE, showWarnings = FALSE) jsonlite::write_json(api, api_path, auto_unbox = TRUE) region_config <- list( @@ -74,8 +75,8 @@ region_config <- list( ) ) ) -region_config_path <- file.path(path_in, "lib", "region_config_data.json") -dir.create(dirname(region_config_path), recursive = TRUE) +region_config_path <- file.path(path_in, "botocore", "data", "endpoints.json") +dir.create(dirname(region_config_path), recursive = TRUE, showWarnings = FALSE) jsonlite::write_json(region_config, region_config_path, auto_unbox = TRUE) path_out <- file.path(path, "out") @@ -160,12 +161,10 @@ test_that("make_sdk with sub categories", { test_that("list_apis", { temp <- tempdir() + fs::dir_create(fs::path(temp, "data", c("api1", "api2"))) + write("skip", file.path(temp, "data", "skip.json")) - write("", file.path(temp, "api1-2018-01-01.normal.json")) - write("", file.path(temp, "api2-2018-01-01.normal.json")) - write("skip", file.path(temp, "skip.json")) - - actual <- list_apis(temp) + actual <- list_apis(file.path(temp, "data")) expected <- c("api1", "api2") expect_equal(actual, expected) }) diff --git a/make.paws/tests/testthat/test_read_api.R b/make.paws/tests/testthat/test_read_api.R index dc58dd9c78..a0fd47096a 100644 --- a/make.paws/tests/testthat/test_read_api.R +++ b/make.paws/tests/testthat/test_read_api.R @@ -1,36 +1,55 @@ write_json <- function(x, file) jsonlite::write_json(x, file, auto_unbox = TRUE) + test_that("read_api", { path <- tempdir() - api_path <- file.path(path, "apis") - dir.create(api_path) + api_path <- file.path(path, "botocore", "data") + dir.create(api_path, recursive = TRUE) + + # create api directory + api_dir <- file.path(api_path, "foo") + dir.create(api_dir, recursive = TRUE) + + # create different version directory + fs::dir_create(api_dir, "2018-11-01") + fs::dir_create(api_dir, "2017-11-01") + + write_json(list(foo = "examples"), file.path(api_dir, "2018-11-01", "examples-1.json")) - write_json(list(foo = "examples"), file.path(api_path, "foo-2018-11-01.examples.json")) - write_json(list(foo = "min"), file.path(api_path, "foo-2018-11-01.min.json")) write_json( - list(foo = "normal", name = "foo", metadata = list(endpointPrefix = "baz"), shapes = list(foo = list(eventstream = "TRUE"))), - file.path(api_path, "foo-2018-11-01.normal.json") + list(foo = "normal", name = "foo", metadata = list(endpointPrefix = "baz"), shapes = list( + fooOutput = list(members = list(Payload = list(shape = "fooStream"))), + fooStream = list(eventstream = "TRUE")) + ), + file.path(api_dir, "2018-11-01", "service-2.json") ) - write_json(list(foo = "paginators"), file.path(api_path, "foo-2018-11-01.paginators.json")) + write_json(list(foo = "paginators"), file.path(api_dir, "2018-11-01", "paginators-1.json")) - write_json(list(foo = "wrong1"), file.path(api_path, "foo-2017-11-01.examples.json")) - write_json(list(foo = "wrong2"), file.path(api_path, "foo-2017-11-01.min.json")) - write_json(list(foo = "wrong3"), file.path(api_path, "foo-2017-11-01.normal.json")) - write_json(list(foo = "wrong4"), file.path(api_path, "foo-2017-11-01.paginators.json")) + write_json(list(foo = "wrong1"), file.path(api_dir, "2017-11-01", "examples-1.json")) + write_json(list(foo = "wrong3"), file.path(api_dir, "2017-11-01", "service-2.json")) + write_json(list(foo = "wrong4"), file.path(api_dir, "2017-11-01", "paginators-1.json")) - region_path <- file.path(path, "lib") - dir.create(region_path) write_json( - list(rules = list("*/*" = list(endpoint = "bar"), "*/foo" = list(endpoint = "{service}.endpoint", globalEndpoint = TRUE))), - file.path(region_path, "region_config_data.json") + list( + partitions = list(list( + defaults=list(hostname="{service}.{region}.{dnsSuffix}"), + dnsSuffix = "amazonaws.com", + regionRegex = "^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$", + services = list(baz = list(endpoints = list("aws-global" = list(hostname = "baz.us-east-1.amazonaws.com",credentialScope = list(region = "us-east-1"))))) + ) + ) + ), + file.path(api_path, "endpoints.json") ) api <- read_api("foo", path) expect_equal(api$name, "foo") - expect_equal(api$region_config$`*`, list(endpoint = "baz.endpoint", global = TRUE)) - - expect_error(read_api("bar", api_path)) + expect_equal(api$operations$foo$eventstream, "TRUE") + expect_equal(api$region_config[["aws-global"]], list(endpoint = "baz.us-east-1.amazonaws.com", global = TRUE)) + expect_equal(api$region_config[["us-east-1"]], list(endpoint = "baz.us-east-1.amazonaws.com", global = TRUE)) + expect_equal(api$region_config[["^(us|eu|ap|sa|ca|me|af|il|mx)\\\\-\\\\w+\\\\-\\\\d+$"]], list(endpoint = "baz.{region}.amazonaws.com", global = FALSE)) + expect_error(read_api("bar", path)) }) test_that("merge_examples", { diff --git a/vendor/aws-sdk-js b/vendor/aws-sdk-js deleted file mode 160000 index 966fa6c316..0000000000 --- a/vendor/aws-sdk-js +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 966fa6c316dbb11ca9277564ff7120e6b16467f4