From 6d91933f394b7b7b4f95b561fbf794f9b1276b60 Mon Sep 17 00:00:00 2001 From: hpal Date: Wed, 11 Dec 2024 15:35:26 +0000 Subject: [PATCH 1/6] Add note on preserving API response case style for non-cloudResource kinds - Introduced a new section in the examples documentation to explain the use of `preserveApiResponseCaseStyle` in the selector configuration. - Provided examples for `pubsub.googleapis.com/Subscription` and `pubsub.googleapis.com/Topic`. - Clarified the purpose of this configuration to maintain camelCase format from the GCP API response. --- .../gcp/examples/mapping_extra_resources.md | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/cloud-providers/gcp/examples/mapping_extra_resources.md b/docs/build-your-software-catalog/sync-data-to-catalog/cloud-providers/gcp/examples/mapping_extra_resources.md index 703d1972f..a8a20a409 100644 --- a/docs/build-your-software-catalog/sync-data-to-catalog/cloud-providers/gcp/examples/mapping_extra_resources.md +++ b/docs/build-your-software-catalog/sync-data-to-catalog/cloud-providers/gcp/examples/mapping_extra_resources.md @@ -148,3 +148,32 @@ Create an integration configuration for the resource. The integration configurat machineType: ".machineType" # highlight-end ``` + + + +### Case Style Preservation + +For kinds returned by non-cloud asset APIs, such as `pubsub.googleapis.com/Subscription` and `pubsub.googleapis.com/Topic`, you can preserve the original API response case style by setting `preserveApiResponseCaseStyle: 'true'` in the selector configuration. For example: + +```yaml +- kind: pubsub.googleapis.com/Subscription + selector: + query: 'true' + preserveApiResponseCaseStyle: 'true' + port: + entity: + mappings: + identifier: .name + + - kind: pubsub.googleapis.com/Topic + selector: + query: 'true' + preserveApiResponseCaseStyle: 'true' + port: + entity: + mappings: + identifier: .name + title: .name | split("/") | last +``` + +This ensures that properties maintain their original camelCase format from the GCP API response. From 26bcf8002befff4f2f7e598062d72b3beb27c0e0 Mon Sep 17 00:00:00 2001 From: hpal Date: Thu, 12 Dec 2024 11:27:00 +0000 Subject: [PATCH 2/6] enhance case style preservation documentation for GCP integration - Added explicit list of supported APIs and their endpoints for case style preservation - Clarified default behavior when preserveApiResponseCaseStyle is not set - Added explanation of use cases and downstream compatibility - Improved structure with clear sections for better readability - Added examples showing how to enable the feature --- .../gcp/examples/mapping_extra_resources.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/cloud-providers/gcp/examples/mapping_extra_resources.md b/docs/build-your-software-catalog/sync-data-to-catalog/cloud-providers/gcp/examples/mapping_extra_resources.md index a8a20a409..87ae72129 100644 --- a/docs/build-your-software-catalog/sync-data-to-catalog/cloud-providers/gcp/examples/mapping_extra_resources.md +++ b/docs/build-your-software-catalog/sync-data-to-catalog/cloud-providers/gcp/examples/mapping_extra_resources.md @@ -153,9 +153,21 @@ Create an integration configuration for the resource. The integration configurat ### Case Style Preservation -For kinds returned by non-cloud asset APIs, such as `pubsub.googleapis.com/Subscription` and `pubsub.googleapis.com/Topic`, you can preserve the original API response case style by setting `preserveApiResponseCaseStyle: 'true'` in the selector configuration. For example: +Certain APIs return properties in specific case styles (e.g., snake_case). By default, the GCP integration will convert these properties to camelCase. However, you can preserve the original API response case style for the following APIs: -```yaml +- Projects (`cloudresourcemanager.googleapis.com/Project`) +- Organizations (`cloudresourcemanager.googleapis.com/Organization`) +- Folders (`cloudresourcemanager.googleapis.com/Folder`) +- Topics (`pubsub.googleapis.com/Topic`) +- Subscriptions (`pubsub.googleapis.com/Subscription`) + +This feature is particularly useful for ensuring compatibility with downstream systems or processes that depend on the original case style from the API response. + +#### How to Enable Case Style Preservation + +To preserve the case style, set `preserveApiResponseCaseStyle: true` in the selector configuration for the relevant API. For example: + +```yaml - kind: pubsub.googleapis.com/Subscription selector: query: 'true' @@ -176,4 +188,4 @@ For kinds returned by non-cloud asset APIs, such as `pubsub.googleapis.com/Subsc title: .name | split("/") | last ``` -This ensures that properties maintain their original camelCase format from the GCP API response. +When `preserveApiResponseCaseStyle` is not set or set to `false` (default behavior), all property names will be converted to camelCase format regardless of their original case style in the API response. From 9df9a88c18e427d94ce624073d6c36245a19638e Mon Sep 17 00:00:00 2001 From: hpal Date: Thu, 12 Dec 2024 14:36:26 +0000 Subject: [PATCH 3/6] Update mapping_extra_resources.md --- .../gcp/examples/mapping_extra_resources.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/cloud-providers/gcp/examples/mapping_extra_resources.md b/docs/build-your-software-catalog/sync-data-to-catalog/cloud-providers/gcp/examples/mapping_extra_resources.md index 87ae72129..2acca6994 100644 --- a/docs/build-your-software-catalog/sync-data-to-catalog/cloud-providers/gcp/examples/mapping_extra_resources.md +++ b/docs/build-your-software-catalog/sync-data-to-catalog/cloud-providers/gcp/examples/mapping_extra_resources.md @@ -153,7 +153,7 @@ Create an integration configuration for the resource. The integration configurat ### Case Style Preservation -Certain APIs return properties in specific case styles (e.g., snake_case). By default, the GCP integration will convert these properties to camelCase. However, you can preserve the original API response case style for the following APIs: +Certain APIs return properties in specific case styles (e.g., `camelCase`). By default, the GCP integration will convert them to `snake_case` format. However, you can preserve the original case style for the following APIs: - Projects (`cloudresourcemanager.googleapis.com/Project`) - Organizations (`cloudresourcemanager.googleapis.com/Organization`) @@ -161,11 +161,11 @@ Certain APIs return properties in specific case styles (e.g., snake_case). By de - Topics (`pubsub.googleapis.com/Topic`) - Subscriptions (`pubsub.googleapis.com/Subscription`) -This feature is particularly useful for ensuring compatibility with downstream systems or processes that depend on the original case style from the API response. +This feature is particularly useful for ensuring compatibility with downstream systems or processes that require `camelCase` formatting. -#### How to Enable Case Style Preservation +#### How to Enable Case Style Conversion -To preserve the case style, set `preserveApiResponseCaseStyle: true` in the selector configuration for the relevant API. For example: +To convert the case style to camelCase, set `preserveApiResponseCaseStyle: true` in the selector configuration for the relevant API. For example: ```yaml - kind: pubsub.googleapis.com/Subscription @@ -188,4 +188,4 @@ To preserve the case style, set `preserveApiResponseCaseStyle: true` in the sele title: .name | split("/") | last ``` -When `preserveApiResponseCaseStyle` is not set or set to `false` (default behavior), all property names will be converted to camelCase format regardless of their original case style in the API response. +When `preserveApiResponseCaseStyle` is not set or set to `false` (default behavior), all property names will converted to snake_case format regardless of their original case style in the API response. From fdcae10c5aa9b1716ac425a420bbf1f8a9f59c68 Mon Sep 17 00:00:00 2001 From: hpal Date: Fri, 13 Dec 2024 17:18:00 +0000 Subject: [PATCH 4/6] Make the introduction specific to affected kinds --- .../cloud-providers/gcp/examples/mapping_extra_resources.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/cloud-providers/gcp/examples/mapping_extra_resources.md b/docs/build-your-software-catalog/sync-data-to-catalog/cloud-providers/gcp/examples/mapping_extra_resources.md index 2acca6994..9134b65a1 100644 --- a/docs/build-your-software-catalog/sync-data-to-catalog/cloud-providers/gcp/examples/mapping_extra_resources.md +++ b/docs/build-your-software-catalog/sync-data-to-catalog/cloud-providers/gcp/examples/mapping_extra_resources.md @@ -153,7 +153,9 @@ Create an integration configuration for the resource. The integration configurat ### Case Style Preservation -Certain APIs return properties in specific case styles (e.g., `camelCase`). By default, the GCP integration will convert them to `snake_case` format. However, you can preserve the original case style for the following APIs: +For resources listed below, the GCP Integration provides flexibility to either transform the properties to snake_case or preserve the original case style (e.g., camelCase) returned by the API for consistency with other resources. + +This feature applies to the following kinds: - Projects (`cloudresourcemanager.googleapis.com/Project`) - Organizations (`cloudresourcemanager.googleapis.com/Organization`) From 34575782802030ca84a97e3c2f4193b7763f875e Mon Sep 17 00:00:00 2001 From: hadar-co Date: Sat, 14 Dec 2024 11:31:12 +0200 Subject: [PATCH 5/6] Update docs/build-your-software-catalog/sync-data-to-catalog/cloud-providers/gcp/examples/mapping_extra_resources.md --- .../cloud-providers/gcp/examples/mapping_extra_resources.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/cloud-providers/gcp/examples/mapping_extra_resources.md b/docs/build-your-software-catalog/sync-data-to-catalog/cloud-providers/gcp/examples/mapping_extra_resources.md index 9134b65a1..67d4edb11 100644 --- a/docs/build-your-software-catalog/sync-data-to-catalog/cloud-providers/gcp/examples/mapping_extra_resources.md +++ b/docs/build-your-software-catalog/sync-data-to-catalog/cloud-providers/gcp/examples/mapping_extra_resources.md @@ -153,7 +153,7 @@ Create an integration configuration for the resource. The integration configurat ### Case Style Preservation -For resources listed below, the GCP Integration provides flexibility to either transform the properties to snake_case or preserve the original case style (e.g., camelCase) returned by the API for consistency with other resources. +For the resources listed below, this integration provides flexibility to either transform the properties to `snake_case` or preserve the original case style (e.g., `camelCase`) returned by the API for consistency with other resources. This feature applies to the following kinds: From fd985b0b2d30907d670b701f34d55ddd2ea3f2a5 Mon Sep 17 00:00:00 2001 From: hadar-co Date: Sat, 14 Dec 2024 11:31:20 +0200 Subject: [PATCH 6/6] Update docs/build-your-software-catalog/sync-data-to-catalog/cloud-providers/gcp/examples/mapping_extra_resources.md --- .../cloud-providers/gcp/examples/mapping_extra_resources.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/cloud-providers/gcp/examples/mapping_extra_resources.md b/docs/build-your-software-catalog/sync-data-to-catalog/cloud-providers/gcp/examples/mapping_extra_resources.md index 67d4edb11..51d4841ad 100644 --- a/docs/build-your-software-catalog/sync-data-to-catalog/cloud-providers/gcp/examples/mapping_extra_resources.md +++ b/docs/build-your-software-catalog/sync-data-to-catalog/cloud-providers/gcp/examples/mapping_extra_resources.md @@ -155,7 +155,7 @@ Create an integration configuration for the resource. The integration configurat For the resources listed below, this integration provides flexibility to either transform the properties to `snake_case` or preserve the original case style (e.g., `camelCase`) returned by the API for consistency with other resources. -This feature applies to the following kinds: +This applies to the following kinds: - Projects (`cloudresourcemanager.googleapis.com/Project`) - Organizations (`cloudresourcemanager.googleapis.com/Organization`)