All URIs are relative to https://app.launchdarkly.com
Method | HTTP request | Description |
---|---|---|
create_subscription | POST /api/v2/integrations/{integrationKey} | Create audit log subscription |
delete_subscription | DELETE /api/v2/integrations/{integrationKey}/{id} | Delete audit log subscription |
get_subscription_by_id | GET /api/v2/integrations/{integrationKey}/{id} | Get audit log subscription by ID |
get_subscriptions | GET /api/v2/integrations/{integrationKey} | Get audit log subscriptions by integration |
update_subscription | PATCH /api/v2/integrations/{integrationKey}/{id} | Update audit log subscription |
Integration create_subscription(integration_key, subscription_post)
Create audit log subscription
Create an audit log subscription.
For each subscription, you must specify the set of resources you wish to subscribe to audit log notifications for. You can describe these resources using a custom role policy. To learn more, read Custom role concepts.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import integration_audit_log_subscriptions_api
from launchdarkly_api.model.subscription_post import SubscriptionPost
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from launchdarkly_api.model.integration import Integration
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = integration_audit_log_subscriptions_api.IntegrationAuditLogSubscriptionsApi(api_client)
integration_key = "integrationKey_example" # str | The integration key
subscription_post = SubscriptionPost(
name="Example audit log subscription.",
statements=StatementPostList([
StatementPost(
resources=["proj/*:env/*:flag/*;testing-tag"],
not_resources=[
"not_resources_example",
],
actions=["*"],
not_actions=[
"not_actions_example",
],
effect="allow",
),
]),
on=False,
tags=["testing-tag"],
config={
"key": None,
},
url="url_example",
api_key="api_key_example",
) # SubscriptionPost |
# example passing only required values which don't have defaults set
try:
# Create audit log subscription
api_response = api_instance.create_subscription(integration_key, subscription_post)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling IntegrationAuditLogSubscriptionsApi->create_subscription: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
integration_key | str | The integration key | |
subscription_post | SubscriptionPost |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | Integration response | - |
400 | Invalid request | - |
401 | Invalid access token | - |
403 | Forbidden | - |
404 | Invalid resource identifier | - |
429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_subscription(integration_key, id)
Delete audit log subscription
Delete an audit log subscription.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import integration_audit_log_subscriptions_api
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = integration_audit_log_subscriptions_api.IntegrationAuditLogSubscriptionsApi(api_client)
integration_key = "integrationKey_example" # str | The integration key
id = "id_example" # str | The subscription ID
# example passing only required values which don't have defaults set
try:
# Delete audit log subscription
api_instance.delete_subscription(integration_key, id)
except launchdarkly_api.ApiException as e:
print("Exception when calling IntegrationAuditLogSubscriptionsApi->delete_subscription: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
integration_key | str | The integration key | |
id | str | The subscription ID |
void (empty response body)
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | Action succeeded | - |
401 | Invalid access token | - |
403 | Forbidden | - |
404 | Invalid resource identifier | - |
429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Integration get_subscription_by_id(integration_key, id)
Get audit log subscription by ID
Get an audit log subscription by ID.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import integration_audit_log_subscriptions_api
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from launchdarkly_api.model.integration import Integration
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = integration_audit_log_subscriptions_api.IntegrationAuditLogSubscriptionsApi(api_client)
integration_key = "integrationKey_example" # str | The integration key
id = "id_example" # str | The subscription ID
# example passing only required values which don't have defaults set
try:
# Get audit log subscription by ID
api_response = api_instance.get_subscription_by_id(integration_key, id)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling IntegrationAuditLogSubscriptionsApi->get_subscription_by_id: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
integration_key | str | The integration key | |
id | str | The subscription ID |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Integration response | - |
401 | Invalid access token | - |
403 | Forbidden | - |
404 | Invalid resource identifier | - |
429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Integrations get_subscriptions(integration_key)
Get audit log subscriptions by integration
Get all audit log subscriptions associated with a given integration.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import integration_audit_log_subscriptions_api
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.integrations import Integrations
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = integration_audit_log_subscriptions_api.IntegrationAuditLogSubscriptionsApi(api_client)
integration_key = "integrationKey_example" # str | The integration key
# example passing only required values which don't have defaults set
try:
# Get audit log subscriptions by integration
api_response = api_instance.get_subscriptions(integration_key)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling IntegrationAuditLogSubscriptionsApi->get_subscriptions: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
integration_key | str | The integration key |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Integrations collection response | - |
401 | Invalid access token | - |
403 | Forbidden | - |
404 | Invalid resource identifier | - |
429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Integration update_subscription(integration_key, id, json_patch)
Update audit log subscription
Update an audit log subscription configuration. Updating an audit log subscription uses a JSON patch representation of the desired changes. To learn more, read Updates.
- Api Key Authentication (ApiKey):
import time
import launchdarkly_api
from launchdarkly_api.api import integration_audit_log_subscriptions_api
from launchdarkly_api.model.json_patch import JSONPatch
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.integration import Integration
from launchdarkly_api.model.status_conflict_error_rep import StatusConflictErrorRep
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: ApiKey
configuration.api_key['ApiKey'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = integration_audit_log_subscriptions_api.IntegrationAuditLogSubscriptionsApi(api_client)
integration_key = "integrationKey_example" # str | The integration key
id = "id_example" # str | The ID of the audit log subscription
json_patch = JSONPatch([
PatchOperation(
op="replace",
path="/exampleField",
value=None,
),
]) # JSONPatch |
# example passing only required values which don't have defaults set
try:
# Update audit log subscription
api_response = api_instance.update_subscription(integration_key, id, json_patch)
pprint(api_response)
except launchdarkly_api.ApiException as e:
print("Exception when calling IntegrationAuditLogSubscriptionsApi->update_subscription: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
integration_key | str | The integration key | |
id | str | The ID of the audit log subscription | |
json_patch | JSONPatch |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Integration response | - |
400 | Invalid request | - |
403 | Forbidden | - |
404 | Invalid resource identifier | - |
409 | Status conflict | - |
429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]