Git Product home page Git Product logo

download-images-to-s3-api's Introduction

Download Image to S3 Bucket API

  • Description: This API takes URL as input to download and store images to S3 bucket
  • Language: Python Flask
  • Platform: Docker & AWS (ECS, Fargate, Cloudformation, RDS, IAM, VPC and S3)
  • Author: Bhargav Amin

Steps to setup

  • Step 1: Setup infrastructure from infrastructure dir.
  • Step 2: Run and Deploy APP

Refer infrastructure/README.md for setup and deployment details.

API Usage

List all the images from S3 bucket

Defination

GET /list

Response

  • 200 OK on success
  • 204 No Content on no files found in S3 bucket
  • 403 Forbidden error on issue with S3 bucket permissions or no bucket found

Submitting a download request

Defination

POST /

Arguments

  • "url":string image url

Request Send request as raw json. For eg.

{
	"url": "https://example.com/demo.jpg"
}

Response

  • 200 OK on success
  • 400 BAD REQUEST on invalid url
  • 404 NOT FOUND on image format matched
  • 500 Internal Server Error on database connection failure

API home page display README.md

Defination

GET /

Response

  • 200 OK on success

API health check endpoint

Defination

GET /ping

Response

  • 200 OK on success

Development Setup

Build and test application in docker locally.

Build docker image locally

For app directory execute following commands:

  • To build app: docker-compose build
  • To run app: docker-compose up

Command to list docker images:

docker images

Command to run docker image:

docker run -p 80:80 --name=api -d api_image_to_s3

Command to login to container:

docker exec -it <container id> /bin/bash

Command to view container logs:

docker container logs <container id>

download-images-to-s3-api's People

Contributors

bhargavamin avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.