--- swagger: "2.0" info: description: "AI Photo Search application, built during the Cloud and Big Data course\ \ at NYU." version: "1.0.0" title: "AI Photo Search" host: "frvui7zufb.execute-api.us-east-1.amazonaws.com" basePath: "/dev" schemes: - "https" paths: /search: get: operationId: "searchPhotos" produces: - "application/json" parameters: - name: "q" in: "query" required: false type: "string" responses: "200": description: "200 response" schema: $ref: "#/definitions/SearchResponse" headers: Access-Control-Allow-Origin: type: "string" Access-Control-Allow-Methods: type: "string" Access-Control-Allow-Headers: type: "string" "500": description: "500 response" schema: $ref: "#/definitions/Error" "403": description: "403 response" schema: $ref: "#/definitions/Error" x-amazon-apigateway-integration: httpMethod: "POST" uri: "arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:920848894865:function:search-photos/invocations" responses: default: statusCode: "200" responseParameters: method.response.header.Access-Control-Allow-Origin: "'*'" passthroughBehavior: "when_no_match" contentHandling: "CONVERT_TO_TEXT" type: "aws_proxy" options: consumes: - "application/json" produces: - "application/json" responses: "200": description: "200 response" schema: $ref: "#/definitions/Empty" headers: Access-Control-Allow-Origin: type: "string" Access-Control-Allow-Methods: type: "string" Access-Control-Allow-Headers: type: "string" x-amazon-apigateway-integration: responses: default: statusCode: "200" responseParameters: method.response.header.Access-Control-Allow-Methods: "'GET,OPTIONS'" method.response.header.Access-Control-Allow-Headers: "'*'" method.response.header.Access-Control-Allow-Origin: "'*'" requestTemplates: application/json: "{\"statusCode\": 200}" passthroughBehavior: "when_no_match" type: "mock" /upload/{bucket}/{key}: put: operationId: "uploadPhoto" produces: - "application/json" parameters: - name: "Content-Type" in: "header" required: false type: "string" - name: "Accept" in: "header" required: false type: "string" - name: "x-amz-meta-customLabels" in: "header" required: false type: "string" - name: "key" in: "path" required: true type: "string" - name: "bucket" in: "path" required: true type: "string" responses: "200": description: "200 response" schema: $ref: "#/definitions/Empty" headers: Access-Control-Allow-Origin: type: "string" Access-Control-Allow-Methods: type: "string" Access-Control-Allow-Headers: type: "string" "500": description: "500 response" headers: Access-Control-Allow-Origin: type: "string" Access-Control-Allow-Methods: type: "string" Access-Control-Allow-Headers: type: "string" "403": description: "403 response" headers: Access-Control-Allow-Origin: type: "string" Access-Control-Allow-Methods: type: "string" Access-Control-Allow-Headers: type: "string" x-amazon-apigateway-integration: credentials: "arn:aws:iam::920848894865:role/API-S3-access" httpMethod: "PUT" uri: "arn:aws:apigateway:us-east-1:s3:path/{bucket}/{key}" responses: "4\\d{2}": statusCode: "403" default: statusCode: "200" responseParameters: method.response.header.Access-Control-Allow-Methods: "'*'" method.response.header.Access-Control-Allow-Headers: "'*'" method.response.header.Access-Control-Allow-Origin: "'*'" responseTemplates: application/json: "## See http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html\n\ ## This template will pass through all parameters including path,\ \ querystring, header, stage variables, and context through to the\ \ integration endpoint via the body/payload\n#set($allParams = $input.params())\n\ {\n\"body-json\" : $input.json('$'),\n\"params\" : {\n#foreach($type\ \ in $allParams.keySet())\n #set($params = $allParams.get($type))\n\ \"$type\" : {\n #foreach($paramName in $params.keySet())\n \"\ $paramName\" : \"$util.escapeJavaScript($params.get($paramName))\"\ \n #if($foreach.hasNext),#end\n #end\n}\n #if($foreach.hasNext),#end\n\ #end\n},\n\"stage-variables\" : {\n#foreach($key in $stageVariables.keySet())\n\ \"$key\" : \"$util.escapeJavaScript($stageVariables.get($key))\"\n\ \ #if($foreach.hasNext),#end\n#end\n},\n\"context\" : {\n \"\ account-id\" : \"$context.identity.accountId\",\n \"api-id\" :\ \ \"$context.apiId\",\n \"api-key\" : \"$context.identity.apiKey\"\ ,\n \"authorizer-principal-id\" : \"$context.authorizer.principalId\"\ ,\n \"caller\" : \"$context.identity.caller\",\n \"cognito-authentication-provider\"\ \ : \"$context.identity.cognitoAuthenticationProvider\",\n \"cognito-authentication-type\"\ \ : \"$context.identity.cognitoAuthenticationType\",\n \"cognito-identity-id\"\ \ : \"$context.identity.cognitoIdentityId\",\n \"cognito-identity-pool-id\"\ \ : \"$context.identity.cognitoIdentityPoolId\",\n \"http-method\"\ \ : \"$context.httpMethod\",\n \"stage\" : \"$context.stage\",\n\ \ \"source-ip\" : \"$context.identity.sourceIp\",\n \"user\"\ \ : \"$context.identity.user\",\n \"user-agent\" : \"$context.identity.userAgent\"\ ,\n \"user-arn\" : \"$context.identity.userArn\",\n \"request-id\"\ \ : \"$context.requestId\",\n \"resource-id\" : \"$context.resourceId\"\ ,\n \"resource-path\" : \"$context.resourcePath\"\n }\n}\n" "5\\d{2}": statusCode: "500" requestParameters: integration.request.header.Accept: "method.request.header.Accept" integration.request.header.x-amz-meta-customLabels: "method.request.header.x-amz-meta-customLabels" integration.request.path.key: "method.request.path.key" integration.request.path.bucket: "method.request.path.bucket" integration.request.header.Content-Type: "method.request.header.Content-Type" passthroughBehavior: "when_no_templates" type: "aws" options: consumes: - "application/json" produces: - "application/json" parameters: - name: "bucket" in: "path" required: true type: "string" - name: "key" in: "path" required: true type: "string" responses: "200": description: "200 response" schema: $ref: "#/definitions/Empty" headers: Access-Control-Allow-Origin: type: "string" Access-Control-Allow-Methods: type: "string" Access-Control-Allow-Headers: type: "string" x-amazon-apigateway-integration: responses: default: statusCode: "200" responseParameters: method.response.header.Access-Control-Allow-Methods: "'OPTIONS,PUT'" method.response.header.Access-Control-Allow-Headers: "'*'" method.response.header.Access-Control-Allow-Origin: "'*'" requestTemplates: application/json: "{\"statusCode\": 200}" passthroughBehavior: "when_no_match" type: "mock" definitions: Empty: {} Error: type: "object" properties: code: type: "integer" format: "int32" message: type: "string" Photo: type: "object" properties: url: type: "string" labels: type: "array" items: type: "string" SearchResponse: type: "object" properties: results: type: "array" items: $ref: "#/definitions/Photo" x-amazon-apigateway-gateway-responses: DEFAULT_5XX: responseParameters: gatewayresponse.header.Access-Control-Allow-Methods: "'OPTIONS,PUT'" gatewayresponse.header.Access-Control-Allow-Origin: "'*'" gatewayresponse.header.Access-Control-Allow-Headers: "'*'" DEFAULT_4XX: responseParameters: gatewayresponse.header.Access-Control-Allow-Methods: "'OPTIONS,PUT'" gatewayresponse.header.Access-Control-Allow-Origin: "'*'" gatewayresponse.header.Access-Control-Allow-Headers: "'*'" x-amazon-apigateway-binary-media-types: - "*/*"