Skip to content

Latest commit

 

History

History
379 lines (265 loc) · 15.9 KB

File metadata and controls

379 lines (265 loc) · 15.9 KB

launchdarkly_api.AuditLogApi

All URIs are relative to https://app.launchdarkly.com

Method HTTP request Description
get_audit_log_entries GET /api/v2/auditlog List audit log entries
get_audit_log_entry GET /api/v2/auditlog/{id} Get audit log entry
post_audit_log_entries POST /api/v2/auditlog Search audit log entries
post_audit_log_entry_counts POST /api/v2/auditlog/counts Get audit log entry counts

get_audit_log_entries

AuditLogEntryListingRepCollection get_audit_log_entries(before=before, after=after, q=q, limit=limit, spec=spec)

List audit log entries

Get a list of all audit log entries. The query parameters let you restrict the results that return by date ranges, resource specifiers, or a full-text search query.

LaunchDarkly uses a resource specifier syntax to name resources or collections of resources. To learn more, read About the resource specifier syntax.

Example

  • Api Key Authentication (ApiKey):
import launchdarkly_api
from launchdarkly_api.models.audit_log_entry_listing_rep_collection import AuditLogEntryListingRepCollection
from launchdarkly_api.rest import ApiException
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'] = os.environ["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 = launchdarkly_api.AuditLogApi(api_client)
    before = 56 # int | A timestamp filter, expressed as a Unix epoch time in milliseconds.  All entries this returns occurred before the timestamp. (optional)
    after = 56 # int | A timestamp filter, expressed as a Unix epoch time in milliseconds. All entries this returns occurred after the timestamp. (optional)
    q = 'q_example' # str | Text to search for. You can search for the full or partial name of the resource. (optional)
    limit = 56 # int | A limit on the number of audit log entries that return. Set between 1 and 20. The default is 10. (optional)
    spec = 'spec_example' # str | A resource specifier that lets you filter audit log listings by resource (optional)

    try:
        # List audit log entries
        api_response = api_instance.get_audit_log_entries(before=before, after=after, q=q, limit=limit, spec=spec)
        print("The response of AuditLogApi->get_audit_log_entries:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling AuditLogApi->get_audit_log_entries: %s\n" % e)

Parameters

Name Type Description Notes
before int A timestamp filter, expressed as a Unix epoch time in milliseconds. All entries this returns occurred before the timestamp. [optional]
after int A timestamp filter, expressed as a Unix epoch time in milliseconds. All entries this returns occurred after the timestamp. [optional]
q str Text to search for. You can search for the full or partial name of the resource. [optional]
limit int A limit on the number of audit log entries that return. Set between 1 and 20. The default is 10. [optional]
spec str A resource specifier that lets you filter audit log listings by resource [optional]

Return type

AuditLogEntryListingRepCollection

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Audit log entries response -
400 Invalid request -
401 Invalid access token -
403 Forbidden -
429 Rate limited -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_audit_log_entry

AuditLogEntryRep get_audit_log_entry(id)

Get audit log entry

Fetch a detailed audit log entry representation. The detailed representation includes several fields that are not present in the summary representation, including:

  • previousVersion: a JSON representation of the previous version of the entity.
  • currentVersion: a JSON representation of the current version of the entity.
  • delta: the JSON patch body that was used in the request to update the entity. This is only included if the update was made through a JSON patch. It is null when the update was made using semantic patch. Because most flag updates are made using semantic patch, this field is rarely returned.

Example

  • Api Key Authentication (ApiKey):
import launchdarkly_api
from launchdarkly_api.models.audit_log_entry_rep import AuditLogEntryRep
from launchdarkly_api.rest import ApiException
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'] = os.environ["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 = launchdarkly_api.AuditLogApi(api_client)
    id = 'id_example' # str | The ID of the audit log entry

    try:
        # Get audit log entry
        api_response = api_instance.get_audit_log_entry(id)
        print("The response of AuditLogApi->get_audit_log_entry:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling AuditLogApi->get_audit_log_entry: %s\n" % e)

Parameters

Name Type Description Notes
id str The ID of the audit log entry

Return type

AuditLogEntryRep

Authorization

ApiKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Audit log entry 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]

post_audit_log_entries

