Skip to content

Commit

Permalink
Add missing http client-related blocks (#853) (#870)
Browse files Browse the repository at this point in the history
(cherry picked from commit b856035)

Co-authored-by: Mischa Thompson <[email protected]>
  • Loading branch information
github-actions[bot] and spartan0x117 authored May 15, 2024
1 parent 2812384 commit 9fd902b
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions docs/sources/reference/config-blocks/import.http.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,52 @@ Name | Type | Description | Def
`poll_frequency` | `duration` | Frequency to poll the URL. | `"1m"` | no
`poll_timeout` | `duration` | Timeout when polling the URL. | `"10s"` | no

## Blocks

The following blocks are supported inside the definition of `import.http`:

Hierarchy | Block | Description | Required
-----------------------------|-------------------|----------------------------------------------------------|---------
client | [client][] | HTTP client settings when connecting to the endpoint. | no
client > basic_auth | [basic_auth][] | Configure basic_auth for authenticating to the endpoint. | no
client > authorization | [authorization][] | Configure generic authorization to the endpoint. | no
client > oauth2 | [oauth2][] | Configure OAuth2 for authenticating to the endpoint. | no
client > oauth2 > tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no
client > tls_config | [tls_config][] | Configure TLS settings for connecting to the endpoint. | no

The `>` symbol indicates deeper levels of nesting.
For example, `client > basic_auth` refers to an `basic_auth` block defined inside a `client` block.

### client block

The `client` block configures settings used to connect to the HTTP server.

{{< docs/shared lookup="reference/components/http-client-config-block.md" source="alloy" version="<ALLOY_VERSION>" >}}

### basic_auth block

The `basic_auth` block configures basic authentication to use when polling the configured URL.

{{< docs/shared lookup="reference/components/basic-auth-block.md" source="alloy" version="<ALLOY_VERSION>" >}}

### authorization block

The `authorization` block configures custom authorization to use when polling the configured URL.

{{< docs/shared lookup="reference/components/authorization-block.md" source="alloy" version="<ALLOY_VERSION>" >}}

### oauth2 block

The `oauth2` block configures OAuth2 authorization to use when polling the configured URL.

{{< docs/shared lookup="reference/components/oauth2-block.md" source="alloy" version="<ALLOY_VERSION>" >}}

### tls_config block

The `tls_config` block configures TLS settings for connecting to HTTPS servers.

{{< docs/shared lookup="reference/components/tls-config-block.md" source="alloy" version="<ALLOY_VERSION>" >}}

## Example

This example imports custom components from an HTTP response and instantiates a custom component for adding two numbers:
Expand Down Expand Up @@ -57,3 +103,9 @@ math.add "default" {
}
```
{{< /collapse >}}

[client]: #client-block
[basic_auth]: #basic_auth-block
[authorization]: #authorization-block
[oauth2]: #oauth2-block
[tls_config]: #tls_config-block

0 comments on commit 9fd902b

Please sign in to comment.