Aws apigateway: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 3: Line 3:
* [[Amazon API Gateway#Subjects|Amazon API Gateway]]
* [[Amazon API Gateway#Subjects|Amazon API Gateway]]


==get-rest-apis==
Returns information about existing APIs.
aws apigateway get-rest-apis
{
    "items": [
        {
            "apiKeySource": "HEADER",
            "description": "themyscira",
            "endpointConfiguration": {
                "types": [
                    "EDGE"
                ]
            },
            "version": "1.0",
            "createdDate": 1551007660,
            "id": "anhfchtuhe",
            "name": "themyscira"
        },
        {
            "apiKeySource": "HEADER",
            "description": "Api Documentation",
            "endpointConfiguration": {
                "types": [
                    "EDGE"
                ]
            },
            "version": "1.0",
            "createdDate": 1551394693,
            "id": "kizx5mwn97",
            "name": "blue"
        },
        {
            "apiKeySource": "HEADER",
            "description": "An Ops Service proxy integration",
            "endpointConfiguration": {
                "types": [
                    "REGIONAL"
                ]
            },
            "createdDate": 1550077237,
            "id": "pn8pztlmtc",
            "name": "ops"
        }
    ]
}


=import-rest-api=
=import-rest-api=

Revision as of 23:16, 28 February 2019

Internal

get-rest-apis

Returns information about existing APIs.

aws apigateway get-rest-apis
{
   "items": [
       {
           "apiKeySource": "HEADER",
           "description": "themyscira",
           "endpointConfiguration": {
               "types": [
                   "EDGE"
               ]
           },
           "version": "1.0",
           "createdDate": 1551007660,
           "id": "anhfchtuhe",
           "name": "themyscira"
       },
       {
           "apiKeySource": "HEADER",
           "description": "Api Documentation",
           "endpointConfiguration": {
               "types": [
                   "EDGE"
               ]
           },
           "version": "1.0",
           "createdDate": 1551394693,
           "id": "kizx5mwn97",
           "name": "blue"
       },
       {
           "apiKeySource": "HEADER",
           "description": "An Ops Service proxy integration",
           "endpointConfiguration": {
               "types": [
                   "REGIONAL"
               ]
           },
           "createdDate": 1550077237,
           "id": "pn8pztlmtc",
           "name": "ops"
       }
   ]
}

import-rest-api

Creates a new API from an external API definition file. The API definition file should be in OpenAPI 2.0 format, optionally carrying Amazon API Gateway extensions. The new API's name will be given by the OpenAPI 2.0 info.title element.

aws apigateway import-rest-api --body 'file:///path/to/API_Swagger_template.json'
aws apigateway  import-rest-api --body 'file:///Users/ovidiu/playground/api-gateway-playground/themyscira/build/swagger.json'