Skip to content

Commit 1cf8368

Browse files
committed
linting
1 parent 1d95a08 commit 1cf8368

7 files changed

Lines changed: 44 additions & 42 deletions

File tree

detect/v1alpha/create_rule.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ def create_rule(
8181
"""
8282
base_url_with_region = regions.url_always_prepend_region(
8383
CHRONICLE_API_BASE_URL, proj_region)
84+
# pylint: disable-next=line-too-long
8485
parent = f"projects/{proj_id}/locations/{proj_region}/instances/{proj_instance}"
8586
url = f"{base_url_with_region}/v1alpha/{parent}/rules"
8687

iocs/v1alpha/batch_get_iocs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ def batch_get_iocs(
6161
"""
6262
base_url_with_region = regions.url_always_prepend_region(
6363
CHRONICLE_API_BASE_URL, proj_region)
64+
# pylint: disable-next=line-too-long
6465
instance = f"projects/{proj_id}/locations/{proj_region}/instances/{proj_instance}"
6566
url = f"{base_url_with_region}/v1alpha/{instance}/iocs:batchGet"
6667

iocs/v1alpha/get_ioc_state.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -33,32 +33,32 @@ def get_ioc_state(
3333
) -> Mapping[str, Any]:
3434
"""Get the state of an IoC by its value from Chronicle.
3535
36-
Args:
37-
http_session: Authorized session for HTTP requests.
38-
proj_id: GCP project id or number to which the target instance belongs.
39-
proj_instance: Customer ID (uuid with dashes) for the instance.
40-
proj_region: region in which the target project is located.
41-
ioc_value: Value of the IoC to get state for.
42-
ioc_type: Type of IoC being requested. One of:
43-
IOC_TYPE_UNSPECIFIED
44-
DOMAIN
45-
IP
46-
FILE_HASH
47-
URL
48-
USER_EMAIL
49-
MUTEX
50-
FILE_HASH_MD5
51-
FILE_HASH_SHA1
52-
FILE_HASH_SHA256
53-
IOC_TYPE_RESOURCE
36+
Args:
37+
http_session: Authorized session for HTTP requests.
38+
proj_id: GCP project id or number to which the target instance belongs.
39+
proj_instance: Customer ID (uuid with dashes) for the instance.
40+
proj_region: region in which the target project is located.
41+
ioc_value: Value of the IoC to get state for.
42+
ioc_type: Type of IoC being requested. One of:
43+
IOC_TYPE_UNSPECIFIED
44+
DOMAIN
45+
IP
46+
FILE_HASH
47+
URL
48+
USER_EMAIL
49+
MUTEX
50+
FILE_HASH_MD5
51+
FILE_HASH_SHA1
52+
FILE_HASH_SHA256
53+
IOC_TYPE_RESOURCE
5454
55-
Returns:
56-
Dict containing the IoC state.
55+
Returns:
56+
Dict containing the IoC state.
5757
58-
Raises:
59-
requests.exceptions.HTTPError: HTTP request resulted in an error
60-
(response.status_code >= 400).
61-
"""
58+
Raises:
59+
requests.exceptions.HTTPError: HTTP request resulted in an error
60+
(response.status_code >= 400).
61+
"""
6262
base_url_with_region = regions.url_always_prepend_region(
6363
CHRONICLE_API_BASE_URL, proj_region)
6464
instance = f"projects/{proj_id}/locations/{proj_region}/instances/{proj_instance}"

lists/v1alpha/create_list.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ def create_list(
9191
"""
9292
base_url_with_region = regions.url_always_prepend_region(
9393
CHRONICLE_API_BASE_URL, proj_region)
94+
# pylint: disable-next=line-too-long
9495
parent = f"projects/{proj_id}/locations/{proj_region}/instances/{proj_instance}"
9596
url = f"{base_url_with_region}/v1alpha/{parent}/referenceLists"
9697

sdk/commands/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Common utilities for CLI commands."""
22

3-
from functools import wraps
3+
import functools
44
import os
55

66
import click
@@ -64,7 +64,7 @@ def add_common_options(func):
6464
required=False,
6565
help="Path to .env file containing configuration variables.",
6666
)
67-
@wraps(func)
67+
@functools.wraps(func)
6868
def wrapper(*args, **kwargs):
6969
# Load environment variables from .env file
7070
env_file = kwargs.pop("env_file", None)

sdk/commands/search.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
# limitations under the License.
1616
"""Chronicle Search API commands."""
1717

18-
import json
19-
2018
import click
2119
from common import chronicle_auth
2220

@@ -140,7 +138,8 @@ def find_raw_logs_cmd(ctx, query, batch_tokens, log_ids, regex_search,
140138
"--tokens",
141139
multiple=True,
142140
help=
143-
"Optional list of tokens, with each token referring to a group of UDM/Entity events.",
141+
"Optional list of tokens, with each token referring to a group of "
142+
"UDM/Entity events.",
144143
)
145144
@click.option(
146145
"--event-ids",

search/v1alpha/search_query_get.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,21 @@ def get_search_query(http_session: requests.AuthorizedSession, proj_id: str,
4141
query_id: str) -> None:
4242
"""Get a search query by ID from Chronicle.
4343
44-
Args:
45-
http_session: Authorized session for HTTP requests.
46-
proj_id: GCP project id or number to which the target instance belongs.
47-
proj_instance: Customer ID (uuid with dashes) for the instance.
48-
proj_region: region in which the target project is located.
49-
user_id: ID of the user who owns the search query.
50-
query_id: ID of the search query to retrieve.
44+
Args:
45+
http_session: Authorized session for HTTP requests.
46+
proj_id: GCP project id or number to which the target instance belongs.
47+
proj_instance: Customer ID (uuid with dashes) for the instance.
48+
proj_region: region in which the target project is located.
49+
user_id: ID of the user who owns the search query.
50+
query_id: ID of the search query to retrieve.
5151
52-
Raises:
53-
requests.exceptions.HTTPError: HTTP request resulted in an error
54-
(response.status_code >= 400).
52+
Raises:
53+
requests.exceptions.HTTPError: HTTP request resulted in an error
54+
(response.status_code >= 400).
5555
56-
Requires the following IAM permission on the instance resource:
57-
chronicle.searchQueries.get
58-
"""
56+
Requires the following IAM permission on the instance resource:
57+
chronicle.searchQueries.get
58+
"""
5959
base_url_with_region = regions.url_always_prepend_region(
6060
CHRONICLE_API_BASE_URL, proj_region)
6161
# pylint: disable=line-too-long

0 commit comments

Comments
 (0)