From db24b5d5e38803530a9a8b29f4009a3e16d49b9f Mon Sep 17 00:00:00 2001 From: Agustin Bettati Date: Thu, 17 Oct 2024 12:52:28 +0200 Subject: [PATCH] add config for search deployment --- GNUmakefile | 2 +- tools/codegen/codespec/string_case.go | 10 ---------- tools/codegen/config.yml | 13 +++++++++++++ 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 5680dad48a..1a0bf5b154 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -155,5 +155,5 @@ jira-release-version: go run ./tools/jira-release-version/*.go .PHONY: generate-schema -generate-schema: +generate-schema: # resource_name is optional, if not provided all configured resources will be generated @go run ./tools/codegen/main.go $(resource_name) diff --git a/tools/codegen/codespec/string_case.go b/tools/codegen/codespec/string_case.go index ecb7546898..01cee9f6de 100644 --- a/tools/codegen/codespec/string_case.go +++ b/tools/codegen/codespec/string_case.go @@ -1,7 +1,6 @@ package codespec import ( - "regexp" "strings" ) @@ -25,12 +24,3 @@ func (snake SnakeCaseString) PascalCase() string { func (snake SnakeCaseString) LowerCaseNoUnderscore() string { return strings.ReplaceAll(string(snake), "_", "") } - -func ValidateSnakeCase(s string) bool { - snakeCaseRegex := `^[a-z]+(_[a-z]+)*$` - matched, err := regexp.MatchString(snakeCaseRegex, s) - if err != nil { - return false - } - return matched -} diff --git a/tools/codegen/config.yml b/tools/codegen/config.yml index 0889b0e1e1..2f2e500cd3 100644 --- a/tools/codegen/config.yml +++ b/tools/codegen/config.yml @@ -33,3 +33,16 @@ resources: computed: true timeouts: ["create", "read", "delete"] + + search_deployment: + read: + path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment + method: GET + create: + path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment + method: POST + schema: + aliases: + group_id: project_id + ignores: ["links"] + timeouts: ["create", "read", "delete"]