Posts

Showing posts from May, 2021

Upload object to s3 using aws api gateway service proxy / API Gateway Proxy for S3 with subdirectories

Image
  This is guideline how to create the AWS API Gateway Assumption: S3 bucket name: "us-east-1-dev" and folders: --> light/ --> test_1/ --> pdfs/ Create the REST API Created a resource proxy select service proxy  Resource Name*: proxy Resource Path*: {proxy+} Click Create API select the option: HTTP proxy Endpoint URL: (key anything) e.g:  https://testing.com/{proxy} click Save Next, choose "Integration Request"  Integration type: AWS service select the desired region select the desired aws service(s3 in my case) In subdomain give bucket name (e.g: xxxx- us-east-1-dev) HTTP method: select "PUT" if you want to upload a object. "GET" if you want to get the object. Here is "PUT" In path override give Path override: {proxy} (because to pass the bucketname dynamically) finally for api gateway service proxy we need to add the arn for detail explanation on creation of arn follow the document  http://docs.aws.amazon.com/apigateway/latest...

AWS API gateway, S3

Image
  Tutorial: Create a REST API as an Amazon S3 proxy in API Gateway - Amazon API Gateway Using REST API to upload files to the S3 bucket - BlueGrid : BlueGrid AIM role Edit Trust Relationship {   "Version": "2012-10-17",   "Statement": [     {       "Effect": "Allow",       "Principal": {         "Service": "s3.amazonaws.com"       },       "Action": "sts:AssumeRole"     },     {       "Effect": "Allow",       "Principal": {         "Service": "apigateway.amazonaws.com"       },       "Action": "sts:AssumeRole"     }   ] } Next, go to API Gateway --> create a REST API. Create the folder & item resource create GET -->  with "tanldttestingapigateway" is a S3 bucket name. /{folder}/{item} - GET - Method Execution --> to add URL path parameters Create the fo...

Object Oriented review - Abstract, inherent, Virtual

  Abstract class: using System; namespace App {     public abstract class Saleman     {         private string _firstname;         private string _lastname;         public string Fullname { get {                 return string.Format("{0} {1}", this._firstname, this._lastname);             } }         public Saleman(string firstname, string lastname)         {             this._firstname = firstname;             this._lastname = lastname;         }         public abstract void Sell();     } } ---------------------------------- using System; namespace App {     public class CarSalePerson : Saleman     {         public CarSalePerson(string firstname, ...

Sample steps to create the API with Angular page

Code first DB:  dotnet tool install --global dotnet-ef dotnet ef migrations add "Initial" -o "Data/Migrations" dotnet ef database update ng g c employee --module app --skipTests=true External libraries:           @angular/material (Angular npm package)       Doing this will trigger the Angular Material command-line setup wizard, which will install the following npm packages: --> npm install xxxxx @angular/material @angular/cdk  (prerequisite) System.Linq.Dynamic.Core (.NET Core NuGet package) Microsoft.EntityFrameworkCore NuGet package      Microsoft.EntityFrameworkCore.Tools NuGet package      Microsoft.EntityFrameworkCore.SqlServer NuGet package If we prefer to do this using the NuGet package manager command line, we can input the following:    PM> Install-Package Microsoft.EntityFrameworkCore -Version 5.0.0 PM> Install-Package Microsoft.EntityFrameworkCore.Tools -Version 5.0.0...

ASP.NET Core 5 and Angular

Image
  Installing the Angular CLI npm install -g @angular/cli@11.0.1  or the latest. npm install -g @angular/cli@latest Creating a new Angular app ng new ClientHREmp Wait for  the tool to complete the task, and then do the following: Type  cd ClientHREmp  to enter the newly created folder Execute the  npm install  and  npm update  commands to update the npm packages Switch client app by updating the Startup.cs file configuration.RootPath = "ClientApp/dist" ; --> configuration.RootPath = "ClientHREmp/dist" ; spa.Options.SourcePath = "ClientApp" ; --> spa.Options.SourcePath = "ClientHREmp" ; ---------------------------------------------------- dotnet new angular -o  HREmp CREATING COMPONENTS USING THE ANGULAR CLI ng generate component health-check --skipTests=true OR ng g c employee --module app --skipTests=true -------------------------------------- Create the sample API to return a "Hello world" by get route      [Ro...

Selenium - selenium-python-automation

  https://learning.oreilly.com/videos/selenium-python-automation/9781800567733