Skip to content

Commit

Permalink
Update operation keyword arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
jshcodes committed Dec 22, 2023
1 parent 40eb234 commit ec4ca0c
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 45 deletions.
75 changes: 44 additions & 31 deletions src/falconpy/_endpoint/_foundry_logscale.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,15 @@
"/loggingapi/combined/repos/v1",
"Lists available repositories and views",
"foundry_logscale",
[]
[
{
"type": "boolean",
"default": False,
"description": "Include whether test data is present in the application repository",
"name": "check_test_data",
"in": "query"
}
]
],
[
"IngestDataV1",
Expand Down Expand Up @@ -90,6 +98,12 @@
"Execute a dynamic saved search",
"foundry_logscale",
[
{
"type": "string",
"description": "Application ID.",
"name": "app_id",
"in": "query"
},
{
"type": "boolean",
"default": False,
Expand Down Expand Up @@ -142,6 +156,12 @@
"in": "query",
"required": True
},
{
"type": "string",
"description": "Application ID.",
"name": "app_id",
"in": "query"
},
{
"minimum": 0,
"type": "string",
Expand All @@ -162,14 +182,6 @@
"description": "Starting pagination offset of records to return.",
"name": "offset",
"in": "query"
},
{
"pattern": "v?([0-9]+)(\\.[0-9]+)?(\\.[0-9]+)?(-([0-9A-Za-z\\-]+"
"(\\.[0-9A-Za-z\\-]+)*))?(\\+([0-9A-Za-z\\-]+(\\.[0-9A-Za-z\\-]+)*))?",
"type": "string",
"description": "Version of resource being created",
"name": "version",
"in": "query"
}
]
],
Expand All @@ -180,6 +192,12 @@
"Execute a saved search",
"foundry_logscale",
[
{
"type": "string",
"description": "Application ID.",
"name": "app_id",
"in": "query"
},
{
"type": "boolean",
"default": False,
Expand All @@ -201,26 +219,6 @@
"name": "metadata",
"in": "query"
},
{
"enum": [
"sync",
"async",
"async_offload"
],
"type": "string",
"description": "Mode to execute the query under. "
"If provided, takes precedence over the mode provided in the body.",
"name": "mode",
"in": "query"
},
{
"pattern": "v?([0-9]+)(\\.[0-9]+)?(\\.[0-9]+)?(-([0-9A-Za-z\\-]+"
"(\\.[0-9A-Za-z\\-]+)*))?(\\+([0-9A-Za-z\\-]+(\\.[0-9A-Za-z\\-]+)*))?",
"type": "string",
"description": "Version of resource being created",
"name": "version",
"in": "query"
},
{
"name": "body",
"in": "body",
Expand All @@ -234,7 +232,14 @@
"/loggingapi/entities/saved-searches/ingest/v1",
"Populate a saved search",
"foundry_logscale",
[]
[
{
"type": "string",
"description": "Application ID.",
"name": "app_id",
"in": "query"
}
]
],
[
"GetSavedSearchesJobResultsDownloadV1",
Expand Down Expand Up @@ -268,6 +273,14 @@
"/loggingapi/entities/views/v1",
"List views",
"foundry_logscale",
[]
[
{
"type": "boolean",
"default": False,
"description": "Include whether test data is present in the application repository",
"name": "check_test_data",
"in": "query"
}
]
]
]
39 changes: 25 additions & 14 deletions src/falconpy/foundry_logscale.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,16 @@ class FoundryLogScale(ServiceClass):
- a valid token provided by the authentication service class (oauth2.py)
"""

def list_repos(self: object) -> Dict[str, Union[int, dict]]:
@force_default(defaults=["parameters"], default_types=["dict"])
def list_repos(self: object, *args, parameters: dict = None, **kwargs) -> Dict[str, Union[int, dict]]:
"""List available repositories and views.
Keyword arguments:
This method does not accept keyword arguments.
check_test_data -- Include whether test data is present in the application repository. Boolean.
parameters - full parameters payload, not required if using other keywords.
This method does not accept arguments.
Arguments: When not specified, the first argument to this method is assumed to be 'check_test_data'.
All others are ignored.
Returns: dict object containing API response.
Expand All @@ -73,7 +76,9 @@ def list_repos(self: object) -> Dict[str, Union[int, dict]]:
return process_service_request(
calling_object=self,
endpoints=Endpoints,
operation_id="ListReposV1"
operation_id="ListReposV1",
keywords=kwargs,
params=handle_single_argument(args, parameters, "check_test_data")
)

