Skip to content

Latest commit

 

History

History
137 lines (98 loc) · 6.42 KB

File metadata and controls

137 lines (98 loc) · 6.42 KB

Packs.Destinations.Samples

Overview

Available Operations

  • get - Get sample event data for a Destination within a Pack
  • create - Send sample event data to a Destination within a Pack

get

Get sample event data for the specified Destination to validate the configuration or test connectivity within the specified Pack.

Example Usage

from cribl_control_plane import CriblControlPlane, models
import os


with CriblControlPlane(
    "https://api.example.com",
    security=models.Security(
        bearer_auth=os.getenv("CRIBLCONTROLPLANE_BEARER_AUTH", ""),
    ),
) as ccp_client:

    res = ccp_client.packs.destinations.samples.get(id="<id>", pack="<value>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
id str ✔️ The id of the Destination to get sample event data for.
pack str ✔️ The id of the Pack to get.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.CountedOutputSamplesResponse

Errors

Error Type Status Code Content Type
errors.Error 500 application/json
errors.APIError 4XX, 5XX */*

create

Send sample event data to the specified Destination to validate the configuration or test connectivity within the specified Pack.

Example Usage: OutputTestExamplesMultipleEvents

from cribl_control_plane import CriblControlPlane, models
import os


with CriblControlPlane(
    "https://api.example.com",
    security=models.Security(
        bearer_auth=os.getenv("CRIBLCONTROLPLANE_BEARER_AUTH", ""),
    ),
) as ccp_client:

    res = ccp_client.packs.destinations.samples.create(id="<id>", pack="<value>", events=[
        {
            "_raw": "Test event 1",
            "source": "test",
            "sourcetype": "manual",
        },
        {
            "_raw": "Test event 2",
            "source": "test",
            "sourcetype": "manual",
        },
    ])

    # Handle response
    print(res)

Example Usage: OutputTestExamplesSingleEvent

from cribl_control_plane import CriblControlPlane, models
import os


with CriblControlPlane(
    "https://api.example.com",
    security=models.Security(
        bearer_auth=os.getenv("CRIBLCONTROLPLANE_BEARER_AUTH", ""),
    ),
) as ccp_client:

    res = ccp_client.packs.destinations.samples.create(id="<id>", pack="<value>", events=[
        {
            "_raw": "This is a test event",
            "source": "test",
            "sourcetype": "manual",
        },
    ])

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
id str ✔️ The id of the Destination to send sample event data to.
pack str ✔️ The id of the Pack to create.
events List[Dict[str, Any]] ✔️ Array of event objects to send to the Destination for testing.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.CountedOutputTestResponse

Errors

Error Type Status Code Content Type
errors.Error 500 application/json
errors.APIError 4XX, 5XX */*