How to use the APIGateway function from aws-sdk

Find comprehensive JavaScript aws-sdk.APIGateway code examples handpicked from public code repositorys.

1
2
3
4
5
6
7
8
9
10

class ApiGatewayManager {
  constructor(serviceName, version, region) {
    this.ServiceName = serviceName;
    this.Version = version;
    this.apiGatewayFactory = new APIGateway({ region });
    this.apiGatewayFactoryV2 = new ApiGatewayV2({ region });
  }

  async GetApiGatewayPromise() {
fork icon4
star icon32
watch icon3

2
3
4
5
6
7
8
9
10
11
var AWS = require('aws-sdk');
var memoize = require('./lib/util/memoizeWithOptions');
var promisifyAll = require('./lib/util/promisifyAll');

function apiGateway(options) {
  return promisifyAll(new AWS.APIGateway(options));
}

/**
 * Returns an instance of AWS.APIGateway which has Promise methods
fork icon10
star icon26
watch icon8

30
31
32
33
34
35
36
37
38
39
 * @param {String} restApiId
 * @param {String} stageName
 * @return {Promise}
 */
ApiGateway.prototype.deploy = function (region, restApiId, stageName) {
  const awsApiGateway = new AWS.APIGateway({ region: region })
  return new Promise(function (resolve, reject) {
    const params = {
      restApiId: restApiId,
      stageName: stageName
fork icon2
star icon13
watch icon9

+ 11 other calls in file

19
20
21
22
23
24
25
26
27
28
        }

        AWS.config.credentials = new AWS.SharedIniFileCredentials(objectCredentials);
}

this._apiGateway = utils.pify(new AWS.APIGateway());
this._lambda = utils.pify(new AWS.Lambda());

this._exec = function (method, params, retry) {
        retry = retry || 0;
fork icon2
star icon1
watch icon4

7
8
9
10
11
12
13
14
15
16

module.exports = function destroyObjects(newObjects) {
        'use strict';
        const lambda = new aws.Lambda({ region: awsRegion }),
                logs = new aws.CloudWatchLogs({ region: awsRegion }),
                apiGatewayPromise = retriableWrap(new aws.APIGateway({ region: awsRegion })),
                s3 = new aws.S3(),
                iot = new aws.Iot({ region: awsRegion }),
                sns = new aws.SNS({ region: awsRegion }),
                events = new aws.CloudWatchEvents({ region: awsRegion }),
fork icon290
star icon0
watch icon3

0
1
2
3
4
5
6
7
8
9
const AWS = require('aws-sdk');
const config = require('./config');

module.exports = class ApiGateway {
  constructor() {
    this.gtw = new AWS.APIGateway();
    this.waf = new AWS.WAFV2();
  }

  async createApi(name, description) {
fork icon1
star icon0
watch icon7

24
25
26
27
28
29
30
31
32
var rootPath     = process.cwd(),
    handlersPath = path.join(rootPath, options.handlers),
    version      = require(path.join(rootPath, options.version)),
    config       = require(path.join(rootPath, options.config));

var apigateway = new AWS.APIGateway({
  region: config.AWS.region,
  apiVersion: config.AWS.APIGateway.apiVersion
});
fork icon0
star icon5
watch icon2