From 622f8729e054a0af7e555e82d0de2be0cb1dec19 Mon Sep 17 00:00:00 2001 From: Praneeth AIS Date: Thu, 25 Apr 2024 03:03:51 -0400 Subject: [PATCH] started building s3 connector --- .DS_Store | Bin 0 -> 6148 bytes .../integrations/source/s3/client.rb | 56 ++++++++++++++++++ .../integrations/source/s3/config/meta.json | 15 +++++ .../integrations/source/s3/config/spec.json | 34 +++++++++++ .../integrations/source/s3/icon.svg | 12 ++++ 5 files changed, 117 insertions(+) create mode 100644 .DS_Store create mode 100644 integrations/lib/multiwoven/integrations/source/s3/client.rb create mode 100644 integrations/lib/multiwoven/integrations/source/s3/config/meta.json create mode 100644 integrations/lib/multiwoven/integrations/source/s3/config/spec.json create mode 100644 integrations/lib/multiwoven/integrations/source/s3/icon.svg diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..ce63209d0aa91bee6aef438ca181202a2672915d GIT binary patch literal 6148 zcmeHK-D(p-82u)V&Bjy=MWHvsg12dmO;t*7Vt$l@M(C!BsKniFs7tpyVK-@z5XiN@ zgRkJNPvX0HrDuMMn{5hSh)9?ZX3qS4XJ+Tjw>vvT#F}IOK2e#7EF^*X>&TXv=ojgd z<#fvikjXLn^n#vHpISg;MggP1|E_>|cQ@tx+NKWP+~4nSm)dlMo*q@{jQoR;AA2G9 z;4eNFkCCcBrJ+Q0Q;yMv_aPln6U-j4OHY@wzh>B*T#U{D_ha@AIGXyh$?DEB@vU!yp;eYTsFIEq`sjU=^&A z_0IXgC(g(njgzJuzY(<_=b?8|cD-ODy`-lD0@GRn=uof7@*H_vN zjTa!+dZjMsP8@|iI)RVi7w8#wtc57(l0%)0YCqtS-tQvzxq~QZ({tdG2+4_Y(~L59 zWk4a4D|dApd&A{^CCm6S!oH*;tR$Wa&vzsvtVgexvP5L1S?hAHn9eb8oLQ5IptNs} z#uQ|Hgo0@wR9D7y)L5mJS&>{TdqQ3KgB0zI-q}Gt)N|CTGX^wsa@fP-t?afKgyk zfi+bvi}Sy8_5FX5WNJnMqrgfj!18UU-Ncgg*?MVl;;gli-XjSUeshJAf=nOBvLKG) dEhK5^vqb^e&^T9!7MS@FkTRIeDDY1e_yq=R+qD1y literal 0 HcmV?d00001 diff --git a/integrations/lib/multiwoven/integrations/source/s3/client.rb b/integrations/lib/multiwoven/integrations/source/s3/client.rb new file mode 100644 index 00000000..0214d4ec --- /dev/null +++ b/integrations/lib/multiwoven/integrations/source/s3/client.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +require "aws-sdk-s3" + +module Multiwoven::Integrations::Source + module S3 + include Multiwoven::Integrations::Core + class Client < SourceConnector + def check_connection(connection_config) + # WIP + s3 = create_connection(connection_config) + ConnectionStatus.new(status: ConnectionStatusType["succeeded"]).to_multiwoven_message + rescue StandardError => e + ConnectionStatus.new(status: ConnectionStatusType["failed"], message: e.message).to_multiwoven_message + end + + def discover(connection_config) + # TODO: implement + rescue StandardError => e + handle_exception( + "S3:DISCOVER:EXCEPTION", + "error", + e + ) + end + + def read(sync_config) + # TODO: implement + rescue StandardError => e + handle_exception( + "S3:READ:EXCEPTION", + "error", + e + ) + end + + private + + def query(connection, query) + # TODO: implement + end + + def create_connection(connection_config) + # TODO: implement + end + + def create_streams(records) + # TODO: implement + end + + def group_by_table(records) + # TODO: implement + end + end + end +end diff --git a/integrations/lib/multiwoven/integrations/source/s3/config/meta.json b/integrations/lib/multiwoven/integrations/source/s3/config/meta.json new file mode 100644 index 00000000..18cc75da --- /dev/null +++ b/integrations/lib/multiwoven/integrations/source/s3/config/meta.json @@ -0,0 +1,15 @@ +{ + "data": { + "name": "S3", + "title": "AWS S3", + "connector_type": "source", + "category": "Cloud Storage", + "documentation_url": "https://docs.mutliwoven.com", + "github_issue_label": "source-s3", + "icon": "icon.svg", + "license": "MIT", + "release_stage": "alpha", + "support_level": "community", + "tags": ["language:ruby", "multiwoven", "storage", "aws"] + } +} diff --git a/integrations/lib/multiwoven/integrations/source/s3/config/spec.json b/integrations/lib/multiwoven/integrations/source/s3/config/spec.json new file mode 100644 index 00000000..429196c1 --- /dev/null +++ b/integrations/lib/multiwoven/integrations/source/s3/config/spec.json @@ -0,0 +1,34 @@ +{ + "documentation_url": "https://docs.aws.amazon.com/s3/?icmpid=docs_homepage_featuredsvcs", + "stream_type": "static", + "connector_query_type": "none", + "connection_specification": { + "$schema": "", + "title": "Amazon S3", + "type": "object", + "required": ["access_key_id", "secret_access_key", "region", "bucket_name"], + "properties": { + "access_key_id": { + "type": "string", + "description": "Your AWS Access Key ID, which is provided when you create a new IAM user in your AWS account.", + "title": "AWS Access Key ID" + }, + "secret_access_key": { + "type": "string", + "description": "Your AWS Secret Access Key, which is provided along with the Access Key ID when you create a new IAM user. This key should be kept confidential.", + "title": "AWS Secret Access Key" + }, + "region": { + "type": "string", + "description": "The AWS Region where your S3 bucket is located. Example regions include us-east-1, eu-west-1, etc. This is critical for connecting to the correct regional endpoint.", + "title": "AWS Region" + }, + "bucket_name": { + "type": "string", + "description": "The name of the S3 bucket you wish to access. Bucket names are globally unique across all existing bucket names in Amazon S3.", + "title": "S3 Bucket Name" + }, + "credentials_json": { } + } + } +} diff --git a/integrations/lib/multiwoven/integrations/source/s3/icon.svg b/integrations/lib/multiwoven/integrations/source/s3/icon.svg new file mode 100644 index 00000000..6a2edca0 --- /dev/null +++ b/integrations/lib/multiwoven/integrations/source/s3/icon.svg @@ -0,0 +1,12 @@ + + + Icon-Architecture/32/Arch_Amazon-Simple-Storage-Service_32 + + + + + + + + + \ No newline at end of file