Die vorliegende Übersetzung wurde maschinell erstellt. Im Falle eines Konflikts oder eines Widerspruchs zwischen dieser übersetzten Fassung und der englischen Fassung (einschließlich infolge von Verzögerungen bei der Übersetzung) ist die englische Fassung maßgeblich.
APIDefinitionen des Beispiels API als Amazon S3 S3-Proxy öffnen
Die folgenden offenen API Definitionen beschreiben eineAPI, die als Amazon S3 S3-Proxy funktioniert. Dies API enthält mehr Amazon S3 S3-Operationen als die, die API Sie im Tutorial erstellt haben. Die folgenden Methoden sind in den API Open-Definitionen enthalten:
-
GETAuf der API Root-Ressource verfügbar machen, um alle Amazon S3 S3-Buckets eines Aufrufers aufzulisten.
-
In GET einer Ordnerressource verfügbar machen, um eine Liste aller Objekte in einem Amazon S3 S3-Bucket anzuzeigen.
-
PUTAuf einer Ordnerressource verfügbar machen, um Amazon S3 einen Bucket hinzuzufügen.
-
DELETEAuf einer Ordnerressource verfügbar machen, um einen Bucket aus Amazon S3 zu entfernen.
-
GETAuf einer Ordner-/Artikelressource verfügbar machen, um ein Objekt aus einem Amazon S3 S3-Bucket anzusehen oder herunterzuladen.
-
PUTAuf einer Ordner-/Artikelressource verfügbar machen, um ein Objekt in einen Amazon S3 S3-Bucket hochzuladen.
-
HEADAuf einer Ordner-/Artikelressource verfügbar machen, um Objektmetadaten in einem Amazon S3 S3-Bucket abzurufen.
-
DELETEAuf einer Ordner-/Artikelressource verfügbar machen, um ein Objekt aus einem Amazon S3 S3-Bucket zu entfernen.
Anweisungen zum Importieren und API Verwenden der API Open-Definition finden Sie unter. Entwickeln REST APIs mit Open API in API Gateway
Anweisungen zum Erstellen einer ähnlichen API Datei finden Sie unterTutorial: Einen REST API als Amazon S3 S3-Proxy erstellen.
Informationen darüber, wie Sie dies API mit Postman
- OpenAPI 2.0
-
{ "swagger": "2.0", "info": { "version": "2016-10-13T23:04:43Z", "title": "MyS3" }, "host": "9gn28ca086.execute-api.
{region}
.amazonaws.com", "basePath": "/S3", "schemes": [ "https" ], "paths": { "/": { "get": { "produces": [ "application/json" ], "responses": { "200": { "description": "200 response", "schema": { "$ref": "#/definitions/Empty" }, "headers": { "Content-Length": { "type": "string" }, "Timestamp": { "type": "string" }, "Content-Type": { "type": "string" } } }, "400": { "description": "400 response" }, "500": { "description": "500 response" } }, "security": [ { "sigv4": [] } ], "x-amazon-apigateway-integration": { "credentials": "arn:aws:iam::123456789012
:role/apigAwsProxyRole", "responses": { "4\\d{2}": { "statusCode": "400" }, "default": { "statusCode": "200", "responseParameters": { "method.response.header.Content-Type": "integration.response.header.Content-Type", "method.response.header.Content-Length": "integration.response.header.Content-Length", "method.response.header.Timestamp": "integration.response.header.Date" } }, "5\\d{2}": { "statusCode": "500" } }, "uri": "arn:aws:apigateway:us-west-2:s3:path//", "passthroughBehavior": "when_no_match", "httpMethod": "GET", "type": "aws" } } }, "/{folder}": { "get": { "produces": [ "application/json" ], "parameters": [ { "name": "folder", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "200 response", "schema": { "$ref": "#/definitions/Empty" }, "headers": { "Content-Length": { "type": "string" }, "Date": { "type": "string" }, "Content-Type": { "type": "string" } } }, "400": { "description": "400 response" }, "500": { "description": "500 response" } }, "security": [ { "sigv4": [] } ], "x-amazon-apigateway-integration": { "credentials": "arn:aws:iam::123456789012
:role/apigAwsProxyRole", "responses": { "4\\d{2}": { "statusCode": "400" }, "default": { "statusCode": "200", "responseParameters": { "method.response.header.Content-Type": "integration.response.header.Content-Type", "method.response.header.Date": "integration.response.header.Date", "method.response.header.Content-Length": "integration.response.header.content-length" } }, "5\\d{2}": { "statusCode": "500" } }, "requestParameters": { "integration.request.path.bucket": "method.request.path.folder" }, "uri": "arn:aws:apigateway:us-west-2:s3:path/{bucket}", "passthroughBehavior": "when_no_match", "httpMethod": "GET", "type": "aws" } }, "put": { "produces": [ "application/json" ], "parameters": [ { "name": "Content-Type", "in": "header", "required": false, "type": "string" }, { "name": "folder", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "200 response", "schema": { "$ref": "#/definitions/Empty" }, "headers": { "Content-Length": { "type": "string" }, "Content-Type": { "type": "string" } } }, "400": { "description": "400 response" }, "500": { "description": "500 response" } }, "security": [ { "sigv4": [] } ], "x-amazon-apigateway-integration": { "credentials": "arn:aws:iam::123456789012
:role/apigAwsProxyRole", "responses": { "4\\d{2}": { "statusCode": "400" }, "default": { "statusCode": "200", "responseParameters": { "method.response.header.Content-Type": "integration.response.header.Content-Type", "method.response.header.Content-Length": "integration.response.header.Content-Length" } }, "5\\d{2}": { "statusCode": "500" } }, "requestParameters": { "integration.request.path.bucket": "method.request.path.folder", "integration.request.header.Content-Type": "method.request.header.Content-Type" }, "uri": "arn:aws:apigateway:us-west-2:s3:path/{bucket}", "passthroughBehavior": "when_no_match", "httpMethod": "PUT", "type": "aws" } }, "delete": { "produces": [ "application/json" ], "parameters": [ { "name": "folder", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "200 response", "schema": { "$ref": "#/definitions/Empty" }, "headers": { "Date": { "type": "string" }, "Content-Type": { "type": "string" } } }, "400": { "description": "400 response" }, "500": { "description": "500 response" } }, "security": [ { "sigv4": [] } ], "x-amazon-apigateway-integration": { "credentials": "arn:aws:iam::123456789012
:role/apigAwsProxyRole", "responses": { "4\\d{2}": { "statusCode": "400" }, "default": { "statusCode": "200", "responseParameters": { "method.response.header.Content-Type": "integration.response.header.Content-Type", "method.response.header.Date": "integration.response.header.Date" } }, "5\\d{2}": { "statusCode": "500" } }, "requestParameters": { "integration.request.path.bucket": "method.request.path.folder" }, "uri": "arn:aws:apigateway:us-west-2:s3:path/{bucket}", "passthroughBehavior": "when_no_match", "httpMethod": "DELETE", "type": "aws" } } }, "/{folder}/{item}": { "get": { "produces": [ "application/json" ], "parameters": [ { "name": "item", "in": "path", "required": true, "type": "string" }, { "name": "folder", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "200 response", "schema": { "$ref": "#/definitions/Empty" }, "headers": { "content-type": { "type": "string" }, "Content-Type": { "type": "string" } } }, "400": { "description": "400 response" }, "500": { "description": "500 response" } }, "security": [ { "sigv4": [] } ], "x-amazon-apigateway-integration": { "credentials": "arn:aws:iam::123456789012
:role/apigAwsProxyRole", "responses": { "4\\d{2}": { "statusCode": "400" }, "default": { "statusCode": "200", "responseParameters": { "method.response.header.content-type": "integration.response.header.content-type", "method.response.header.Content-Type": "integration.response.header.Content-Type" } }, "5\\d{2}": { "statusCode": "500" } }, "requestParameters": { "integration.request.path.object": "method.request.path.item", "integration.request.path.bucket": "method.request.path.folder" }, "uri": "arn:aws:apigateway:us-west-2:s3:path/{bucket}/{object}", "passthroughBehavior": "when_no_match", "httpMethod": "GET", "type": "aws" } }, "head": { "produces": [ "application/json" ], "parameters": [ { "name": "item", "in": "path", "required": true, "type": "string" }, { "name": "folder", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "200 response", "schema": { "$ref": "#/definitions/Empty" }, "headers": { "Content-Length": { "type": "string" }, "Content-Type": { "type": "string" } } }, "400": { "description": "400 response" }, "500": { "description": "500 response" } }, "security": [ { "sigv4": [] } ], "x-amazon-apigateway-integration": { "credentials": "arn:aws:iam::123456789012
:role/apigAwsProxyRole", "responses": { "4\\d{2}": { "statusCode": "400" }, "default": { "statusCode": "200", "responseParameters": { "method.response.header.Content-Type": "integration.response.header.Content-Type", "method.response.header.Content-Length": "integration.response.header.Content-Length" } }, "5\\d{2}": { "statusCode": "500" } }, "requestParameters": { "integration.request.path.object": "method.request.path.item", "integration.request.path.bucket": "method.request.path.folder" }, "uri": "arn:aws:apigateway:us-west-2:s3:path/{bucket}/{object}", "passthroughBehavior": "when_no_match", "httpMethod": "HEAD", "type": "aws" } }, "put": { "produces": [ "application/json" ], "parameters": [ { "name": "Content-Type", "in": "header", "required": false, "type": "string" }, { "name": "item", "in": "path", "required": true, "type": "string" }, { "name": "folder", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "200 response", "schema": { "$ref": "#/definitions/Empty" }, "headers": { "Content-Length": { "type": "string" }, "Content-Type": { "type": "string" } } }, "400": { "description": "400 response" }, "500": { "description": "500 response" } }, "security": [ { "sigv4": [] } ], "x-amazon-apigateway-integration": { "credentials": "arn:aws:iam::123456789012
:role/apigAwsProxyRole", "responses": { "4\\d{2}": { "statusCode": "400" }, "default": { "statusCode": "200", "responseParameters": { "method.response.header.Content-Type": "integration.response.header.Content-Type", "method.response.header.Content-Length": "integration.response.header.Content-Length" } }, "5\\d{2}": { "statusCode": "500" } }, "requestParameters": { "integration.request.path.object": "method.request.path.item", "integration.request.path.bucket": "method.request.path.folder", "integration.request.header.Content-Type": "method.request.header.Content-Type" }, "uri": "arn:aws:apigateway:us-west-2:s3:path/{bucket}/{object}", "passthroughBehavior": "when_no_match", "httpMethod": "PUT", "type": "aws" } }, "delete": { "produces": [ "application/json" ], "parameters": [ { "name": "item", "in": "path", "required": true, "type": "string" }, { "name": "folder", "in": "path", "required": true, "type": "string" } ], "responses": { "200": { "description": "200 response", "schema": { "$ref": "#/definitions/Empty" }, "headers": { "Content-Length": { "type": "string" }, "Content-Type": { "type": "string" } } }, "400": { "description": "400 response" }, "500": { "description": "500 response" } }, "security": [ { "sigv4": [] } ], "x-amazon-apigateway-integration": { "credentials": "arn:aws:iam::123456789012
:role/apigAwsProxyRole", "responses": { "4\\d{2}": { "statusCode": "400" }, "default": { "statusCode": "200" }, "5\\d{2}": { "statusCode": "500" } }, "requestParameters": { "integration.request.path.object": "method.request.path.item", "integration.request.path.bucket": "method.request.path.folder" }, "uri": "arn:aws:apigateway:us-west-2:s3:path/{bucket}/{object}", "passthroughBehavior": "when_no_match", "httpMethod": "DELETE", "type": "aws" } } } }, "securityDefinitions": { "sigv4": { "type": "apiKey", "name": "Authorization", "in": "header", "x-amazon-apigateway-authtype": "awsSigv4" } }, "definitions": { "Empty": { "type": "object", "title": "Empty Schema" } } } - OpenAPI 3.0
-
{ "openapi" : "3.0.1", "info" : { "title" : "MyS3", "version" : "2016-10-13T23:04:43Z" }, "servers" : [ { "url" : "https://9gn28ca086.execute-api.
{region}
.amazonaws.com/{basePath}", "variables" : { "basePath" : { "default" : "S3" } } } ], "paths" : { "/{folder}" : { "get" : { "parameters" : [ { "name" : "folder", "in" : "path", "required" : true, "schema" : { "type" : "string" } } ], "responses" : { "400" : { "description" : "400 response", "content" : { } }, "500" : { "description" : "500 response", "content" : { } }, "200" : { "description" : "200 response", "headers" : { "Content-Length" : { "schema" : { "type" : "string" } }, "Date" : { "schema" : { "type" : "string" } }, "Content-Type" : { "schema" : { "type" : "string" } } }, "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/Empty" } } } } }, "x-amazon-apigateway-integration" : { "credentials" : "arn:aws:iam::123456789012
:role/apigAwsProxyRole", "httpMethod" : "GET", "uri" : "arn:aws:apigateway:us-west-2:s3:path/{bucket}", "responses" : { "4\\d{2}" : { "statusCode" : "400" }, "default" : { "statusCode" : "200", "responseParameters" : { "method.response.header.Content-Type" : "integration.response.header.Content-Type", "method.response.header.Date" : "integration.response.header.Date", "method.response.header.Content-Length" : "integration.response.header.content-length" } }, "5\\d{2}" : { "statusCode" : "500" } }, "requestParameters" : { "integration.request.path.bucket" : "method.request.path.folder" }, "passthroughBehavior" : "when_no_match", "type" : "aws" } }, "put" : { "parameters" : [ { "name" : "Content-Type", "in" : "header", "schema" : { "type" : "string" } }, { "name" : "folder", "in" : "path", "required" : true, "schema" : { "type" : "string" } } ], "responses" : { "400" : { "description" : "400 response", "content" : { } }, "500" : { "description" : "500 response", "content" : { } }, "200" : { "description" : "200 response", "headers" : { "Content-Length" : { "schema" : { "type" : "string" } }, "Content-Type" : { "schema" : { "type" : "string" } } }, "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/Empty" } } } } }, "x-amazon-apigateway-integration" : { "credentials" : "arn:aws:iam::123456789012
:role/apigAwsProxyRole", "httpMethod" : "PUT", "uri" : "arn:aws:apigateway:us-west-2:s3:path/{bucket}", "responses" : { "4\\d{2}" : { "statusCode" : "400" }, "default" : { "statusCode" : "200", "responseParameters" : { "method.response.header.Content-Type" : "integration.response.header.Content-Type", "method.response.header.Content-Length" : "integration.response.header.Content-Length" } }, "5\\d{2}" : { "statusCode" : "500" } }, "requestParameters" : { "integration.request.path.bucket" : "method.request.path.folder", "integration.request.header.Content-Type" : "method.request.header.Content-Type" }, "passthroughBehavior" : "when_no_match", "type" : "aws" } }, "delete" : { "parameters" : [ { "name" : "folder", "in" : "path", "required" : true, "schema" : { "type" : "string" } } ], "responses" : { "400" : { "description" : "400 response", "content" : { } }, "500" : { "description" : "500 response", "content" : { } }, "200" : { "description" : "200 response", "headers" : { "Date" : { "schema" : { "type" : "string" } }, "Content-Type" : { "schema" : { "type" : "string" } } }, "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/Empty" } } } } }, "x-amazon-apigateway-integration" : { "credentials" : "arn:aws:iam::123456789012
:role/apigAwsProxyRole", "httpMethod" : "DELETE", "uri" : "arn:aws:apigateway:us-west-2:s3:path/{bucket}", "responses" : { "4\\d{2}" : { "statusCode" : "400" }, "default" : { "statusCode" : "200", "responseParameters" : { "method.response.header.Content-Type" : "integration.response.header.Content-Type", "method.response.header.Date" : "integration.response.header.Date" } }, "5\\d{2}" : { "statusCode" : "500" } }, "requestParameters" : { "integration.request.path.bucket" : "method.request.path.folder" }, "passthroughBehavior" : "when_no_match", "type" : "aws" } } }, "/{folder}/{item}" : { "get" : { "parameters" : [ { "name" : "item", "in" : "path", "required" : true, "schema" : { "type" : "string" } }, { "name" : "folder", "in" : "path", "required" : true, "schema" : { "type" : "string" } } ], "responses" : { "400" : { "description" : "400 response", "content" : { } }, "500" : { "description" : "500 response", "content" : { } }, "200" : { "description" : "200 response", "headers" : { "content-type" : { "schema" : { "type" : "string" } }, "Content-Type" : { "schema" : { "type" : "string" } } }, "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/Empty" } } } } }, "x-amazon-apigateway-integration" : { "credentials" : "arn:aws:iam::123456789012
:role/apigAwsProxyRole", "httpMethod" : "GET", "uri" : "arn:aws:apigateway:us-west-2:s3:path/{bucket}/{object}", "responses" : { "4\\d{2}" : { "statusCode" : "400" }, "default" : { "statusCode" : "200", "responseParameters" : { "method.response.header.content-type" : "integration.response.header.content-type", "method.response.header.Content-Type" : "integration.response.header.Content-Type" } }, "5\\d{2}" : { "statusCode" : "500" } }, "requestParameters" : { "integration.request.path.object" : "method.request.path.item", "integration.request.path.bucket" : "method.request.path.folder" }, "passthroughBehavior" : "when_no_match", "type" : "aws" } }, "put" : { "parameters" : [ { "name" : "Content-Type", "in" : "header", "schema" : { "type" : "string" } }, { "name" : "item", "in" : "path", "required" : true, "schema" : { "type" : "string" } }, { "name" : "folder", "in" : "path", "required" : true, "schema" : { "type" : "string" } } ], "responses" : { "400" : { "description" : "400 response", "content" : { } }, "500" : { "description" : "500 response", "content" : { } }, "200" : { "description" : "200 response", "headers" : { "Content-Length" : { "schema" : { "type" : "string" } }, "Content-Type" : { "schema" : { "type" : "string" } } }, "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/Empty" } } } } }, "x-amazon-apigateway-integration" : { "credentials" : "arn:aws:iam::123456789012
:role/apigAwsProxyRole", "httpMethod" : "PUT", "uri" : "arn:aws:apigateway:us-west-2:s3:path/{bucket}/{object}", "responses" : { "4\\d{2}" : { "statusCode" : "400" }, "default" : { "statusCode" : "200", "responseParameters" : { "method.response.header.Content-Type" : "integration.response.header.Content-Type", "method.response.header.Content-Length" : "integration.response.header.Content-Length" } }, "5\\d{2}" : { "statusCode" : "500" } }, "requestParameters" : { "integration.request.path.object" : "method.request.path.item", "integration.request.path.bucket" : "method.request.path.folder", "integration.request.header.Content-Type" : "method.request.header.Content-Type" }, "passthroughBehavior" : "when_no_match", "type" : "aws" } }, "delete" : { "parameters" : [ { "name" : "item", "in" : "path", "required" : true, "schema" : { "type" : "string" } }, { "name" : "folder", "in" : "path", "required" : true, "schema" : { "type" : "string" } } ], "responses" : { "400" : { "description" : "400 response", "content" : { } }, "500" : { "description" : "500 response", "content" : { } }, "200" : { "description" : "200 response", "headers" : { "Content-Length" : { "schema" : { "type" : "string" } }, "Content-Type" : { "schema" : { "type" : "string" } } }, "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/Empty" } } } } }, "x-amazon-apigateway-integration" : { "credentials" : "arn:aws:iam::123456789012
:role/apigAwsProxyRole", "httpMethod" : "DELETE", "uri" : "arn:aws:apigateway:us-west-2:s3:path/{bucket}/{object}", "responses" : { "4\\d{2}" : { "statusCode" : "400" }, "default" : { "statusCode" : "200" }, "5\\d{2}" : { "statusCode" : "500" } }, "requestParameters" : { "integration.request.path.object" : "method.request.path.item", "integration.request.path.bucket" : "method.request.path.folder" }, "passthroughBehavior" : "when_no_match", "type" : "aws" } }, "head" : { "parameters" : [ { "name" : "item", "in" : "path", "required" : true, "schema" : { "type" : "string" } }, { "name" : "folder", "in" : "path", "required" : true, "schema" : { "type" : "string" } } ], "responses" : { "400" : { "description" : "400 response", "content" : { } }, "500" : { "description" : "500 response", "content" : { } }, "200" : { "description" : "200 response", "headers" : { "Content-Length" : { "schema" : { "type" : "string" } }, "Content-Type" : { "schema" : { "type" : "string" } } }, "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/Empty" } } } } }, "x-amazon-apigateway-integration" : { "credentials" : "arn:aws:iam::123456789012
:role/apigAwsProxyRole", "httpMethod" : "HEAD", "uri" : "arn:aws:apigateway:us-west-2:s3:path/{bucket}/{object}", "responses" : { "4\\d{2}" : { "statusCode" : "400" }, "default" : { "statusCode" : "200", "responseParameters" : { "method.response.header.Content-Type" : "integration.response.header.Content-Type", "method.response.header.Content-Length" : "integration.response.header.Content-Length" } }, "5\\d{2}" : { "statusCode" : "500" } }, "requestParameters" : { "integration.request.path.object" : "method.request.path.item", "integration.request.path.bucket" : "method.request.path.folder" }, "passthroughBehavior" : "when_no_match", "type" : "aws" } } }, "/" : { "get" : { "responses" : { "400" : { "description" : "400 response", "content" : { } }, "500" : { "description" : "500 response", "content" : { } }, "200" : { "description" : "200 response", "headers" : { "Content-Length" : { "schema" : { "type" : "string" } }, "Timestamp" : { "schema" : { "type" : "string" } }, "Content-Type" : { "schema" : { "type" : "string" } } }, "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/Empty" } } } } }, "x-amazon-apigateway-integration" : { "credentials" : "arn:aws:iam::123456789012
:role/apigAwsProxyRole", "httpMethod" : "GET", "uri" : "arn:aws:apigateway:us-west-2:s3:path//", "responses" : { "4\\d{2}" : { "statusCode" : "400" }, "default" : { "statusCode" : "200", "responseParameters" : { "method.response.header.Content-Type" : "integration.response.header.Content-Type", "method.response.header.Content-Length" : "integration.response.header.Content-Length", "method.response.header.Timestamp" : "integration.response.header.Date" } }, "5\\d{2}" : { "statusCode" : "500" } }, "passthroughBehavior" : "when_no_match", "type" : "aws" } } } }, "components" : { "schemas" : { "Empty" : { "title" : "Empty Schema", "type" : "object" } } } }