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
@Controller | |
@RequestMapping("/rest") | |
public class MyController { | |
@GetMapping("/get") | |
public ResponseEntity<String> getExample() { | |
return new ResponseEntity<String>("Get Example", HttpStatus.OK); | |
} | |
@GetMapping("/getvar/{id}") | |
public ResponseEntity<String> getExampleWithVariable(@PathVariable String id){ | |
return new ResponseEntity<String>("Get With Variable Example" +id,HttpStatus.OK); } |
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
@RestController | |
@RequestMapping("/rest") | |
public class MyRestController { | |
@RequestMapping(value="/requestparamexample", method = RequestMethod.GET) | |
public ResponseEntity<String> getRequestParmParam(@RequestParam("value") String value) { | |
System.out.println("Request Param Value: "+value); | |
return new ResponseEntity<String>(value,HttpStatus.OK); | |
} | |
} |
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
@RestController | |
@RequestMapping("/rest") | |
public class MyRestController { | |
@RequestMapping(value="/pathparamexample/{value}", method = RequestMethod.GET) | |
public ResponseEntity<String> getPathParam(@PathVariable String value) { | |
System.out.println("Path Variable Value: "+value); | |
return new ResponseEntity<String>(value,HttpStatus.OK); | |
} | |
} |
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
@RestController | |
@RequestMapping("/rest") | |
public class MyRestController { | |
@RequestMapping(value="/getdata", method = RequestMethod.GET, produces = "application/json; charset=UTF-8") | |
public String getMyData() { | |
JSONObject obj=new JSONObject(); | |
obj.put("name","Anish Antony"); | |
obj.put("age",27); | |
obj.put("salary",10000); | |
return obj.toJSONString(); |
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
@Controller | |
@RequestMapping("/rest1") | |
public class MyController { | |
@RequestMapping(value="/getdata", method = RequestMethod.GET, produces = "application/json; charset=UTF-8") | |
@ResponseBody | |
public String getMyData() { | |
JSONObject obj=new JSONObject(); | |
obj.put("name","Anish Antony"); | |
obj.put("age",27); | |
obj.put("salary",10000); |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Action": "ec2:*", | |
"Effect": "Allow", | |
"Resource": "*" | |
}, | |
{ | |
"Effect": "Allow", |
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
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.lici.lambda</groupId> | |
<artifactId>sample-lambda-application</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<dependencies> | |
<dependency> | |
<groupId>com.amazonaws</groupId> |
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
package com.lici.lambda; | |
import java.util.Map; | |
import com.amazonaws.services.lambda.runtime.Context; | |
import com.amazonaws.services.lambda.runtime.LambdaLogger; | |
import com.amazonaws.services.lambda.runtime.RequestHandler; | |
public class MainHandler implements RequestHandler<Map<String,String>, String>{ | |
@Override |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Action": "ec2:*", | |
"Effect": "Allow", | |
"Resource": "*" | |
}, | |
{ | |
"Effect": "Allow", |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "PublicReadGetObject", | |
"Effect": "Allow", | |
"Principal": "*", | |
"Action": "s3:GetObject", | |
"Resource": "arn:aws:s3:::anishantony/*" | |
} |
NewerOlder