发现API客户端sdk

ibm-cloud-security-advisor-findingsapi-sdk的Python项目详细描述


ibm云安全顾问发现api python sdk

此存储库包含已发布的用于ibmcloudecurityadvisor发现api的python客户端sdk。查看我们的API documentation了解更多详细信息。

要求。

python 2.7和3.4+

安装和使用

pip安装

您可以通过以下方式安装最新版本

pip install ibm-cloud-security-advisor-findingsapi-sdk

由于python包托管在github上,因此可以直接从github安装

pip install git+https://github.com/ibm-cloud-security/security-advisor-findings-sdk-python.git

(您可能需要使用根权限运行pipsudo pip install git+https://github.com/ibm-cloud-security/security-advisor-findings-sdk-python.git

然后导入包:

importibm_security_advisor_findings_api_client

设置工具

通过Setuptools安装。

python setup.py install --user

(或sudo python setup.py install为所有用户安装软件包)

然后导入包:

importibm_security_advisor_findings_api_client

开始

请按照installation procedure操作,然后运行以下命令:

from__future__importprint_functionimporttimeimportibm_security_advisor_findings_api_clientfromibm_security_advisor_findings_api_client.restimportApiExceptionfrompprintimportpprintnote={"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: UserMinconfiguration=ibm_security_advisor_findings_api_client.Configuration()#Change this to point to London endpointconfiguration.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 creationauthorization='Bearer <<YOUR IAM TOKEN>>`account_id='Your account ID'# str | Account IDprovider_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)exceptApiExceptionase:print("Exception when calling FindingsNotesApi->create_note: %s\n"%e)

API端点文档

所有uri都与/发现相关

ClassMethodHTTP requestDescription
FindingsGraphApipost_graphPOST /v1/{account_id}/graphquery findings
FindingsNotesApicreate_notePOST /v1/{account_id}/providers/{provider_id}/notesCreates a new `Note`.
FindingsNotesApidelete_noteDELETE /v1/{account_id}/providers/{provider_id}/notes/{note_id}Deletes the given `Note` from the system.
FindingsNotesApiget_noteGET /v1/{account_id}/providers/{provider_id}/notes/{note_id}Returns the requested `Note`.
FindingsNotesApiget_occurrence_noteGET /v1/{account_id}/providers/{provider_id}/occurrences/{occurrence_id}/noteGets the `Note` attached to the given `Occurrence`.
FindingsNotesApilist_notesGET /v1/{account_id}/providers/{provider_id}/notesLists all `Notes` for a given provider.
FindingsNotesApiupdate_notePUT /v1/{account_id}/providers/{provider_id}/notes/{note_id}Updates an existing `Note`.
FindingsOccurrencesApicreate_occurrencePOST /v1/{account_id}/providers/{provider_id}/occurrencesCreates a new `Occurrence`. Use this method to create `Occurrences` for a resource.
FindingsOccurrencesApidelete_occurrenceDELETE /v1/{account_id}/providers/{provider_id}/occurrences/{occurrence_id}Deletes the given `Occurrence` from the system.
FindingsOccurrencesApiget_occurrenceGET /v1/{account_id}/providers/{provider_id}/occurrences/{occurrence_id}Returns the requested `Occurrence`.
FindingsOccurrencesApilist_note_occurrencesGET /v1/{account_id}/providers/{provider_id}/notes/{note_id}/occurrencesLists `Occurrences` referencing the specified `Note`. Use this method to get all occurrences referencing your `Note` across all your customer providers.
FindingsOccurrencesApilist_occurrencesGET /v1/{account_id}/providers/{provider_id}/occurrencesLists active `Occurrences` for a given provider matching the filters.
FindingsOccurrencesApiupdate_occurrencePUT /v1/{account_id}/providers/{provider_id}/occurrences/{occurrence_id}Updates an existing `Occurrence`.

型号文档

授权文件

在api调用中使用“bearer”+iam令牌。请参阅Getting Started

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
jenkins在java代码的csv中使用前导零传递数字   终止java应用程序javaw。exe eclipse   java平均字长。文本   java在事务中关闭连接时会发生什么?   java如何为rich faces extendedDatatable启用可调整大小的列?   SpringJavaWebApp头nosniff不适合js和css文件   Java:抛出异常   java获取拒绝ArrayList中存在的用户名的代码。   关于编写JNDI服务提供者的java教程   java Android emulator电子书示例已停止   java如何防止双向关系中的循环   在Java中,如何将接口的实现作为变量传递给方法?   java有没有办法通过注释来监听CoreNLP处理的进度?   java Eclipse错误:导入项目时“无法读取项目描述文件”   java为什么findViewById返回null?