@force_default(defaults=["parameters", "body"], default_types=["dict", "dict"])
Expand Down Expand Up @@ -127,6 +132,7 @@ def execute_dynamic(self: object,
"""Deploy a saved search.
Keyword arguments:
app_id -- Application ID. String.
body -- full body payload, not required if using other keywords.
{
"end": "string",
Expand Down Expand Up @@ -171,14 +177,14 @@ def get_search_results(self: object, parameters: dict = None, **kwargs) -> Dict[
"""Get the results of a saved search.
Keyword arguments:
app_id -- Application ID. String.
job_id -- Job ID for a previously executed asynchronous query. String.
limit -- The maximum number of records to return in this response. Integer.
Use with the offset parameter to manage pagination of results.
metadata -- Flag indicating if metadata should be included in the results. Boolean.
offset -- The offset to start retrieving records from. String.
Use with the limit parameter to manage pagination of results.
parameters - full parameters payload, not required if using other keywords.
version -- Version of the resource. String.
This method only supports keywords for providing arguments.
Expand Down Expand Up @@ -206,6 +212,7 @@ def execute(self: object,
"""Deploy a saved search.
Keyword arguments:
app_id -- Application ID. String.
body -- full body payload, not required if using other keywords.
{
"end": "string",
Expand Down Expand Up @@ -233,15 +240,15 @@ def execute(self: object,
],
"with_sort": {
"fields": [
"string"
"string"
],
"limit": 0,
"order": [
"string"
"string"
],
"reverse": true,
"type": [
"string"
"string"
]
}
}
Expand All @@ -250,12 +257,10 @@ def execute(self: object,
id -- Saved search ID. String.
include_test_data -- Include test data when executing searches. Boolean.
metadata -- Include metadata in the response. Boolean.
mode -- Mode to execute the query under (async, async_offload or sync). String.
name -- Saved search name. String.
search_parameters -- Search specific parameters. Dictionary.
NOT to be confused with the default parameters dictionary.
start -- Starting position. String.
version -- Version of the search. String.
with_in -- With in. Dictionary.
with_limit -- With limit. Dictionary.
with_renames -- With renames. Dictionary.
Expand Down Expand Up @@ -333,12 +338,16 @@ def download_results(self: object, parameters: dict = None, **kwargs) -> Dict[st
params=parameters
)

def list_views(self: object) -> Dict[str, Union[int, dict]]:
@force_default(defaults=["parameters"], default_types=["dict"])
def list_views(self: object, *args, parameters: dict = None, **kwargs) -> Dict[str, Union[int, dict]]:
"""List views.
Keyword arguments: This method does not accept keyword arguments.
Keyword arguments:
check_test_data -- Include whether test data is present in the application repository. Boolean.
parameters - full parameters payload, not required if using other keywords.
Arguments: This method does not accept arguments.
Arguments: When not specified, the first argument to this method is assumed to be 'check_test_data'.
All others are ignored.
Returns: dict object containing API response.
Expand All @@ -350,7 +359,9 @@ def list_views(self: object) -> Dict[str, Union[int, dict]]:
return process_service_request(
calling_object=self,
endpoints=Endpoints,
operation_id="ListViewV1"
operation_id="ListViewV1",
keywords=kwargs,
params=handle_single_argument(args, parameters, "check_test_data")
)

# These method names align to the operation IDs in the API but
Expand Down

0 comments on commit ec4ca0c

Please sign in to comment.