Findings API Client SDK
Project description
IBM Cloud Security Advisor Findings API Python SDK
This repository contains the released Python client SDK for IBM Cloud ecurity Advisor Findings API . Check out our API documentation for more details.
Requirements.
Python 2.7 and 3.4+
Installation & Usage
pip install
you can install latest version by
pip install ibm-cloud-security-advisor-findingsapi-sdk
Since the python package is hosted on Github, you can install directly from Github
pip install git+https://github.com/ibm-cloud-security/security-advisor-findings-sdk-python.git
(you may need to run pip with root permission: sudo pip install git+https://github.com/ibm-cloud-security/security-advisor-findings-sdk-python.git)
Then import the package:
import ibm_security_advisor_findings_api_client
Setuptools
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install to install the package for all users)
Then import the package:
import ibm_security_advisor_findings_api_client
Getting Started
Please follow the installation procedure and then run the following:
from __future__ import print_function
import time
import ibm_security_advisor_findings_api_client
from ibm_security_advisor_findings_api_client.rest import ApiException
from pprint import pprint
note = {
"kind": "FINDING",
"short_description": "Test Finding",
"long_description": "Test Finding",
"provider_id": "TEST",
"id": "test-finding",
"reported_by": {
"id": "test-finding",
"title": "Test findings"
},
"finding": {
"severity": "LOW",
"next_steps": [{
"title": "Verify open issues in link "
}]
}
}
# Configure API key authorization: UserMin
configuration = ibm_security_advisor_findings_api_client.Configuration()
#Change this to point to London endpoint
configuration.host= "https://us-south.secadvisor.cloud.ibm.com/findings"
api_instance = ibm_security_advisor_findings_api_client.FindingsNotesApi(ibm_security_advisor_findings_api_client.ApiClient(configuration))
body = note # ApiNote | Body for Note creation
authorization = 'Bearer <<YOUR IAM TOKEN>>`
account_id = 'Your account ID' # str | Account ID
provider_id = 'TEST' # str | Part of `parent`. This field contains the provider_id for example: providers/{provider_id}
try:
# Creates a new `Note`.
api_response = api_instance.create_note(body, authorization, account_id, provider_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling FindingsNotesApi->create_note: %s\n" % e)
Documentation for API Endpoints
All URIs are relative to /findings
| Class | Method | HTTP request | Description |
|---|---|---|---|
| FindingsGraphApi | post_graph | POST /v1/{account_id}/graph | query findings |
| FindingsNotesApi | create_note | POST /v1/{account_id}/providers/{provider_id}/notes | Creates a new `Note`. |
| FindingsNotesApi | delete_note | DELETE /v1/{account_id}/providers/{provider_id}/notes/{note_id} | Deletes the given `Note` from the system. |
| FindingsNotesApi | get_note | GET /v1/{account_id}/providers/{provider_id}/notes/{note_id} | Returns the requested `Note`. |
| FindingsNotesApi | get_occurrence_note | GET /v1/{account_id}/providers/{provider_id}/occurrences/{occurrence_id}/note | Gets the `Note` attached to the given `Occurrence`. |
| FindingsNotesApi | list_notes | GET /v1/{account_id}/providers/{provider_id}/notes | Lists all `Notes` for a given provider. |
| FindingsNotesApi | update_note | PUT /v1/{account_id}/providers/{provider_id}/notes/{note_id} | Updates an existing `Note`. |
| FindingsOccurrencesApi | create_occurrence | POST /v1/{account_id}/providers/{provider_id}/occurrences | Creates a new `Occurrence`. Use this method to create `Occurrences` for a resource. |
| FindingsOccurrencesApi | delete_occurrence | DELETE /v1/{account_id}/providers/{provider_id}/occurrences/{occurrence_id} | Deletes the given `Occurrence` from the system. |
| FindingsOccurrencesApi | get_occurrence | GET /v1/{account_id}/providers/{provider_id}/occurrences/{occurrence_id} | Returns the requested `Occurrence`. |
| FindingsOccurrencesApi | list_note_occurrences | 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. |
| FindingsOccurrencesApi | list_occurrences | GET /v1/{account_id}/providers/{provider_id}/occurrences | Lists active `Occurrences` for a given provider matching the filters. |
| FindingsOccurrencesApi | update_occurrence | PUT /v1/{account_id}/providers/{provider_id}/occurrences/{occurrence_id} | Updates an existing `Occurrence`. |
Documentation For Models
- ApiEmpty
- ApiListNoteOccurrencesResponse
- ApiListNotesResponse
- ApiListOccurrencesResponse
- ApiListProvidersResponse
- ApiNote
- ApiNoteKind
- ApiNoteRelatedUrl
- ApiOccurrence
- ApiProvider
- BreakdownCardElement
- Card
- CardElement
- Certainty
- Context
- DataTransferred
- Finding
- FindingCountValueType
- FindingType
- Kpi
- KpiType
- KpiValueType
- NetworkConnection
- NumericCardElement
- RemediationStep
- Reporter
- Section
- Severity
- SocketAddress
- TimeSeriesCardElement
- ValueType
Documentation For Authorization
Use "Bearer " + IAM TOKEN in api calls. Refer Getting Started
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file ibm-cloud-security-advisor-findingsapi-sdk-1.0.4.tar.gz.
File metadata
- Download URL: ibm-cloud-security-advisor-findingsapi-sdk-1.0.4.tar.gz
- Upload date:
- Size: 40.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
276b0c84bc19ea0c775f3bae032bad312ed8de8148ae77dba143dfda73a393db
|
|
| MD5 |
b9e87005c4dc9f3bc49542131c80c4e6
|
|
| BLAKE2b-256 |
bfb3427cabfd273538df03f577880b6108b24bfada18ea6655df4b55bf976fba
|