UNPKG

appdynamics-analytics-events-api

Version:
60 lines (43 loc) 1.91 kB
# AppDynamics Analytics Events API A javascript wrapper for the [AppDynamics Analytics Events API](https://docs.appdynamics.com/display/PRO45/Analytics+Events+API). ## Introduction This wrapper allows you to create, retrieve or delete schemas in the AppDynamics Analytics Events Service, as well as publishing and querying events in those schemas. ## Usage Install this package with npm and import the `connectAnalyticsAPI` function: ```javascript const { connectAnalyticsAPI } = require('./index.js') ``` With this function you can prepare a connection to the AppDynamics Analytics Events Service, e.g. ```javascript const api = connectAnalyticsAPI('https://analytics.api.appdynamics.com ', 'example', 'dfe8afac-b1ef-4ecd-bde1-c9bdce052e85'); ``` With this `api` object you can retrieve or create schemas: ```javascript api.retrieveSchema('example_schema').then(schema => { ... }).catch(error => { ... }) /* or */ api.createSchema('example_schema', { field1: 'string', field2: 'integer' }).then(schema => { ... }).catch(error => { ... }) ``` For convenience there is a `retrieveOrCreateSchema` (short: `with`) method, that checks if a schema exists and creates it if not: ```javascript api.with('example_schema', { field1: 'string', field2: 'integer' }).then(schema => { ... }).catch(error => { ... }) ``` ### License Copyright 2020 Severin Neumann Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at ``` http://www.apache.org/licenses/LICENSE-2.0 ``` Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.