AuditLogEntryListingRepCollection post_audit_log_entries(before=before, after=after, q=q, limit=limit, statement_post=statement_post)

Search audit log entries

Search your audit log entries. The query parameters let you restrict the results that return by date ranges, or a full-text search query. The request body lets you restrict the results that return by resource specifiers.

LaunchDarkly uses a resource specifier syntax to name resources or collections of resources. To learn more, read About the resource specifier syntax.

Example

  • Api Key Authentication (ApiKey):
import launchdarkly_api
from launchdarkly_api.models.audit_log_entry_listing_rep_collection import AuditLogEntryListingRepCollection
from launchdarkly_api.models.statement_post import StatementPost
from launchdarkly_api.rest import ApiException
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'] = os.environ["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 = launchdarkly_api.AuditLogApi(api_client)
    before = 56 # int | A timestamp filter, expressed as a Unix epoch time in milliseconds.  All entries returned occurred before the timestamp. (optional)
    after = 56 # int | A timestamp filter, expressed as a Unix epoch time in milliseconds. All entries returned occurred after the timestamp. (optional)
    q = 'q_example' # str | Text to search for. You can search for the full or partial name of the resource. (optional)
    limit = 56 # int | A limit on the number of audit log entries that return. Set between 1 and 20. The default is 10. (optional)
    statement_post = [launchdarkly_api.StatementPost()] # List[StatementPost] |  (optional)

    try:
        # Search audit log entries
        api_response = api_instance.post_audit_log_entries(before=before, after=after, q=q, limit=limit, statement_post=statement_post)
        print("The response of AuditLogApi->post_audit_log_entries:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling AuditLogApi->post_audit_log_entries: %s\n" % e)

Parameters

Name Type Description Notes
before int A timestamp filter, expressed as a Unix epoch time in milliseconds. All entries returned occurred before the timestamp. [optional]
after int A timestamp filter, expressed as a Unix epoch time in milliseconds. All entries returned occurred after the timestamp. [optional]
q str Text to search for. You can search for the full or partial name of the resource. [optional]
limit int A limit on the number of audit log entries that return. Set between 1 and 20. The default is 10. [optional]
statement_post List[StatementPost] [optional]

Return type

AuditLogEntryListingRepCollection

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Audit log entries response -
400 Invalid request -
401 Invalid access token -
403 Forbidden -
429 Rate limited -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

post_audit_log_entry_counts

CountBucketsResult post_audit_log_entry_counts(after, statement_post, before=before, buckets=buckets)

Get audit log entry counts

Returns aggregate counts of audit log entries per time bucket. Used for dashboard overlays that show flag targeting changes.

Example

  • Api Key Authentication (ApiKey):
import launchdarkly_api
from launchdarkly_api.models.count_buckets_result import CountBucketsResult
from launchdarkly_api.models.statement_post import StatementPost
from launchdarkly_api.rest import ApiException
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'] = os.environ["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 = launchdarkly_api.AuditLogApi(api_client)
    after = 56 # int | A timestamp filter, expressed as a Unix epoch time in milliseconds. Required.
    statement_post = [launchdarkly_api.StatementPost()] # List[StatementPost] | 
    before = 56 # int | A timestamp filter, expressed as a Unix epoch time in milliseconds. Defaults to now. (optional)
    buckets = 56 # int | Number of time buckets to divide the range into. Default 50, max 500. (optional)

    try:
        # Get audit log entry counts
        api_response = api_instance.post_audit_log_entry_counts(after, statement_post, before=before, buckets=buckets)
        print("The response of AuditLogApi->post_audit_log_entry_counts:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling AuditLogApi->post_audit_log_entry_counts: %s\n" % e)

Parameters

Name Type Description Notes
after int A timestamp filter, expressed as a Unix epoch time in milliseconds. Required.
statement_post List[StatementPost]
before int A timestamp filter, expressed as a Unix epoch time in milliseconds. Defaults to now. [optional]
buckets int Number of time buckets to divide the range into. Default 50, max 500. [optional]

Return type

CountBucketsResult

Authorization

ApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Audit log entry counts response -
400 Invalid request -
401 Invalid access token -
403 Forbidden -
429 Rate limited -

[Back to top] [Back to API list] [Back to Model list] [Back to README]