File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed
Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 1515# limitations under the License.
1616"""Get multiple IoCs from Chronicle."""
1717
18- from typing import List
18+ from typing import List , Mapping , Any
1919
2020from common import regions
2121from google .auth .transport import requests
@@ -30,7 +30,7 @@ def batch_get_iocs(
3030 proj_region : str ,
3131 ioc_values : List [str ],
3232 ioc_type : str ,
33- ) -> dict :
33+ ) -> Mapping [ str , Any ] :
3434 """Get multiple IoCs by their values from Chronicle.
3535
3636 Args:
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ def get_ioc(
2828 proj_region : str ,
2929 ioc_value : str ,
3030 ioc_type : str ,
31- ) -> Mapping [str , Any ]:
31+ ) -> Mapping [str , Any ]:
3232 """Get a single IoC by its value from Chronicle.
3333
3434 Args:
@@ -59,8 +59,10 @@ def get_ioc(
5959 """
6060 base_url_with_region = regions .url_always_prepend_region (
6161 CHRONICLE_API_BASE_URL , proj_region )
62+ # pylint: disable=line-too-long
6263 instance = f"projects/{ proj_id } /locations/{ proj_region } /instances/{ proj_instance } "
6364 url = f"{ base_url_with_region } /v1alpha/{ instance } /iocs/{ ioc_type } /{ ioc_value } "
65+ # pylint: enable=line-too-long
6466
6567 response = http_session .request ("GET" , url )
6668 if response .status_code >= 400 :
Original file line number Diff line number Diff line change 1717
1818from common import regions
1919from google .auth .transport import requests
20+ from typing import Any , Mapping
2021
2122CHRONICLE_API_BASE_URL = "https://chronicle.googleapis.com"
2223
@@ -28,7 +29,7 @@ def get_ioc_state(
2829 proj_region : str ,
2930 ioc_value : str ,
3031 ioc_type : str ,
31- ) -> dict :
32+ ) -> Mapping [ str , Any ] :
3233 """Get the state of an IoC by its value from Chronicle.
3334
3435 Args:
You can’t perform that action at this time.
0 commit comments