From afe1761e9faf6b5614d8b64c613589319eb76d2c Mon Sep 17 00:00:00 2001 From: Ivan De Marino Date: Thu, 28 Jul 2022 18:45:19 +0100 Subject: [PATCH] Streamline the links at the end of the website doc for HTTP Transport --- .../plugin/sdkv2/logging/http-transport.mdx | 35 +++++++++---------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/website/docs/plugin/sdkv2/logging/http-transport.mdx b/website/docs/plugin/sdkv2/logging/http-transport.mdx index f5f47bb9ee..82db67eb93 100644 --- a/website/docs/plugin/sdkv2/logging/http-transport.mdx +++ b/website/docs/plugin/sdkv2/logging/http-transport.mdx @@ -162,18 +162,18 @@ the following example shows the same logs in JSON format. Each log contains the following information, which is represented as [fields](https://www.terraform.io/plugin/log/writing#fields) in the JSON format. -| Log field name | Description | Possible values | Applies to | -|---------------------------:|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------|:------------------:| -| `tf_http_op_type` | Which HTTP operation log refers to | [`request`, `response`] | Request / Response | -| `tf_http_trans_id` | Unique identifier used by Request and Response that belong to the same HTTP Transaction | A universally unique identifier ([UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier)) | Request / Response | -| `tf_http_req_body` | Request body | | Request | -| `tf_http_req_method` | Request method | A canonical [HTTP methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Method) | Request | -| `tf_http_req_uri` | Request URI | Ex. `"/path"` | Request | -| `tf_http_req_version` | Request HTTP version | Ex. `"HTTP/1.1"` | Request | -| `tf_http_res_body` | Response body | | Response | -| `tf_http_res_status_code` | Response status code | A canonical [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) | Response | -| `tf_http_res_status_reason | Response status reason | Canonical textual description of the corresponding `tf_http_res_status_code` | Response | -| `tf_http_res_version` | Response HTTP version | Ex. `"HTTP/2.0"` | Response | +| Log field name | Description | Possible values | Applies to | +|---------------------------:|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------|:------------------:| +| `tf_http_op_type` | Which HTTP operation log refers to | [`request`, `response`] | Request / Response | +| `tf_http_trans_id` | Unique identifier used by Request and Response that belong to the same HTTP Transaction | A universally unique identifier ([UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier)) | Request / Response | +| `tf_http_req_body` | Request body | | Request | +| `tf_http_req_method` | Request method | A canonical [HTTP methods](https://developer.mozilla.org/en-US/docs/Web/HTTP/Method) | Request | +| `tf_http_req_uri` | Request URI | Ex. `"/path"` | Request | +| `tf_http_req_version` | Request HTTP version | Ex. `"HTTP/1.1"` | Request | +| `tf_http_res_body` | Response body | | Response | +| `tf_http_res_status_code` | Response status code | A canonical [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) | Response | +| `tf_http_res_status_reason | Response status reason | Canonical textual description of the corresponding `tf_http_res_status_code` | Response | +| `tf_http_res_version` | Response HTTP version | Ex. `"HTTP/2.0"` | Response | | (Other fields) | Request / Response headers. One field per header. If the header contains a single value, the log field value is set to that value. Otherwise, the field value is a slice of strings. | | Request / Response | @@ -201,11 +201,8 @@ defer res.Body.Close() ``` -# Resources +# Links -* [Plugin Development](https://www.terraform.io/plugin) -* [Plugin Development - Logging](https://www.terraform.io/plugin/log) -* [terraform-plugin-log - tflog](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-log/tflog) package documentation -* [terraform-plugin-log](https://github.com/hashicorp/terraform-plugin-log) GitHub repository -* [terraform-plugin-sdk](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2) [`NewLoggingHTTPTransport()`](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging#NewLoggingHTTPTransport) and [`NewSubsystemLoggingHTTPTransport()`](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging#NewSubsystemLoggingHTTPTransport) -* [New Logging Transport](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/helper/logging/logging_http_transport.go) source code +* [Plugin Development - Logging](https://www.terraform.io/plugin/log) - Learn more about the logging framework +* [terraform-plugin-log - tflog](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-log/tflog) - Read the Golang documentation for the logging framework +* Read the Golang documentation for [`NewLoggingHTTPTransport()`](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging#NewLoggingHTTPTransport) and [`NewSubsystemLoggingHTTPTransport()`](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging#NewSubsystemLoggingHTTPTransport)