Metadata-Version: 2.1
Name: ibm-cloud-security-advisor-findingsapi-sdk
Version: 2.0.2
Summary: Findings API Client SDK
Home-page: https://github.com/ibm-cloud-security/security-advisor-findings-sdk-python
Author: IBM Cloud
Author-email: vkalangu@in.ibm.com, skairali@in.ibm.com, ashishth@in.ibm.com
License: Apache 2.0
Description: # ibm_security_advisor_findings_api_sdk
        
        This repository contains the released Python client SDK for IBM Cloud ecurity Advisor Findings API . Check out our [API
        documentation](https://cloud.ibm.com/apidocs/security-advisor/findings) for more details.
        
        ## Overview
        
        
        The  ibm_security_advisor_findings_api_sdk Python SDK allows developers to programmatically interact with the  ibm_security_advisor_findings_api_sdk services, in the following ways:
        
        *  ibm_security_advisor_findings_api_sdk subclasses
        
        ## Prerequisites
        
        [ibm-cloud-onboarding]: https://cloud.ibm.com/registration?target=%2Fdeveloper%2Fwatson&
        
        * An [IBM Cloud][ibm-cloud-onboarding] account.
        * An IAM API key to allow the SDK to access your account. Create one [here](https://cloud.ibm.com/iam/apikeys).
        * An installation of Python >=3.5 on your local machine.
        
        ## Installation
        
        To install, use `pip` or `easy_install`:
        
        ```bash
        pip install "ibm-cloud-security-advisor-findingsapi-sdk>=2.0.0"
        ```
        
        or
        
        ```bash
        easy_install --upgrade " ibm-cloud-security-advisor-findingsapi-sdk>=2.0.0"
        ```
        
        ## Authentication
        
         ibm_security_advisor_findings_api_sdk uses token-based [Identity and Access Management (IAM) authentication](https://cloud.ibm.com/docs/iam?topic=iam-getstarted).
        
        IAM authentication uses a service API key to get an access token that is passed with the call.
        Access tokens are valid for a limited amount of time and must be regenerated.
        
        To provide credentials to the SDK, you supply either an IAM service **API key** or an **access token**:
        
        - Use the API key to have the SDK manage the lifecycle of the access token. The SDK requests an access token, ensures that the access token is valid, and refreshes it if necessary.
        - Use the access token if you want to manage the lifecycle yourself. For details, see [Authenticating with IAM tokens](https://cloud.ibm.com/docs/services/watson/getting-started-iam.html).
        
        
        ### Supplying the IAM API key:
        
        
        ```python
        from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
        authenticator = IAMAuthenticator('apikey')
        ibm_security_advisor_findings_api_sdk_service =  ibm_security_advisor_findings_api_sdk(authenticator=authenticator)
        ```
        
        ### Generating bearer tokens using the IAM API key:
        
        ```python
        from  ibm_security_advisor_findings_api_sdk import IAMAuthenticator
        # In your API endpoint use this to generate new bearer tokens
        iam_token_manager = IAMAuthenticator('<apikey>')
        token = iam_token_manager.get_token()
        ```
        
        ### Supplying the access token:
        
        ```python
        from ibm_security_advisor_findings_api_sdk import FindingsApiV1 
        from ibm_cloud_sdk_core.authenticators import BearerTokenAuthenticator
        # in the constructor, assuming control of managing the token
        authenticator = BearerTokenAuthenticator('your token')
        ibm_security_advisor_findings_api_sdk_service =  FindingsApiV1(authenticator=authenticator)
        ```
        
        ## Using the SDK
        
        The  ibm_security_advisor_findings_api_sdk Python SDK supports only synchronous (blocking) execution of service methods. The return value from all service methods is a DetailedResponse object. Use this SDK to perform the basic  ibm_security_advisor_findings_api_sdk creation operation as follows, with the installation and initialization instructions from above:
        
        ```python
        from ibm_security_advisor_findings_api_sdk import FindingsApiV1 
        from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
        authenticator = IAMAuthenticator('your apikey')
        ibm_security_advisor_findings_api_sdk_data =  FindingsApiV1(authenticator=authenticator)
        response =  ibm_security_advisor_findings_api_sdk_data.<Method here<>>
        print(response)
        ```
        
        This would give an output of `DetailedResponse` from which you can use the `get_result()`, `get_headers()`, and `get_status_code()` to return the result, headers, and status code respectively.
        
        ### Sending request headers
        
        Custom headers can be passed in any request in the form of a `dict` as:
        
        ```python
        headers = {
        'Custom-Header': 'custom_value'
        }
        ```
        
        For example, to send a header called `Custom-Header` to a call in  ibm_security_advisor_findings_api_sdk, pass the headers parameter as:
        
        ```python
        from ibm_security_advisor_findings_api_sdk import FindingsApiV1 
        from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
        authenticator = IAMAuthenticator('your apikey')
        ibm_security_advisor_findings_api_sdk_service =  FindingsApiV1(authenticator=authenticator)
        response = ibm_security_advisor_findings_api_sdk_service.<<METHOD HERE>>(headers={'Custom-Header': 'custom_value'}).get_result()
        ```
        
        ### Error Handling
        
        The  ibm_security_advisor_findings_api_sdk Python SDK generates an exception for any unsuccessful method invocation.
        If the method receives an error response from an API call to the service, it will generate an
        `ApiException` with the following fields.
        
        | NAME | DESCRIPTION |
        | ----- | ----------- |
        | code | The HTTP response code that is returned. |
        | message	| A message that describes the error. |
        | info	| A dictionary of additional information about the error. |
        
        
        ## Sample Code
        
        Example | http method  
        ------------ | -------------  
        [***create_finding***](https://github.com/ibm-cloud-security/security-advisor-findings-sdk-python/blob/master/samples/create_finding.py) | POST /v1/{account_id}/providers/{provider_id}/notes
        [***create_card***](https://github.com/ibm-cloud-security/security-advisor-findings-sdk-python/blob/master/samples/create_card.py) | POST /v1/{account_id}/providers/{provider_id}/notes
        [***create_note_with_kpi***](https://github.com/ibm-cloud-security/security-advisor-findings-sdk-python/blob/master/samples/create_note_with_kpi.py) | POST /v1/{account_id}/providers/{provider_id}/notes
        [***create_note_with_reporter***](https://github.com/ibm-cloud-security/security-advisor-findings-sdk-python/blob/master/samples/create_note_with_reporter.py) | POST /v1/{account_id}/providers/{provider_id}/notes
        [***create_note_with_section***](https://github.com/ibm-cloud-security/security-advisor-findings-sdk-python/blob/master/samples/create_note_with_section.py) | POST /v1/{account_id}/providers/{provider_id}/notes
        [***list_notes***](https://github.com/ibm-cloud-security/security-advisor-findings-sdk-python/blob/master/samples/list_notes.py) | GET /v1/{account_id}/providers/{provider_id}/notes
        [***delete_note***](https://github.com/ibm-cloud-security/security-advisor-findings-sdk-python/blob/master/samples/delete_note.py) | DELETE /v1/{account_id}/providers/{provider_id}/notes/{note_id}
        [***create_occurrence***](https://github.com/ibm-cloud-security/security-advisor-findings-sdk-python/blob/master/samples/create_occurrence.py) | POST /v1/{account_id}/providers/{provider_id}/occurrences
        [***create_occurrence_with_context***](https://github.com/ibm-cloud-security/security-advisor-findings-sdk-python/blob/master/samples/create_occurrence_with_context.py) | POST /v1/{account_id}/providers/{provider_id}/occurrences
        [***create_occurrence_with_kpi***](https://github.com/ibm-cloud-security/security-advisor-findings-sdk-python/blob/master/samples/create_occurrence_with_kpi.py) | POST /v1/{account_id}/providers/{provider_id}/occurrences
        [***list_occurrences***](https://github.com/ibm-cloud-security/security-advisor-findings-sdk-python/blob/master/samples/list_occurrences.py) | GET /v1/{account_id}/providers/{provider_id}/occurrences
        [***delete_occurrence***](https://github.com/ibm-cloud-security/security-advisor-findings-sdk-python/blob/master/samples/delete_occurrence.py) | DELETE /v1/{account_id}/providers/{provider_id}/occurrences/{occurrence_id}
        [***list_providers***](https://github.com/ibm-cloud-security/security-advisor-findings-sdk-python/blob/master/samples/list_providers.py) | GET /v1/{account_id}/providers
        
        
        ## Documentation
        See [Findings API doc](https://ibm-cloud-security.github.io/security-advisor-findings-sdk-python/docs/findings_api_v1.html#FindingsApiV1).
        
        ## License
        
        The ibm_security_advisor_findings_api_sdk Python SDK is released under the Apache 2.0 license. The license's full text can be found in [LICENSE](LICENSE).
        
Keywords: Swagger,Findings API
Platform: UNKNOWN
Description-Content-Type: text/markdown
