npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ibmcloud-security-advisor-findings

v1.0.0

Published

JavaScript client library for the IBM Cloud Security Advisor Findings API

Downloads

8

Readme

IBM Cloud Security Advisor Findings API Node SDK

Findings API is supported in the following regions:

Requirements

Node.js 6.4.0 or later

Installation

For Node.js

To install the SDK:

npm install ibmcloud-security-advisor-findings --save

Install from a tagged release, for example, v1.0.0

npm install ibm-cloud-security/security-advisor-findings-sdk-nodejs#v1.0.0

Getting Started

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

var findings = require('ibmcloud-security-advisor-findings');
var defaultClient = findings.ApiClient.instance;
defaultClient.basePath = "https://us-south.secadvisor.cloud.ibm.com/findings"
let apiInstance = new findings.FindingsNotesApi();
let accountId = "accountId_example";
let authorization = "authorization_example";
let providerId = "providerId_example";

apiInstance.listNotes(accountId, authorization, providerId).then((data) => {
  console.log('API called successfully. Returned data: ' + JSON.stringify(data));
}, (error) => {
  console.error(error);
});

To target different regions set the basePath on the client instance accordingly:

  • Dallas - https://us-south.secadvisor.cloud.ibm.com/findings
  • London - https://eu-gb.secadvisor.cloud.ibm.com/findings

Generating Authorization token

Authorization token to be passed as second paramters in all the function calls is obtained by calling IBM Cloud IAM API. It is a bearer token in JWT format. Find a sample here. Read more about the access here

Documentation for API Endpoints

All URIs are relative to:

  • https://us-south.secadvisor.cloud.ibm.com/findings
  • https://eu-gb.secadvisor.cloud.ibm.com/findings

Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- findings.FindingsGraphApi | postGraph | POST /v1/{account_id}/graph | query findings findings.FindingsNotesApi | createNote | POST /v1/{account_id}/providers/{provider_id}/notes | Creates a new `Note`. findings.FindingsNotesApi | deleteNote | DELETE /v1/{account_id}/providers/{provider_id}/notes/{note_id} | Deletes the given `Note` from the system. findings.FindingsNotesApi | getNote | GET /v1/{account_id}/providers/{provider_id}/notes/{note_id} | Returns the requested `Note`. findings.FindingsNotesApi | getOccurrenceNote | GET /v1/{account_id}/providers/{provider_id}/occurrences/{occurrence_id}/note | Gets the `Note` attached to the given `Occurrence`. findings.FindingsNotesApi | listNotes | GET /v1/{account_id}/providers/{provider_id}/notes | Lists all `Notes` for a given provider. findings.FindingsNotesApi | updateNote | PUT /v1/{account_id}/providers/{provider_id}/notes/{note_id} | Updates an existing `Note`. findings.FindingsOccurrencesApi | createOccurrence | POST /v1/{account_id}/providers/{provider_id}/occurrences | Creates a new `Occurrence`. Use this method to create `Occurrences` for a resource. findings.FindingsOccurrencesApi | deleteOccurrence | DELETE /v1/{account_id}/providers/{provider_id}/occurrences/{occurrence_id} | Deletes the given `Occurrence` from the system. findings.FindingsOccurrencesApi | getOccurrence | GET /v1/{account_id}/providers/{provider_id}/occurrences/{occurrence_id} | Returns the requested `Occurrence`. findings.FindingsOccurrencesApi | listNoteOccurrences | GET /v1/{account_id}/providers/{provider_id}/notes/{note_id}/occurrences | Lists `Occurrences` referencing the specified `Note`. Use this method to get all occurrences referencing your `Note` across all your customer providers. findings.FindingsOccurrencesApi | listOccurrences | GET /v1/{account_id}/providers/{provider_id}/occurrences | Lists active `Occurrences` for a given provider matching the filters. findings.FindingsOccurrencesApi | updateOccurrence | PUT /v1/{account_id}/providers/{provider_id}/occurrences/{occurrence_id} | Updates an existing `Occurrence`.

Documentation for Models

Examples

Try out the examples. Go to Security Advisor dashboard for visualizing it. The examples require you to export the following variables:

export account_id=<your account id>
export authorization=<Bearer <token>>
export region=eu-gb

node create_notes.js
node create_occurrences.js

us-south will target the Dallas endpoint. Use eu-gb to target London by exporting region. Default region in the example is us-south Obtain authorization token for filling in the token value. We have used async/await to simplify the examples. Make sure your Node version supports it natively. You can check here