Skip to content

Commit

Permalink
insights python updates for v2.1.40
Browse files Browse the repository at this point in the history
Signed-off-by: Concourse <[email protected]>
  • Loading branch information
Concourse committed Sep 25, 2024
1 parent 7b3150d commit 640086b
Show file tree
Hide file tree
Showing 23 changed files with 1,192 additions and 547 deletions.
47 changes: 45 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ This code is automatically generated by the [OpenAPI Generator](https://openapi-
## Versions

- API version: 0.0.804
- SDK version: 2.1.39
- SDK version: 2.1.40

## Requirements

Expand All @@ -56,7 +56,9 @@ import finbourne_insights

## Getting Started

You'll need to provide some configuration to connect to the FINBOURNE Insights API - see the articles about [short-lived access tokens](https://support.lusid.com/knowledgebase/article/KA-01654) and a [long-lived Personal Access Token](https://support.lusid.com/knowledgebase/article/KA-01774). This configuration can be provided using a secrets file or environment variables.
You'll need to provide some configuration to connect to the FINBOURNE Insights API - see the articles about [short-lived access tokens](https://support.lusid.com/knowledgebase/article/KA-01654) and a [long-lived Personal Access Token](https://support.lusid.com/knowledgebase/article/KA-01774). This configuration can be provided using a secrets file or environment variables.

For some configuration it is also possible to override the global configuration at the ApiClientFactory level, or at the request level. For the set of configuration which can be overridden, please see [ConfigurationOptions](sdk/finbourne_insights/extensions/configuration_options.py). For a code illustration of this configuration being overridden, please see the [example](#example).

### Environment variables

Expand All @@ -78,6 +80,18 @@ FBN_ACCESS_TOKEN

You can send your requests to the FINBOURNE Insights API via a proxy, by setting `FBN_PROXY_ADDRESS`. If your proxy has basic auth enabled, you must also set `FBN_PROXY_USERNAME` and `FBN_PROXY_PASSWORD`.

Other optional configuration

```bash
# sdk client timeouts in milliseconds - a value of 0 means no timeout, otherwise timeout values must be a positive integer
# please note - the chances of seeing a network issue increase with the duration of the request
# for this reason, rather than increasing the timeout, it will be more reliable to use an alternate polling style endpoint where these exist
FBN_TOTAL_TIMEOUT_MS # the default is 1800000 (30 minutes)
FBN_CONNECT_TIMEOUT_MS # the default is 0 (no timeout)
FBN_READ_TIMEOUT_MS # the default is 0 (no timeout)
FBN_RATE_LIMIT_RETRIES # the default is 2
```

### Secrets file

The secrets file must be in the current working directory.
Expand Down Expand Up @@ -126,10 +140,28 @@ You can send your requests to the FINBOURNE Insights API via a proxy, by adding
}
```

Other optional configuration

```javascript
{
"api":
{
// sdk client timeouts in milliseconds - a value of 0 means no timeout, otherwise timeout values must be a positive integer
// please note - the chances of seeing a network issue increase with the duration of the request
// for this reason, rather than increasing the timeout, it will be more reliable to use an alternate polling style endpoint where these exist
"totalTimeoutMs":<timeout-in-ms>, // the default is 1800000 (30 minutes)
"connectTimeoutMs":<timeout-in-ms>, // the default is 0 (no timeout)
"readTimeoutMs":<timeout-in-ms>, // the default is 0 (no timeout)
"rateLimitRetries":<retries-when-being-rate-limited> // the default is 2
}
}
```

### Example
```python
import asyncio
from finbourne_insights.exceptions import ApiException
from finbourne_insights.extensions.configuration_options import ConfigurationOptions
from finbourne_insights.models import *
from pprint import pprint
from finbourne_insights import (
Expand All @@ -156,6 +188,14 @@ async def main():
# Use the finbourne_insights ApiClientFactory to build Api instances with a configured api client
# By default this will read config from environment variables
# Then from a secrets.json file found in the current working directory

# uncomment the below to use configuration overrides
# opts = ConfigurationOptions();
# opts.total_timeout_ms = 30_000

# uncomment the below to use an api client factory with overrides
# api_client_factory = ApiClientFactory(opts=opts)

api_client_factory = ApiClientFactory()

# Enter a context with an instance of the ApiClientFactory to ensure the connection pool is closed after use
Expand All @@ -165,6 +205,9 @@ async def main():
id = 'id_example' # str | The identifier of the access evaluation to obtain the log for.

try:
# uncomment the below to set overrides at the request level
# api_response = await api_instance.get_access_evaluation_log(id, opts=opts)

# [EARLY ACCESS] GetAccessEvaluationLog: Get the log for a specific access evaluation. This endpoint will be deprecated in the near future.
api_response = await api_instance.get_access_evaluation_log(id)
pprint(api_response)
Expand Down
24 changes: 24 additions & 0 deletions sdk/docs/AccessEvaluationsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Method | HTTP request | Description
```python
import asyncio
from finbourne_insights.exceptions import ApiException
from finbourne_insights.extensions.configuration_options import ConfigurationOptions
from finbourne_insights.models import *
from pprint import pprint
from finbourne_insights import (
Expand All @@ -44,6 +45,14 @@ async def main():
# Use the finbourne_insights ApiClientFactory to build Api instances with a configured api client
# By default this will read config from environment variables
# Then from a secrets.json file found in the current working directory

# uncomment the below to use configuration overrides
# opts = ConfigurationOptions();
# opts.total_timeout_ms = 30_000

# uncomment the below to use an api client factory with overrides
# api_client_factory = ApiClientFactory(opts=opts)

api_client_factory = ApiClientFactory()

# Enter a context with an instance of the ApiClientFactory to ensure the connection pool is closed after use
Expand All @@ -53,6 +62,9 @@ async def main():
id = 'id_example' # str | The identifier of the access evaluation to obtain the log for.

try:
# uncomment the below to set overrides at the request level
# api_response = await api_instance.get_access_evaluation_log(id, opts=opts)

# [EARLY ACCESS] GetAccessEvaluationLog: Get the log for a specific access evaluation. This endpoint will be deprecated in the near future.
api_response = await api_instance.get_access_evaluation_log(id)
pprint(api_response)
Expand Down Expand Up @@ -96,6 +108,7 @@ Name | Type | Description | Notes
```python
import asyncio
from finbourne_insights.exceptions import ApiException
from finbourne_insights.extensions.configuration_options import ConfigurationOptions
from finbourne_insights.models import *
from pprint import pprint
from finbourne_insights import (
Expand All @@ -122,6 +135,14 @@ async def main():
# Use the finbourne_insights ApiClientFactory to build Api instances with a configured api client
# By default this will read config from environment variables
# Then from a secrets.json file found in the current working directory

# uncomment the below to use configuration overrides
# opts = ConfigurationOptions();
# opts.total_timeout_ms = 30_000

# uncomment the below to use an api client factory with overrides
# api_client_factory = ApiClientFactory(opts=opts)

api_client_factory = ApiClientFactory()

# Enter a context with an instance of the ApiClientFactory to ensure the connection pool is closed after use
Expand All @@ -137,6 +158,9 @@ async def main():
histogram_interval = 'histogram_interval_example' # str | The interval for an included histogram of the logs (optional)

try:
# uncomment the below to set overrides at the request level
# api_response = await api_instance.list_access_evaluation_logs(start_at=start_at, end_at=end_at, filter=filter, sort_by=sort_by, limit=limit, page=page, histogram_interval=histogram_interval, opts=opts)

# [EARLY ACCESS] ListAccessEvaluationLogs: List the logs for access evaluations.
api_response = await api_instance.list_access_evaluation_logs(start_at=start_at, end_at=end_at, filter=filter, sort_by=sort_by, limit=limit, page=page, histogram_interval=histogram_interval)
pprint(api_response)
Expand Down
12 changes: 12 additions & 0 deletions sdk/docs/ApplicationMetadataApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Get the comprehensive set of resources that are available for access control
```python
import asyncio
from finbourne_insights.exceptions import ApiException
from finbourne_insights.extensions.configuration_options import ConfigurationOptions
from finbourne_insights.models import *
from pprint import pprint
from finbourne_insights import (
Expand All @@ -45,6 +46,14 @@ async def main():
# Use the finbourne_insights ApiClientFactory to build Api instances with a configured api client
# By default this will read config from environment variables
# Then from a secrets.json file found in the current working directory

# uncomment the below to use configuration overrides
# opts = ConfigurationOptions();
# opts.total_timeout_ms = 30_000

# uncomment the below to use an api client factory with overrides
# api_client_factory = ApiClientFactory(opts=opts)

api_client_factory = ApiClientFactory()

# Enter a context with an instance of the ApiClientFactory to ensure the connection pool is closed after use
Expand All @@ -53,6 +62,9 @@ async def main():
api_instance = api_client_factory.build(ApplicationMetadataApi)

try:
# uncomment the below to set overrides at the request level
# api_response = await api_instance.list_access_controlled_resources(opts=opts)

# ListAccessControlledResources: Get resources available for access control
api_response = await api_instance.list_access_controlled_resources()
pprint(api_response)
Expand Down
36 changes: 36 additions & 0 deletions sdk/docs/AuditingApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Method | HTTP request | Description
```python
import asyncio
from finbourne_insights.exceptions import ApiException
from finbourne_insights.extensions.configuration_options import ConfigurationOptions
from finbourne_insights.models import *
from pprint import pprint
from finbourne_insights import (
Expand All @@ -45,6 +46,14 @@ async def main():
# Use the finbourne_insights ApiClientFactory to build Api instances with a configured api client
# By default this will read config from environment variables
# Then from a secrets.json file found in the current working directory

# uncomment the below to use configuration overrides
# opts = ConfigurationOptions();
# opts.total_timeout_ms = 30_000

# uncomment the below to use an api client factory with overrides
# api_client_factory = ApiClientFactory(opts=opts)

api_client_factory = ApiClientFactory()

# Enter a context with an instance of the ApiClientFactory to ensure the connection pool is closed after use
Expand All @@ -59,6 +68,9 @@ async def main():
create_audit_entry = CreateAuditEntry.from_dict({"process":{"name":"processName","runId":"processRunId","startTime":"0001-01-01T00:00:00.0000000+00:00"},"data":{"action":"dataAction","category":"dataCategory","userId":"dataUserId","message":"dataMessage","resource":{"type":"resourceType","identifier":"resourceIdentifier"},"detailsType":"dataDetailsType"}}) # CreateAuditEntry | Information about the entry to be created. (optional)

try:
# uncomment the below to set overrides at the request level
# api_response = await api_instance.create_entry(create_audit_entry=create_audit_entry, opts=opts)

# [EARLY ACCESS] CreateEntry: Create (persist) and audit entry..
api_response = await api_instance.create_entry(create_audit_entry=create_audit_entry)
pprint(api_response)
Expand Down Expand Up @@ -105,6 +117,7 @@ This will never be `null`, though it may be empty.
```python
import asyncio
from finbourne_insights.exceptions import ApiException
from finbourne_insights.extensions.configuration_options import ConfigurationOptions
from finbourne_insights.models import *
from pprint import pprint
from finbourne_insights import (
Expand All @@ -131,6 +144,14 @@ async def main():
# Use the finbourne_insights ApiClientFactory to build Api instances with a configured api client
# By default this will read config from environment variables
# Then from a secrets.json file found in the current working directory

# uncomment the below to use configuration overrides
# opts = ConfigurationOptions();
# opts.total_timeout_ms = 30_000

# uncomment the below to use an api client factory with overrides
# api_client_factory = ApiClientFactory(opts=opts)

api_client_factory = ApiClientFactory()

# Enter a context with an instance of the ApiClientFactory to ensure the connection pool is closed after use
Expand All @@ -139,6 +160,9 @@ async def main():
api_instance = api_client_factory.build(AuditingApi)

try:
# uncomment the below to set overrides at the request level
# api_response = await api_instance.get_processes(opts=opts)

# [EARLY ACCESS] GetProcesses: Get the latest audit entry for each process.
api_response = await api_instance.get_processes()
pprint(api_response)
Expand Down Expand Up @@ -180,6 +204,7 @@ This will never be `null`, though it may be empty.
```python
import asyncio
from finbourne_insights.exceptions import ApiException
from finbourne_insights.extensions.configuration_options import ConfigurationOptions
from finbourne_insights.models import *
from pprint import pprint
from finbourne_insights import (
Expand All @@ -206,6 +231,14 @@ async def main():
# Use the finbourne_insights ApiClientFactory to build Api instances with a configured api client
# By default this will read config from environment variables
# Then from a secrets.json file found in the current working directory

# uncomment the below to use configuration overrides
# opts = ConfigurationOptions();
# opts.total_timeout_ms = 30_000

# uncomment the below to use an api client factory with overrides
# api_client_factory = ApiClientFactory(opts=opts)

api_client_factory = ApiClientFactory()

# Enter a context with an instance of the ApiClientFactory to ensure the connection pool is closed after use
Expand All @@ -218,6 +251,9 @@ async def main():
state = 'state_example' # str | The scrolling state, used to iterate through the data set. (optional)

try:
# uncomment the below to set overrides at the request level
# api_response = await api_instance.list_entries(filter=filter, sort_by=sort_by, size=size, state=state, opts=opts)

# [EARLY ACCESS] ListEntries: Get the audit entries.
api_response = await api_instance.list_entries(filter=filter, sort_by=sort_by, size=size, state=state)
pprint(api_response)
Expand Down
Loading

0 comments on commit 640086b

Please sign in to comment.