npm.io
1.0.3 • Published 3 years ago

ncloud-cloudfunctions

Licence
MIT
Version
1.0.3
Deps
2
Size
1001 kB
Vulns
3
Weekly
0

api

Api - JavaScript client for api Cloud Functions Open API
https://cloudfunctions.apigw.ntruss.com/api/v2 This SDK is automatically generated by the Swagger Codegen project:

  • API version: 2022-08-18T0831Z
  • Package version: 1.0.0
  • Build package: io.swagger.codegen.languages.NcpJavascriptForNcloudClientCodegen

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install api --save
git

If the library is hosted at a git repository, e.g. https://github.com/YOUR_USERNAME/api then install it via:

    npm install YOUR_USERNAME/api --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var Api = require('api');

var defaultClient = Api.ApiClient.instance;

// Configure API key authorization: x-ncp-iam
var x-ncp-iam = defaultClient.authentications['x-ncp-iam'];
x-ncp-iam.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//x-ncp-iam.apiKeyPrefix['x-ncp-iam'] = "Token"

var api = new Api.V2Api()

var packageName = "packageName_example"; // {String} packageName

var actionName = "actionName_example"; // {String} actionName

var opts = { 
  'platform': "platform_example" // {String} platform
};
api.deleteAction(packageName, actionName, opts).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

Documentation for API Endpoints

All URIs are relative to https://cloudfunctions.apigw.ntruss.com/api/v2

Class Method HTTP request Description
Api.V2Api deleteAction DELETE /packages/{packageName}/actions/{actionName}
Api.V2Api deletePackage DELETE /packages/{packageName}
Api.V2Api deleteTrigger DELETE /triggers/{triggerName}
Api.V2Api deleteTriggerLinkAction DELETE /triggers/{triggerName}/link-action
Api.V2Api getAction GET /packages/{packageName}/actions/{actionName}
Api.V2Api getActionActivationDetail GET /packages/{packageName}/actions/{actionName}/activations/{activationId}
Api.V2Api getActionActivationList GET /packages/{packageName}/actions/{actionName}/activations
Api.V2Api getActionList GET /packages/{packageName}/actions
Api.V2Api getActivationList GET /activations
Api.V2Api getPackage GET /packages/{packageName}
Api.V2Api getPackageList GET /packages
Api.V2Api getTrigger GET /triggers/{triggerName}
Api.V2Api getTriggerActivationDetail GET /triggers/{triggerName}/activations/{activationId}
Api.V2Api getTriggerActivationList GET /triggers/{triggerName}/activations
Api.V2Api getTriggerList GET /triggers
Api.V2Api postAction POST /packages/{packageName}/actions/{actionName}
Api.V2Api postActionExternalLink POST /packages/{packageName}/actions/{actionName}/external-link-url
Api.V2Api postTrigger POST /triggers/{triggerName}
Api.V2Api postTriggerExternalLink POST /triggers/{triggerName}/external-link-url
Api.V2Api postTriggerLinkAction POST /triggers/{triggerName}/link-action
Api.V2Api putAction PUT /packages/{packageName}/actions/{actionName}
Api.V2Api putPackage PUT /packages/{packageName}

Documentation for Models

Documentation for Authorization

x-ncp-iam
  • Type: API key
  • API key parameter name: x-ncp-iam
  • Location: HTTP header