From f3e7531267b31adca84309a9516b86242f715fda Mon Sep 17 00:00:00 2001 From: 1gtm <1gtm@appscode.com> Date: Sun, 18 Jan 2026 15:34:27 +0000 Subject: [PATCH] Prepare for release v0.60.0 ProductLine: KubeDB Release: v2026.1.19 Release-tracker: https://github.com/kubedb/CHANGELOG/pull/124 Signed-off-by: 1gtm <1gtm@appscode.com> --- go.mod | 24 +- go.sum | 50 +- .../Azure/go-ansiterm/osc_string_state.go | 18 +- .../Masterminds/semver/v3/CHANGELOG.md | 28 +- .../Masterminds/semver/v3/README.md | 18 +- .../Masterminds/semver/v3/constraints.go | 127 +- .../Masterminds/semver/v3/version.go | 163 ++- vendor/github.com/moby/term/term_unix.go | 2 +- .../opensearch-go/v3/.codecov.yml | 15 + .../opensearch-go/v3/.dockerignore | 2 + .../opensearch-go/v3/.gitignore | 9 + .../opensearch-go/v3/.golangci.yml | 175 +++ .../opensearch-go/v3/.whitesource | 15 + .../opensearch-go/v3/ADMINS.md | 38 + .../opensearch-go/v3/CHANGELOG.md | 157 +++ .../opensearch-go/v3/CODE_OF_CONDUCT.md | 22 + .../opensearch-go/v3/COMPATIBILITY.md | 15 + .../opensearch-go/v3/CONTRIBUTING.md | 113 ++ .../opensearch-go/v3/DEVELOPER_GUIDE.md | 147 ++ .../opensearch-go/v3/LICENSE.txt | 201 +++ .../opensearch-go/v3/MAINTAINERS.md | 21 + .../opensearch-go/v3/Makefile | 239 ++++ .../opensearch-go/v3/NOTICE.txt | 8 + .../opensearch-go/v3/OpenSearch.svg | 1 + .../opensearch-go/v3/README.md | 42 + .../opensearch-go/v3/RELEASING.md | 60 + .../opensearch-go/v3/SECURITY.md | 3 + .../opensearch-go/v3/UPGRADING.md | 246 ++++ .../opensearch-go/v3/USER_GUIDE.md | 390 ++++++ .../opensearch-go/v3/doc.go | 74 + .../v3/internal/version/version.go | 30 + .../opensearch-go/v3/opensearch.go | 359 +++++ .../v3/opensearchapi/api_aliases-params.go | 70 + .../v3/opensearchapi/api_aliases.go | 58 + .../v3/opensearchapi/api_bulk-params.go | 113 ++ .../v3/opensearchapi/api_bulk.go | 109 ++ .../opensearchapi/api_cat-aliases-params.go | 85 ++ .../v3/opensearchapi/api_cat-aliases.go | 63 + .../api_cat-allocation-params.go | 101 ++ .../v3/opensearchapi/api_cat-allocation.go | 67 + .../api_cat-cluster_manager-params.go | 91 ++ .../opensearchapi/api_cat-cluster_manager.go | 51 + .../v3/opensearchapi/api_cat-count-params.go | 75 + .../v3/opensearchapi/api_cat-count.go | 60 + .../opensearchapi/api_cat-fielddata-params.go | 80 ++ .../v3/opensearchapi/api_cat-fielddata.go | 63 + .../v3/opensearchapi/api_cat-health-params.go | 85 ++ .../v3/opensearchapi/api_cat-health.go | 63 + .../opensearchapi/api_cat-indices-params.go | 121 ++ .../v3/opensearchapi/api_cat-indices.go | 203 +++ .../v3/opensearchapi/api_cat-master-params.go | 91 ++ .../v3/opensearchapi/api_cat-master.go | 51 + .../opensearchapi/api_cat-nodeattrs-params.go | 91 ++ .../v3/opensearchapi/api_cat-nodeattrs.go | 55 + .../v3/opensearchapi/api_cat-nodes-params.go | 111 ++ .../v3/opensearchapi/api_cat-nodes.go | 146 ++ .../api_cat-pending_tasks-params.go | 96 ++ .../v3/opensearchapi/api_cat-pending_tasks.go | 51 + .../opensearchapi/api_cat-plugins-params.go | 91 ++ .../v3/opensearchapi/api_cat-plugins.go | 52 + .../opensearchapi/api_cat-recovery-params.go | 95 ++ .../v3/opensearchapi/api_cat-recovery.go | 83 ++ .../api_cat-repositories-params.go | 91 ++ .../v3/opensearchapi/api_cat-repositories.go | 49 + .../opensearchapi/api_cat-segments-params.go | 96 ++ .../v3/opensearchapi/api_cat-segments.go | 72 + .../v3/opensearchapi/api_cat-shards-params.go | 101 ++ .../v3/opensearchapi/api_cat-shards.go | 136 ++ .../opensearchapi/api_cat-snapshots-params.go | 96 ++ .../v3/opensearchapi/api_cat-snapshots.go | 61 + .../v3/opensearchapi/api_cat-tasks-params.go | 105 ++ .../v3/opensearchapi/api_cat-tasks.go | 62 + .../opensearchapi/api_cat-templates-params.go | 91 ++ .../v3/opensearchapi/api_cat-templates.go | 62 + .../api_cat-thread_pool-params.go | 91 ++ .../v3/opensearchapi/api_cat-thread_pool.go | 78 ++ .../opensearch-go/v3/opensearchapi/api_cat.go | 351 +++++ .../api_cluster-allocation_explain-params.go | 67 + .../api_cluster-allocation_explain.go | 112 ++ .../api_cluster-decommission-params.go | 102 ++ .../opensearchapi/api_cluster-decommission.go | 116 ++ .../api_cluster-health-params.go | 118 ++ .../v3/opensearchapi/api_cluster-health.go | 69 + .../api_cluster-pending_tasks-params.go | 72 + .../api_cluster-pending_tasks.go | 51 + .../api_cluster-remote_info-params.go | 52 + .../opensearchapi/api_cluster-remote_info.go | 52 + .../api_cluster-reroute-params.go | 94 ++ .../v3/opensearchapi/api_cluster-reroute.go | 75 + .../api_cluster-settings-params.go | 129 ++ .../v3/opensearchapi/api_cluster-settings.go | 76 ++ .../opensearchapi/api_cluster-state-params.go | 103 ++ .../v3/opensearchapi/api_cluster-state.go | 221 +++ .../opensearchapi/api_cluster-stats-params.go | 62 + .../v3/opensearchapi/api_cluster-stats.go | 274 ++++ ...cluster-voting_config_exclusions-params.go | 104 ++ .../api_cluster-voting_config_exclusions.go | 47 + .../v3/opensearchapi/api_cluster.go | 241 ++++ .../api_component_template-create-params.go | 78 ++ .../api_component_template-create.go | 47 + .../api_component_template-delete-params.go | 72 + .../api_component_template-delete.go | 44 + .../api_component_template-exists-params.go | 73 + .../api_component_template-exists.go | 33 + .../api_component_template-get-params.go | 73 + .../api_component_template-get.go | 65 + .../opensearchapi/api_component_template.go | 65 + .../api_dangling-delete-params.go | 78 ++ .../v3/opensearchapi/api_dangling-delete.go | 44 + .../opensearchapi/api_dangling-get-params.go | 52 + .../v3/opensearchapi/api_dangling-get.go | 61 + .../api_dangling-import-params.go | 78 ++ .../v3/opensearchapi/api_dangling-import.go | 44 + .../v3/opensearchapi/api_dangling.go | 58 + .../api_datastream-create-params.go | 52 + .../v3/opensearchapi/api_datastream-create.go | 44 + .../api_datastream-delete-params.go | 65 + .../v3/opensearchapi/api_datastream-delete.go | 44 + .../api_datastream-get-params.go | 60 + .../v3/opensearchapi/api_datastream-get.go | 72 + .../api_datastream-stats-params.go | 60 + .../v3/opensearchapi/api_datastream-stats.go | 71 + .../v3/opensearchapi/api_datastream.go | 75 + .../api_document-create-params.go | 93 ++ .../v3/opensearchapi/api_document-create.go | 66 + .../api_document-delete-params.go | 98 ++ .../v3/opensearchapi/api_document-delete.go | 62 + .../api_document-delete_by_query-params.go | 234 ++++ .../api_document-delete_by_query.go | 64 + ...ument-delete_by_query_rethrottle-params.go | 62 + ...api_document-delete_by_query_rethrottle.go | 96 ++ .../api_document-exists-params.go | 117 ++ .../v3/opensearchapi/api_document-exists.go | 34 + .../api_document-exists_source-params.go | 112 ++ .../api_document-exists_source.go | 34 + .../api_document-explain-params.go | 127 ++ .../v3/opensearchapi/api_document-explain.go | 59 + .../opensearchapi/api_document-get-params.go | 117 ++ .../v3/opensearchapi/api_document-get.go | 53 + .../api_document-source-params.go | 113 ++ .../v3/opensearchapi/api_document-source.go | 46 + .../v3/opensearchapi/api_document.go | 120 ++ .../v3/opensearchapi/api_index-params.go | 113 ++ .../v3/opensearchapi/api_index.go | 81 ++ .../api_index_template-create-params.go | 78 ++ .../api_index_template-create.go | 47 + .../api_index_template-delete-params.go | 72 + .../api_index_template-delete.go | 44 + .../api_index_template-exists-params.go | 78 ++ .../api_index_template-exists.go | 33 + .../api_index_template-get-params.go | 78 ++ .../opensearchapi/api_index_template-get.go | 63 + .../api_index_template-simulate-params.go | 78 ++ .../api_index_template-simulate.go | 56 + ...pi_index_template-simulate_index-params.go | 78 ++ .../api_index_template-simulate_index.go | 56 + .../v3/opensearchapi/api_index_template.go | 94 ++ .../opensearchapi/api_indices-alias-params.go | 206 +++ .../v3/opensearchapi/api_indices-alias.go | 214 +++ .../api_indices-analyze-params.go | 52 + .../v3/opensearchapi/api_indices-analyze.go | 128 ++ .../opensearchapi/api_indices-block-params.go | 88 ++ .../v3/opensearchapi/api_indices-block.go | 58 + .../opensearchapi/api_indices-cache-params.go | 93 ++ .../v3/opensearchapi/api_indices-cache.go | 58 + .../opensearchapi/api_indices-clone-params.go | 73 + .../v3/opensearchapi/api_indices-clone.go | 50 + .../opensearchapi/api_indices-close-params.go | 93 ++ .../v3/opensearchapi/api_indices-close.go | 48 + .../opensearchapi/api_indices-count-params.go | 128 ++ .../v3/opensearchapi/api_indices-count.go | 62 + .../api_indices-create-params.go | 76 ++ .../v3/opensearchapi/api_indices-create.go | 47 + .../api_indices-delete-params.go | 87 ++ .../v3/opensearchapi/api_indices-delete.go | 44 + .../api_indices-exists-params.go | 85 ++ .../v3/opensearchapi/api_indices-exists.go | 33 + .../api_indices-field_caps-params.go | 83 ++ .../opensearchapi/api_indices-field_caps.go | 62 + .../opensearchapi/api_indices-flush-params.go | 82 ++ .../v3/opensearchapi/api_indices-flush.go | 57 + .../api_indices-forcemerge-params.go | 87 ++ .../opensearchapi/api_indices-forcemerge.go | 57 + .../opensearchapi/api_indices-get-params.go | 98 ++ .../v3/opensearchapi/api_indices-get.go | 50 + .../api_indices-mapping-params.go | 149 ++ .../v3/opensearchapi/api_indices-mapping.go | 192 +++ .../opensearchapi/api_indices-open-params.go | 93 ++ .../v3/opensearchapi/api_indices-open.go | 45 + .../api_indices-recovery-params.go | 67 + .../v3/opensearchapi/api_indices-recovery.go | 102 ++ .../api_indices-refresh-params.go | 72 + .../v3/opensearchapi/api_indices-refresh.go | 57 + .../api_indices-resolve-params.go | 58 + .../v3/opensearchapi/api_indices-resolve.go | 58 + .../api_indices-rollover-params.go | 83 ++ .../v3/opensearchapi/api_indices-rollover.go | 63 + .../api_indices-segments-params.go | 77 ++ .../v3/opensearchapi/api_indices-segments.go | 93 ++ .../api_indices-settings-params.go | 164 +++ .../v3/opensearchapi/api_indices-settings.go | 136 ++ .../api_indices-shardstores-params.go | 78 ++ .../opensearchapi/api_indices-shardstores.go | 58 + .../api_indices-shrink-params.go | 83 ++ .../v3/opensearchapi/api_indices-shrink.go | 50 + .../opensearchapi/api_indices-split-params.go | 83 ++ .../v3/opensearchapi/api_indices-split.go | 50 + .../opensearchapi/api_indices-stats-params.go | 83 ++ .../v3/opensearchapi/api_indices-stats.go | 314 +++++ .../api_indices-validate-params.go | 117 ++ .../v3/opensearchapi/api_indices-validate.go | 69 + .../v3/opensearchapi/api_indices.go | 360 +++++ .../v3/opensearchapi/api_info-params.go | 52 + .../v3/opensearchapi/api_info.go | 73 + .../opensearchapi/api_ingest-create-params.go | 70 + .../v3/opensearchapi/api_ingest-create.go | 47 + .../opensearchapi/api_ingest-delete-params.go | 70 + .../v3/opensearchapi/api_ingest-delete.go | 44 + .../v3/opensearchapi/api_ingest-get-params.go | 73 + .../v3/opensearchapi/api_ingest-get.go | 49 + .../opensearchapi/api_ingest-grok-params.go | 52 + .../v3/opensearchapi/api_ingest-grok.go | 41 + .../api_ingest-simulate-params.go | 60 + .../v3/opensearchapi/api_ingest-simulate.go | 56 + .../v3/opensearchapi/api_ingest.go | 88 ++ .../v3/opensearchapi/api_mget-params.go | 107 ++ .../v3/opensearchapi/api_mget.go | 78 ++ .../v3/opensearchapi/api_msearch-params.go | 92 ++ .../api_msearch-template-params.go | 82 ++ .../v3/opensearchapi/api_msearch-template.go | 83 ++ .../v3/opensearchapi/api_msearch.go | 83 ++ .../opensearchapi/api_mtermvectors-params.go | 118 ++ .../v3/opensearchapi/api_mtermvectors.go | 77 ++ .../api_nodes-hot_threads-params.go | 83 ++ .../v3/opensearchapi/api_nodes-hot_threads.go | 44 + .../v3/opensearchapi/api_nodes-info-params.go | 68 + .../v3/opensearchapi/api_nodes-info.go | 195 +++ .../api_nodes-reload_security-params.go | 62 + .../api_nodes-reload_security.go | 68 + .../opensearchapi/api_nodes-stats-params.go | 104 ++ .../v3/opensearchapi/api_nodes-stats.go | 707 ++++++++++ .../opensearchapi/api_nodes-usage-params.go | 62 + .../v3/opensearchapi/api_nodes-usage.go | 78 ++ .../v3/opensearchapi/api_nodes.go | 93 ++ .../v3/opensearchapi/api_ping-params.go | 52 + .../v3/opensearchapi/api_ping.go | 40 + .../api_point_in_time-create-params.go | 62 + .../opensearchapi/api_point_in_time-create.go | 61 + .../api_point_in_time-delete-params.go | 32 + .../opensearchapi/api_point_in_time-delete.go | 64 + .../api_point_in_time-get-params.go | 32 + .../v3/opensearchapi/api_point_in_time-get.go | 45 + .../v3/opensearchapi/api_point_in_time.go | 58 + .../v3/opensearchapi/api_rank_eval-params.go | 77 ++ .../v3/opensearchapi/api_rank_eval.go | 72 + .../v3/opensearchapi/api_reindex-params.go | 99 ++ .../v3/opensearchapi/api_reindex.go | 76 ++ .../api_reindex_rethrottle-params.go | 62 + .../opensearchapi/api_reindex_rethrottle.go | 116 ++ .../api_render_search_template-params.go | 52 + .../api_render_search_template.go | 69 + .../api_script-context-params.go | 52 + .../v3/opensearchapi/api_script-context.go | 51 + .../opensearchapi/api_script-delete-params.go | 72 + .../v3/opensearchapi/api_script-delete.go | 44 + .../v3/opensearchapi/api_script-get-params.go | 67 + .../v3/opensearchapi/api_script-get.go | 49 + .../api_script-language-params.go | 52 + .../v3/opensearchapi/api_script-language.go | 45 + .../api_script-painless_execute-params.go | 52 + .../api_script-painless_execute.go | 45 + .../v3/opensearchapi/api_script-put-params.go | 72 + .../v3/opensearchapi/api_script-put.go | 57 + .../v3/opensearchapi/api_script.go | 101 ++ .../opensearchapi/api_scroll-delete-params.go | 52 + .../v3/opensearchapi/api_scroll-delete.go | 56 + .../v3/opensearchapi/api_scroll-get-params.go | 73 + .../v3/opensearchapi/api_scroll-get.go | 57 + .../v3/opensearchapi/api_scroll.go | 41 + .../v3/opensearchapi/api_search-params.go | 284 ++++ .../api_search-template-params.go | 124 ++ .../v3/opensearchapi/api_search-template.go | 79 ++ .../v3/opensearchapi/api_search.go | 96 ++ .../opensearchapi/api_search_shards-params.go | 87 ++ .../v3/opensearchapi/api_search_shards.go | 99 ++ .../api_snapshot-clone-params.go | 66 + .../v3/opensearchapi/api_snapshot-clone.go | 49 + .../api_snapshot-create-params.go | 72 + .../v3/opensearchapi/api_snapshot-create.go | 72 + .../api_snapshot-delete-params.go | 67 + .../v3/opensearchapi/api_snapshot-delete.go | 46 + .../opensearchapi/api_snapshot-get-params.go | 87 ++ .../v3/opensearchapi/api_snapshot-get.go | 72 + .../api_snapshot-restore-params.go | 72 + .../v3/opensearchapi/api_snapshot-restore.go | 57 + .../api_snapshot-status-params.go | 72 + .../v3/opensearchapi/api_snapshot-status.go | 87 ++ .../v3/opensearchapi/api_snapshot.go | 92 ++ .../api_snapshot_repository-cleanup-params.go | 72 + .../api_snapshot_repository-cleanup.go | 47 + .../api_snapshot_repository-create-params.go | 77 ++ .../api_snapshot_repository-create.go | 47 + .../api_snapshot_repository-delete-params.go | 71 + .../api_snapshot_repository-delete.go | 54 + .../api_snapshot_repository-get-params.go | 73 + .../api_snapshot_repository-get.go | 57 + .../api_snapshot_repository-verify-params.go | 72 + .../api_snapshot_repository-verify.go | 46 + .../opensearchapi/api_snapshot_repository.go | 83 ++ .../opensearchapi/api_tasks-cancel-params.go | 78 ++ .../v3/opensearchapi/api_tasks-cancel.go | 78 ++ .../v3/opensearchapi/api_tasks-get-params.go | 68 + .../v3/opensearchapi/api_tasks-get.go | 89 ++ .../v3/opensearchapi/api_tasks-list-params.go | 94 ++ .../v3/opensearchapi/api_tasks-list.go | 94 ++ .../v3/opensearchapi/api_tasks.go | 58 + .../api_template-create-params.go | 78 ++ .../v3/opensearchapi/api_template-create.go | 47 + .../api_template-delete-params.go | 72 + .../v3/opensearchapi/api_template-delete.go | 44 + .../api_template-exists-params.go | 78 ++ .../v3/opensearchapi/api_template-exists.go | 33 + .../opensearchapi/api_template-get-params.go | 78 ++ .../v3/opensearchapi/api_template-get.go | 56 + .../v3/opensearchapi/api_template.go | 69 + .../opensearchapi/api_termvectors-params.go | 113 ++ .../v3/opensearchapi/api_termvectors.go | 80 ++ .../v3/opensearchapi/api_update-params.go | 123 ++ .../v3/opensearchapi/api_update.go | 73 + .../api_update_by_query-params.go | 239 ++++ .../v3/opensearchapi/api_update_by_query.go | 80 ++ .../api_update_by_query_rethrottle-params.go | 62 + .../api_update_by_query_rethrottle.go | 116 ++ .../opensearch-go/v3/opensearchapi/error.go | 88 ++ .../opensearch-go/v3/opensearchapi/inspect.go | 14 + .../v3/opensearchapi/opensearchapi.go | 183 +++ .../v3/opensearchtransport/connection.go | 346 +++++ .../v3/opensearchtransport/discovery.go | 220 +++ .../v3/opensearchtransport/doc.go | 59 + .../v3/opensearchtransport/logger.go | 449 ++++++ .../v3/opensearchtransport/metrics.go | 193 +++ .../opensearchtransport.go | 501 +++++++ .../opensearch-go/v3/request.go | 31 + .../opensearch-go/v3/request_builder.go | 66 + .../opensearch-go/v3/response.go | 63 + .../opensearch-go/v3/signer/signer.go | 17 + vendor/golang.org/x/time/rate/rate.go | 2 +- .../kafka/v1alpha1/connect_cluster_helpers.go | 7 +- .../kafka/v1alpha1/connect_cluster_types.go | 3 + .../apis/kafka/v1alpha1/connector_helpers.go | 2 + .../apis/kafka/v1alpha1/connector_types.go | 3 + .../apis/kafka/v1alpha1/helpers.go | 33 + .../apis/kafka/v1alpha1/openapi_generated.go | 14 +- .../kafka/v1alpha1/zz_generated.deepcopy.go | 10 + .../apimachinery/apis/kubedb/constants.go | 28 +- .../apis/kubedb/v1/elasticsearch_helpers.go | 7 +- .../apis/kubedb/v1/elasticsearch_types.go | 3 + .../apimachinery/apis/kubedb/v1/helpers.go | 10 + .../apis/kubedb/v1/kafka_helpers.go | 19 +- .../apis/kubedb/v1/kafka_types.go | 10 +- .../apis/kubedb/v1/mariadb_helpers.go | 14 +- .../apis/kubedb/v1/mariadb_types.go | 3 + .../apis/kubedb/v1/memcached_helpers.go | 14 +- .../apis/kubedb/v1/memcached_types.go | 4 + .../apis/kubedb/v1/mongodb_helpers.go | 25 +- .../apis/kubedb/v1/mongodb_types.go | 12 + .../apis/kubedb/v1/mysql_helpers.go | 14 +- .../apis/kubedb/v1/mysql_types.go | 3 + .../apis/kubedb/v1/openapi_generated.go | 385 ++++-- .../apis/kubedb/v1/perconaxtradb_helpers.go | 14 +- .../apis/kubedb/v1/perconaxtradb_types.go | 3 + .../apis/kubedb/v1/pgbouncer_helpers.go | 8 +- .../apis/kubedb/v1/pgbouncer_types.go | 3 + .../apis/kubedb/v1/postgres_helpers.go | 21 +- .../apis/kubedb/v1/postgres_types.go | 49 +- .../apis/kubedb/v1/proxysql_helpers.go | 64 +- .../apis/kubedb/v1/proxysql_types.go | 157 ++- .../apis/kubedb/v1/redis_helpers.go | 33 +- .../apis/kubedb/v1/redis_sentinel_helpers.go | 3 +- .../apis/kubedb/v1/redis_types.go | 19 +- .../apimachinery/apis/kubedb/v1/types.go | 14 + .../apis/kubedb/v1/zz_generated.deepcopy.go | 252 +++- .../apis/kubedb/v1alpha2/cassandra_helpers.go | 6 +- .../apis/kubedb/v1alpha2/cassandra_types.go | 5 +- .../kubedb/v1alpha2/clickhouse_helpers.go | 10 +- .../apis/kubedb/v1alpha2/clickhouse_types.go | 5 +- .../apis/kubedb/v1alpha2/conversion.go | 86 ++ .../apis/kubedb/v1alpha2/druid_helpers.go | 6 +- .../apis/kubedb/v1alpha2/druid_types.go | 5 +- .../kubedb/v1alpha2/elasticsearch_helpers.go | 3 +- .../apis/kubedb/v1alpha2/etcd_helpers.go | 3 +- .../apis/kubedb/v1alpha2/ferretdb_helpers.go | 7 +- .../apis/kubedb/v1alpha2/hanadb_helpers.go | 6 +- .../apis/kubedb/v1alpha2/hanadb_types.go | 5 +- .../apis/kubedb/v1alpha2/hazelcast_helpers.go | 8 +- .../apis/kubedb/v1alpha2/hazelcast_types.go | 2 +- .../apis/kubedb/v1alpha2/helpers.go | 10 + .../apis/kubedb/v1alpha2/ignite_helpers.go | 6 +- .../apis/kubedb/v1alpha2/ignite_types.go | 4 +- .../apis/kubedb/v1alpha2/kafka_helpers.go | 3 +- .../apis/kubedb/v1alpha2/kafka_types.go | 2 +- .../apis/kubedb/v1alpha2/mariadb_helpers.go | 3 +- .../apis/kubedb/v1alpha2/memcached_helpers.go | 8 +- .../apis/kubedb/v1alpha2/milvus_helpers.go | 3 +- .../apis/kubedb/v1alpha2/milvus_types.go | 4 +- .../apis/kubedb/v1alpha2/mongodb_helpers.go | 3 +- .../kubedb/v1alpha2/mssqlserver_helpers.go | 12 +- .../apis/kubedb/v1alpha2/mssqlserver_types.go | 3 + .../apis/kubedb/v1alpha2/mysql_helpers.go | 3 +- .../apis/kubedb/v1alpha2/neo4j_helpers.go | 3 +- .../apis/kubedb/v1alpha2/neo4j_types.go | 4 +- .../apis/kubedb/v1alpha2/openapi_generated.go | 236 +++- .../apis/kubedb/v1alpha2/oracle_helpers.go | 3 +- .../apis/kubedb/v1alpha2/oracle_types.go | 5 +- .../kubedb/v1alpha2/perconaxtradb_helpers.go | 3 +- .../apis/kubedb/v1alpha2/pgbouncer_helpers.go | 3 +- .../apis/kubedb/v1alpha2/pgpool_helpers.go | 9 +- .../apis/kubedb/v1alpha2/pgpool_types.go | 8 +- .../apis/kubedb/v1alpha2/postgres_helpers.go | 3 +- .../apis/kubedb/v1alpha2/postgres_types.go | 4 +- .../apis/kubedb/v1alpha2/proxysql_helpers.go | 3 +- .../apis/kubedb/v1alpha2/qdrant_helpers.go | 18 +- .../apis/kubedb/v1alpha2/qdrant_types.go | 23 +- .../apis/kubedb/v1alpha2/rabbitmq_helpers.go | 8 +- .../apis/kubedb/v1alpha2/rabbitmq_types.go | 3 + .../apis/kubedb/v1alpha2/redis_helpers.go | 3 +- .../kubedb/v1alpha2/redis_sentinel_helpers.go | 3 +- .../kubedb/v1alpha2/singlestore_helpers.go | 19 +- .../apis/kubedb/v1alpha2/singlestore_types.go | 9 +- .../apis/kubedb/v1alpha2/solr_helpers.go | 12 +- .../apis/kubedb/v1alpha2/solr_types.go | 2 +- .../apis/kubedb/v1alpha2/types.go | 14 + .../apis/kubedb/v1alpha2/weaviate_helpers.go | 3 +- .../apis/kubedb/v1alpha2/weaviate_types.go | 5 +- .../apis/kubedb/v1alpha2/zookeeper_helpers.go | 10 +- .../apis/kubedb/v1alpha2/zookeeper_types.go | 5 +- .../v1alpha2/zz_generated.conversion.go | 127 +- .../kubedb/v1alpha2/zz_generated.deepcopy.go | 206 ++- .../apis/ops/v1alpha1/cassandra_ops-types.go | 2 +- .../ops/v1alpha1/cassandra_ops_helpers.go | 4 +- .../apis/ops/v1alpha1/clickhouse_ops-types.go | 23 +- .../ops/v1alpha1/clickhouse_ops_helpers.go | 4 +- .../apis/ops/v1alpha1/constant.go | 5 + .../apis/ops/v1alpha1/druid_ops_helpers.go | 4 +- .../apis/ops/v1alpha1/druid_ops_types.go | 25 +- .../ops/v1alpha1/elasticsearch_ops_helpers.go | 4 +- .../ops/v1alpha1/elasticsearch_ops_types.go | 14 +- .../apis/ops/v1alpha1/etcd_ops_helpers.go | 4 +- .../apis/ops/v1alpha1/ferretdb_ops_helpers.go | 4 +- .../ops/v1alpha1/hazelcast_ops_helpers.go | 4 +- .../apis/ops/v1alpha1/hazelcast_ops_types.go | 23 +- .../apis/ops/v1alpha1/ignite_ops_helpers.go | 4 +- .../apis/ops/v1alpha1/ignite_ops_types.go | 23 +- .../apis/ops/v1alpha1/kafka_ops_helpers.go | 4 +- .../apis/ops/v1alpha1/kafka_ops_types.go | 25 +- .../apis/ops/v1alpha1/mariadb_ops_helpers.go | 4 +- .../apis/ops/v1alpha1/mariadb_ops_types.go | 25 +- .../ops/v1alpha1/memcached_ops_helpers.go | 4 +- .../apis/ops/v1alpha1/memcached_ops_types.go | 2 +- .../apis/ops/v1alpha1/mongodb_ops_helpers.go | 4 +- .../apis/ops/v1alpha1/mongodb_ops_types.go | 24 +- .../ops/v1alpha1/mssqlserver_ops_helpers.go | 4 +- .../ops/v1alpha1/mssqlserver_ops_types.go | 9 +- .../apis/ops/v1alpha1/mysql_ops_helpers.go | 4 +- .../apis/ops/v1alpha1/mysql_ops_types.go | 8 +- .../apis/ops/v1alpha1/openapi_generated.go | 1216 ++++++----------- .../ops/v1alpha1/perconaxtradb_ops_helpers.go | 4 +- .../ops/v1alpha1/perconaxtradb_ops_types.go | 2 +- .../ops/v1alpha1/pgbouncer_ops_helpers.go | 4 +- .../apis/ops/v1alpha1/pgbouncer_ops_types.go | 12 +- .../apis/ops/v1alpha1/pgpool_ops_helpers.go | 4 +- .../apis/ops/v1alpha1/pgpool_ops_types.go | 23 +- .../apis/ops/v1alpha1/postgres_ops_helpers.go | 4 +- .../apis/ops/v1alpha1/postgres_ops_types.go | 59 +- .../apis/ops/v1alpha1/proxysql_ops_helpers.go | 4 +- .../apis/ops/v1alpha1/proxysql_ops_types.go | 4 +- .../apis/ops/v1alpha1/qdrant_ops_types.go | 64 + .../apis/ops/v1alpha1/rabbitmq_ops_helpers.go | 4 +- .../apis/ops/v1alpha1/rabbitmq_ops_types.go | 23 +- .../apis/ops/v1alpha1/redis_ops_helpers.go | 4 +- .../apis/ops/v1alpha1/redis_ops_types.go | 6 +- .../v1alpha1/redis_sentinel_ops_helpers.go | 4 +- .../apis/ops/v1alpha1/register.go | 2 + .../ops/v1alpha1/singlestore_ops_helpers.go | 4 +- .../ops/v1alpha1/singlestore_ops_types.go | 6 +- .../apis/ops/v1alpha1/solr_ops_helpers.go | 4 +- .../apis/ops/v1alpha1/solr_ops_types.go | 23 +- .../apimachinery/apis/ops/v1alpha1/type.go | 42 +- .../ops/v1alpha1/zookeeper_ops_helpers.go | 4 +- .../apis/ops/v1alpha1/zookeeper_ops_types.go | 23 +- .../ops/v1alpha1/zz_generated.deepcopy.go | 861 ++++-------- .../typed/ops/v1alpha1/generated_expansion.go | 2 + .../typed/ops/v1alpha1/ops_client.go | 5 + .../typed/ops/v1alpha1/qdrantopsrequest.go | 196 +++ .../crds/gitops.kubedb.com_druids.yaml | 10 +- .../gitops.kubedb.com_elasticsearches.yaml | 9 + .../crds/gitops.kubedb.com_kafkas.yaml | 69 +- .../crds/gitops.kubedb.com_mariadbs.yaml | 9 + .../crds/gitops.kubedb.com_memcacheds.yaml | 9 + .../crds/gitops.kubedb.com_mongodbs.yaml | 54 + .../crds/gitops.kubedb.com_mssqlservers.yaml | 9 + .../crds/gitops.kubedb.com_mysqls.yaml | 9 + .../gitops.kubedb.com_perconaxtradbs.yaml | 9 + .../crds/gitops.kubedb.com_pgbouncers.yaml | 9 + .../crds/gitops.kubedb.com_pgpools.yaml | 16 +- .../crds/gitops.kubedb.com_postgreses.yaml | 67 +- .../crds/gitops.kubedb.com_proxysqls.yaml | 57 + .../crds/gitops.kubedb.com_rabbitmqs.yaml | 9 + .../crds/gitops.kubedb.com_redises.yaml | 23 + .../crds/gitops.kubedb.com_singlestores.yaml | 30 +- .../crds/gitops.kubedb.com_solrs.yaml | 10 +- .../crds/gitops.kubedb.com_zookeepers.yaml | 10 +- .../kafka.kubedb.com_connectclusters.yaml | 9 + .../crds/kafka.kubedb.com_connectors.yaml | 9 + .../crds/kubedb.com_cassandras.yaml | 10 +- .../crds/kubedb.com_clickhouses.yaml | 10 +- .../apimachinery/crds/kubedb.com_druids.yaml | 10 +- .../crds/kubedb.com_elasticsearches.yaml | 9 + .../apimachinery/crds/kubedb.com_hanadbs.yaml | 10 +- .../crds/kubedb.com_hazelcasts.yaml | 10 +- .../apimachinery/crds/kubedb.com_ignites.yaml | 10 +- .../apimachinery/crds/kubedb.com_kafkas.yaml | 88 +- .../crds/kubedb.com_mariadbs.yaml | 9 + .../crds/kubedb.com_memcacheds.yaml | 9 + .../crds/kubedb.com_milvuses.yaml | 10 +- .../crds/kubedb.com_mongodbs.yaml | 54 + .../crds/kubedb.com_mssqlservers.yaml | 9 + .../apimachinery/crds/kubedb.com_mysqls.yaml | 9 + .../apimachinery/crds/kubedb.com_neo4js.yaml | 10 +- .../apimachinery/crds/kubedb.com_oracles.yaml | 10 +- .../crds/kubedb.com_perconaxtradbs.yaml | 9 + .../crds/kubedb.com_pgbouncers.yaml | 9 + .../apimachinery/crds/kubedb.com_pgpools.yaml | 16 +- .../crds/kubedb.com_postgreses.yaml | 69 +- .../crds/kubedb.com_proxysqls.yaml | 57 + .../apimachinery/crds/kubedb.com_qdrants.yaml | 115 +- .../crds/kubedb.com_rabbitmqs.yaml | 9 + .../apimachinery/crds/kubedb.com_redises.yaml | 23 + .../crds/kubedb.com_singlestores.yaml | 30 +- .../apimachinery/crds/kubedb.com_solrs.yaml | 10 +- .../crds/kubedb.com_weaviates.yaml | 10 +- .../crds/kubedb.com_zookeepers.yaml | 10 +- .../ops.kubedb.com_cassandraopsrequests.yaml | 7 + .../ops.kubedb.com_clickhouseopsrequests.yaml | 7 + .../crds/ops.kubedb.com_druidopsrequests.yaml | 7 + ...s.kubedb.com_elasticsearchopsrequests.yaml | 7 + .../ops.kubedb.com_hazelcastopsrequests.yaml | 7 + .../ops.kubedb.com_igniteopsrequests.yaml | 7 + .../crds/ops.kubedb.com_kafkaopsrequests.yaml | 7 + .../ops.kubedb.com_mariadbopsrequests.yaml | 7 + .../ops.kubedb.com_memcachedopsrequests.yaml | 7 + .../ops.kubedb.com_mongodbopsrequests.yaml | 49 + ...ops.kubedb.com_mssqlserveropsrequests.yaml | 7 + .../crds/ops.kubedb.com_mysqlopsrequests.yaml | 7 + ...s.kubedb.com_perconaxtradbopsrequests.yaml | 7 + .../ops.kubedb.com_pgbounceropsrequests.yaml | 34 +- .../ops.kubedb.com_pgpoolopsrequests.yaml | 7 + .../ops.kubedb.com_postgresopsrequests.yaml | 29 + .../ops.kubedb.com_qdrantopsrequests.yaml | 212 +++ .../ops.kubedb.com_rabbitmqopsrequests.yaml | 7 + .../crds/ops.kubedb.com_redisopsrequests.yaml | 7 + ...ops.kubedb.com_singlestoreopsrequests.yaml | 21 + .../crds/ops.kubedb.com_solropsrequests.yaml | 7 + .../ops.kubedb.com_zookeeperopsrequests.yaml | 7 + .../apimachinery/pkg/factory/client.go | 6 +- vendor/kubedb.dev/apimachinery/pkg/lib/lib.go | 2 +- .../pkg/lib/reconfigure_merger.go | 428 ++++++ .../db-client-go/elasticsearch/api.go | 282 ---- .../elasticsearch/kubedb_client_builder.go | 48 + .../elasticsearch/os_client_v3.go | 965 +++++++++++++ .../cacerts/v1alpha1/openapi_generated.go | 582 +++++++- .../operator-shard-manager/LICENSE | 202 +++ .../api/v1alpha1/crds.go | 27 + .../api/v1alpha1/doc.go | 23 + .../api/v1alpha1/groupversion_info.go | 46 + .../api/v1alpha1/shardconfiguration_types.go | 99 ++ .../api/v1alpha1/shardconfiguration_util.go | 162 +++ .../api/v1alpha1/zz_generated.deepcopy.go | 190 +++ .../operator-shard-manager/crds/lib.go | 60 + ....k8s.appscode.com_shardconfigurations.yaml | 177 +++ .../crds/addons.kubestash.com_addons.yaml | 38 + .../crds/addons.kubestash.com_functions.yaml | 19 + .../core.kubestash.com_backupbatches.yaml | 344 +++++ .../core.kubestash.com_backupblueprints.yaml | 344 +++++ ...re.kubestash.com_backupconfigurations.yaml | 344 +++++ .../core.kubestash.com_backupverifier.yaml | 272 ++++ .../core.kubestash.com_hooktemplates.yaml | 36 + .../core.kubestash.com_restoresessions.yaml | 264 ++++ .../storage.kubestash.com_backupstorages.yaml | 38 + vendor/modules.txt | 41 +- ...uster-management.io_manifestworks.crd.yaml | 8 +- .../api/work/v1/doc.go | 4 +- .../api/work/v1/register.go | 40 - .../api/work/v1/types.go | 33 +- .../api/work/v1/zz_generated.deepcopy.go | 1 + .../api/work/v1/zz_generated.register.go | 57 + .../v1/zz_generated.swagger_doc_generated.go | 322 ----- 597 files changed, 39040 insertions(+), 3479 deletions(-) create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/.codecov.yml create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/.dockerignore create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/.gitignore create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/.golangci.yml create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/.whitesource create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/ADMINS.md create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/CHANGELOG.md create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/CODE_OF_CONDUCT.md create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/COMPATIBILITY.md create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/CONTRIBUTING.md create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/DEVELOPER_GUIDE.md create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/LICENSE.txt create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/MAINTAINERS.md create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/Makefile create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/NOTICE.txt create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/OpenSearch.svg create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/README.md create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/RELEASING.md create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/SECURITY.md create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/UPGRADING.md create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/USER_GUIDE.md create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/doc.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/internal/version/version.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearch.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_aliases-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_aliases.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_bulk-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_bulk.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-aliases-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-aliases.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-allocation-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-allocation.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-cluster_manager-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-cluster_manager.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-count-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-count.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-fielddata-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-fielddata.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-health-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-health.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-indices-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-indices.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-master-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-master.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-nodeattrs-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-nodeattrs.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-nodes-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-nodes.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-pending_tasks-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-pending_tasks.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-plugins-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-plugins.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-recovery-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-recovery.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-repositories-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-repositories.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-segments-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-segments.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-shards-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-shards.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-snapshots-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-snapshots.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-tasks-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-tasks.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-templates-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-templates.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-thread_pool-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-thread_pool.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-allocation_explain-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-allocation_explain.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-decommission-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-decommission.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-health-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-health.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-pending_tasks-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-pending_tasks.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-remote_info-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-remote_info.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-reroute-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-reroute.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-settings-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-settings.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-state-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-state.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-stats-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-stats.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-voting_config_exclusions-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-voting_config_exclusions.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template-create-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template-create.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template-delete-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template-delete.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template-exists-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template-exists.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template-get-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template-get.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_dangling-delete-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_dangling-delete.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_dangling-get-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_dangling-get.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_dangling-import-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_dangling-import.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_dangling.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream-create-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream-create.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream-delete-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream-delete.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream-get-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream-get.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream-stats-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream-stats.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-create-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-create.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-delete-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-delete.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-delete_by_query-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-delete_by_query.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-delete_by_query_rethrottle-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-delete_by_query_rethrottle.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-exists-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-exists.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-exists_source-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-exists_source.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-explain-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-explain.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-get-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-get.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-source-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-source.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-create-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-create.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-delete-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-delete.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-exists-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-exists.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-get-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-get.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-simulate-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-simulate.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-simulate_index-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-simulate_index.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-alias-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-alias.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-analyze-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-analyze.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-block-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-block.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-cache-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-cache.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-clone-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-clone.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-close-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-close.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-count-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-count.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-create-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-create.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-delete-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-delete.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-exists-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-exists.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-field_caps-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-field_caps.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-flush-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-flush.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-forcemerge-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-forcemerge.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-get-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-get.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-mapping-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-mapping.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-open-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-open.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-recovery-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-recovery.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-refresh-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-refresh.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-resolve-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-resolve.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-rollover-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-rollover.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-segments-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-segments.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-settings-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-settings.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-shardstores-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-shardstores.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-shrink-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-shrink.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-split-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-split.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-stats-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-stats.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-validate-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-validate.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_info-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_info.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-create-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-create.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-delete-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-delete.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-get-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-get.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-grok-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-grok.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-simulate-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-simulate.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_mget-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_mget.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_msearch-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_msearch-template-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_msearch-template.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_msearch.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_mtermvectors-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_mtermvectors.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-hot_threads-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-hot_threads.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-info-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-info.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-reload_security-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-reload_security.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-stats-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-stats.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-usage-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-usage.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ping-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ping.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_point_in_time-create-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_point_in_time-create.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_point_in_time-delete-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_point_in_time-delete.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_point_in_time-get-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_point_in_time-get.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_point_in_time.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_rank_eval-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_rank_eval.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_reindex-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_reindex.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_reindex_rethrottle-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_reindex_rethrottle.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_render_search_template-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_render_search_template.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-context-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-context.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-delete-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-delete.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-get-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-get.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-language-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-language.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-painless_execute-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-painless_execute.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-put-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-put.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_scroll-delete-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_scroll-delete.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_scroll-get-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_scroll-get.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_scroll.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_search-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_search-template-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_search-template.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_search.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_search_shards-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_search_shards.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-clone-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-clone.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-create-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-create.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-delete-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-delete.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-get-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-get.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-restore-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-restore.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-status-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-status.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-cleanup-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-cleanup.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-create-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-create.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-delete-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-delete.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-get-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-get.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-verify-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-verify.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_tasks-cancel-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_tasks-cancel.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_tasks-get-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_tasks-get.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_tasks-list-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_tasks-list.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_tasks.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template-create-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template-create.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template-delete-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template-delete.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template-exists-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template-exists.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template-get-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template-get.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_termvectors-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_termvectors.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_update-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_update.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_update_by_query-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_update_by_query.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_update_by_query_rethrottle-params.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_update_by_query_rethrottle.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/error.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/inspect.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/opensearchapi.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchtransport/connection.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchtransport/discovery.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchtransport/doc.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchtransport/logger.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchtransport/metrics.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/opensearchtransport/opensearchtransport.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/request.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/request_builder.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/response.go create mode 100644 vendor/github.com/opensearch-project/opensearch-go/v3/signer/signer.go create mode 100644 vendor/kubedb.dev/apimachinery/apis/kafka/v1alpha1/helpers.go create mode 100644 vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/qdrant_ops_types.go create mode 100644 vendor/kubedb.dev/apimachinery/client/clientset/versioned/typed/ops/v1alpha1/qdrantopsrequest.go create mode 100644 vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_qdrantopsrequests.yaml create mode 100644 vendor/kubedb.dev/apimachinery/pkg/lib/reconfigure_merger.go create mode 100644 vendor/kubedb.dev/db-client-go/elasticsearch/os_client_v3.go create mode 100644 vendor/kubeops.dev/operator-shard-manager/LICENSE create mode 100644 vendor/kubeops.dev/operator-shard-manager/api/v1alpha1/crds.go create mode 100644 vendor/kubeops.dev/operator-shard-manager/api/v1alpha1/doc.go create mode 100644 vendor/kubeops.dev/operator-shard-manager/api/v1alpha1/groupversion_info.go create mode 100644 vendor/kubeops.dev/operator-shard-manager/api/v1alpha1/shardconfiguration_types.go create mode 100644 vendor/kubeops.dev/operator-shard-manager/api/v1alpha1/shardconfiguration_util.go create mode 100644 vendor/kubeops.dev/operator-shard-manager/api/v1alpha1/zz_generated.deepcopy.go create mode 100644 vendor/kubeops.dev/operator-shard-manager/crds/lib.go create mode 100644 vendor/kubeops.dev/operator-shard-manager/crds/operator.k8s.appscode.com_shardconfigurations.yaml delete mode 100644 vendor/open-cluster-management.io/api/work/v1/register.go create mode 100644 vendor/open-cluster-management.io/api/work/v1/zz_generated.register.go delete mode 100644 vendor/open-cluster-management.io/api/work/v1/zz_generated.swagger_doc_generated.go diff --git a/go.mod b/go.mod index ebe6f7f07..6ee1b8720 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module kubedb.dev/cli go 1.25.5 require ( - github.com/Masterminds/semver/v3 v3.3.1 + github.com/Masterminds/semver/v3 v3.4.0 github.com/cert-manager/cert-manager v1.19.2 github.com/fatih/camelcase v1.0.0 github.com/go-sql-driver/mysql v1.9.3 @@ -27,8 +27,8 @@ require ( kmodules.xyz/client-go v0.34.2 kmodules.xyz/custom-resources v0.34.0 kmodules.xyz/monitoring-agent-api v0.34.0 - kubedb.dev/apimachinery v0.60.0-rc.1 - kubedb.dev/db-client-go v0.15.0-rc.1 + kubedb.dev/apimachinery v0.60.0 + kubedb.dev/db-client-go v0.15.0 kubeops.dev/petset v0.0.15 sigs.k8s.io/controller-runtime v0.22.4 sigs.k8s.io/yaml v1.6.0 @@ -55,7 +55,7 @@ require ( require ( filippo.io/edwards25519 v1.1.0 // indirect - github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect + github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect github.com/MakeNowJust/heredoc v1.0.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/blang/semver/v4 v4.0.0 // indirect @@ -100,12 +100,12 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/cpuid/v2 v2.2.10 // indirect - github.com/kubernetes-csi/external-snapshotter/client/v8 v8.2.0 // indirect + github.com/kubernetes-csi/external-snapshotter/client/v8 v8.4.0 // indirect github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/moby/spdystream v0.5.0 // indirect - github.com/moby/term v0.5.0 // indirect + github.com/moby/term v0.5.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect @@ -115,6 +115,7 @@ require ( github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opensearch-project/opensearch-go v1.1.0 // indirect github.com/opensearch-project/opensearch-go/v2 v2.3.0 // indirect + github.com/opensearch-project/opensearch-go/v3 v3.1.0 // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect github.com/pkg/errors v0.9.1 // indirect github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.87.1 // indirect @@ -142,7 +143,7 @@ require ( golang.org/x/sync v0.19.0 // indirect golang.org/x/sys v0.39.0 // indirect golang.org/x/term v0.38.0 // indirect - golang.org/x/time v0.13.0 // indirect + golang.org/x/time v0.14.0 // indirect gomodules.xyz/clock v0.0.0-20200817085942-06523dba733f // indirect gomodules.xyz/encoding v0.0.8 // indirect gomodules.xyz/flags v0.1.3 // indirect @@ -166,11 +167,12 @@ require ( kmodules.xyz/objectstore-api v0.34.0 // indirect kmodules.xyz/offshoot-api v0.34.0 // indirect kmodules.xyz/prober v0.34.0 // indirect - kmodules.xyz/resource-metadata v0.40.2 // indirect - kubeops.dev/csi-driver-cacerts v0.4.0 // indirect + kmodules.xyz/resource-metadata v0.41.0 // indirect + kubeops.dev/csi-driver-cacerts v0.5.0 // indirect + kubeops.dev/operator-shard-manager v0.0.5 // indirect kubeops.dev/sidekick v0.0.12 // indirect - kubestash.dev/apimachinery v0.22.0 // indirect - open-cluster-management.io/api v1.0.0 // indirect + kubestash.dev/apimachinery v0.23.0 // indirect + open-cluster-management.io/api v1.1.1-0.20251222023835-510285203ee6 // indirect sigs.k8s.io/gateway-api v1.4.0 // indirect sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect sigs.k8s.io/kustomize/api v0.20.1 // indirect diff --git a/go.sum b/go.sum index 75c33b907..d780e02b3 100644 --- a/go.sum +++ b/go.sum @@ -13,14 +13,14 @@ cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiy dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= -github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= -github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= +github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg= +github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ= github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE= -github.com/Masterminds/semver/v3 v3.3.1 h1:QtNSWtVZ3nBfk8mAOu/B6v7FMJ+NHTIgUPi7rj+4nv4= -github.com/Masterminds/semver/v3 v3.3.1/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= +github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0= +github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -274,8 +274,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kubernetes-csi/external-snapshotter/client/v8 v8.2.0 h1:Q3jQ1NkFqv5o+F8dMmHd8SfEmlcwNeo1immFApntEwE= -github.com/kubernetes-csi/external-snapshotter/client/v8 v8.2.0/go.mod h1:E3vdYxHj2C2q6qo8/Da4g7P+IcwqRZyy3gJBzYybV9Y= +github.com/kubernetes-csi/external-snapshotter/client/v8 v8.4.0 h1:bMqrb3UHgHbP+PW9VwiejfDJU1R0PpXVZNMdeH8WYKI= +github.com/kubernetes-csi/external-snapshotter/client/v8 v8.4.0/go.mod h1:E3vdYxHj2C2q6qo8/Da4g7P+IcwqRZyy3gJBzYybV9Y= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0= @@ -305,8 +305,8 @@ github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyua github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/moby/spdystream v0.5.0 h1:7r0J1Si3QO/kjRitvSLVVFUjxMEb/YLj6S9FF62JBCU= github.com/moby/spdystream v0.5.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI= -github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= -github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= +github.com/moby/term v0.5.2 h1:6qk3FJAFDs6i/q3W/pQ97SX192qKfZgGjCQqfCJkgzQ= +github.com/moby/term v0.5.2/go.mod h1:d3djjFCrjnB+fl8NJux+EJzu0msscUP+f8it8hPkFLc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -338,6 +338,8 @@ github.com/opensearch-project/opensearch-go v1.1.0 h1:eG5sh3843bbU1itPRjA9QXbxcg github.com/opensearch-project/opensearch-go v1.1.0/go.mod h1:+6/XHCuTH+fwsMJikZEWsucZ4eZMma3zNSeLrTtVGbo= github.com/opensearch-project/opensearch-go/v2 v2.3.0 h1:nQIEMr+A92CkhHrZgUhcfsrZjibvB3APXf2a1VwCmMQ= github.com/opensearch-project/opensearch-go/v2 v2.3.0/go.mod h1:8LDr9FCgUTVoT+5ESjc2+iaZuldqE+23Iq0r1XeNue8= +github.com/opensearch-project/opensearch-go/v3 v3.1.0 h1:7EghS/+dCYD6PrsXjfIf3fvMOObkPtrDJVbovlNl3sY= +github.com/opensearch-project/opensearch-go/v3 v3.1.0/go.mod h1:9UWs3sbIESBpsGlfhTmj5PXm3tXvgxRan4D+W9d700Q= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= @@ -421,6 +423,8 @@ github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/wI2L/jsondiff v0.4.0 h1:iP56F9tK83eiLttg3YdmEENtZnwlYd3ezEpNNnfZVyM= +github.com/wI2L/jsondiff v0.4.0/go.mod h1:nR/vyy1efuDeAtMwc3AF6nZf/2LD1ID8GTyyJ+K8YB0= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= @@ -589,8 +593,8 @@ golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.13.0 h1:eUlYslOIt32DgYD6utsuUeHs4d7AsEYLuIAdg7FlYgI= -golang.org/x/time v0.13.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= +golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI= +golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -742,22 +746,24 @@ kmodules.xyz/offshoot-api v0.34.0 h1:HnOOp8FrCjTWjtNApRDo6Ahe79tOlLrJmyye4xxO4Kk kmodules.xyz/offshoot-api v0.34.0/go.mod h1:F+B59yYw4CZJ4uD4xu6C+mMLzIXUtuH7E+SbDICl9jE= kmodules.xyz/prober v0.34.0 h1:ElZkZYCjLaytAA0M8EH42To7i9gh1IIX+d0qfaIohys= kmodules.xyz/prober v0.34.0/go.mod h1:rsu/fxxfNxY70GDbH6Ju8G66459hi7AhWSSBoiIp8ic= -kmodules.xyz/resource-metadata v0.40.2 h1:2J+UvAaHXfqDStO2SKqeVkER4z/kSOqpj8Iyrc9+V4Y= -kmodules.xyz/resource-metadata v0.40.2/go.mod h1:38+41aUSrWqrQDeaSITKoxAiGT0ysQk5yjRODqBadpw= -kubedb.dev/apimachinery v0.60.0-rc.1 h1:4e5bDwLjf4VravncyleYrmamtHP0+7EihXW/Z9tYzv4= -kubedb.dev/apimachinery v0.60.0-rc.1/go.mod h1:C//93Ze70E3a56BAPTjDSXqTYK1LbTw6GXC0JngWTjI= -kubedb.dev/db-client-go v0.15.0-rc.1 h1:0UG62PF9yHpjuL2i/v4Wc1+SaR8Ptk0OBMtoj26fEJU= -kubedb.dev/db-client-go v0.15.0-rc.1/go.mod h1:XN/kbqduVcvWIyHvvhk64doVGHB/tQ/ipEiB7SSS4G8= -kubeops.dev/csi-driver-cacerts v0.4.0 h1:aGZjDVk9Rv5a0EqDQ/atvg9yVhN7xEU5VKaNI2m1g74= -kubeops.dev/csi-driver-cacerts v0.4.0/go.mod h1:v1595ZuAd8PGs6egLt7dj6EVWTifdLqRKzUGEqp6eI0= +kmodules.xyz/resource-metadata v0.41.0 h1:9wUOg2EvAOW3n8I+tbZnE1PJDdolX+94/Mn7FBZZy9w= +kmodules.xyz/resource-metadata v0.41.0/go.mod h1:xntcQko2QLbLEHwGE4TQ7I/80fcBQzcexbep97Akstk= +kubedb.dev/apimachinery v0.60.0 h1:D2tSwXPs0qLAP3Ac6Xy+sOVIl3/oc7ZmYUwEGUfqWdw= +kubedb.dev/apimachinery v0.60.0/go.mod h1:tmfp77k7j2d5Bll3lPL9Ul5wEYSRLpekjOEnro2/rFA= +kubedb.dev/db-client-go v0.15.0 h1:SMB6yv8uXPIKFmql32qNU3pRsv6UFPOPUPEPjuX/rHI= +kubedb.dev/db-client-go v0.15.0/go.mod h1:XEs0vDMReILhlUbcvrJz7RwS2E8PvEFu60SjnxJPOqk= +kubeops.dev/csi-driver-cacerts v0.5.0 h1:WaKfoIyh7rx9rNZ65wJ3GkzhECkOjxd9dcO0iEx3xKU= +kubeops.dev/csi-driver-cacerts v0.5.0/go.mod h1:VNbwC3gTWfmdQCVxd8mkVx+n1+0F1lOA5X3usyZN1rk= +kubeops.dev/operator-shard-manager v0.0.5 h1:i7VnyUfIa9u3RQhSTVWNsooXcgmrWWxJyI9gJ10onE8= +kubeops.dev/operator-shard-manager v0.0.5/go.mod h1:NE6GzlhwLRiwiUUpqi4Uf+J7e/gniITM0uJnE5r1mzY= kubeops.dev/petset v0.0.15 h1:iwTRFAp0RNw0A87sw2c97UZ6WIA9H/nhJBpDhXLa7fk= kubeops.dev/petset v0.0.15/go.mod h1:sw96WiXfzhpmKpXj4a5AdmEHs0Bx4QMhf+iW15zY4Gg= kubeops.dev/sidekick v0.0.12 h1:pmUjQLZDKxgREiM6z0PogLR1aDbgvkE9jRjbxG6dEt0= kubeops.dev/sidekick v0.0.12/go.mod h1:RU7QH3E8DOLw15rBYlOOJSyczuwAnVVtYyZjJb00UB8= -kubestash.dev/apimachinery v0.22.0 h1:vp3Z7ISU2WYR6LkU7WLjbiCMSZQEjfzANN/C1cZ7L+s= -kubestash.dev/apimachinery v0.22.0/go.mod h1:c6d5CNgG3ScLB/EdCZcFx8gAY/aY8KkLTfMFy0cobQM= -open-cluster-management.io/api v1.0.0 h1:54QllH9DTudCk6VrGt0q8CDsE3MghqJeTaTN4RHZpE0= -open-cluster-management.io/api v1.0.0/go.mod h1:/OeqXycNBZQoe3WG6ghuWsMgsKGuMZrK8ZpsU6gWL0Y= +kubestash.dev/apimachinery v0.23.0 h1:EB6w+lB0ACgnqIjtbyvRN5hVEmB8dVHSaN7SJCACHCY= +kubestash.dev/apimachinery v0.23.0/go.mod h1:zJEjHjd/nYcXFSW+RfGbLxZMJK41IOWjQGosoAWZDRg= +open-cluster-management.io/api v1.1.1-0.20251222023835-510285203ee6 h1:mfcUKaSOYVDLzuontUOcasesbU9whNnvgrA0qf9trKs= +open-cluster-management.io/api v1.1.1-0.20251222023835-510285203ee6/go.mod h1:YcmA6SpGEekIMxdoeVIIyOaBhMA6ImWRLXP4g8n8T+4= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= sigs.k8s.io/gateway-api v1.4.0 h1:ZwlNM6zOHq0h3WUX2gfByPs2yAEsy/EenYJB78jpQfQ= sigs.k8s.io/gateway-api v1.4.0/go.mod h1:AR5RSqciWP98OPckEjOjh2XJhAe2Na4LHyXD2FUY7Qk= diff --git a/vendor/github.com/Azure/go-ansiterm/osc_string_state.go b/vendor/github.com/Azure/go-ansiterm/osc_string_state.go index 593b10ab6..194d5e9c9 100644 --- a/vendor/github.com/Azure/go-ansiterm/osc_string_state.go +++ b/vendor/github.com/Azure/go-ansiterm/osc_string_state.go @@ -11,21 +11,13 @@ func (oscState oscStringState) Handle(b byte) (s state, e error) { return nextState, err } - switch { - case isOscStringTerminator(b): + // There are several control characters and sequences which can + // terminate an OSC string. Most of them are handled by the baseState + // handler. The ANSI_BEL character is a special case which behaves as a + // terminator only for an OSC string. + if b == ANSI_BEL { return oscState.parser.ground, nil } return oscState, nil } - -// See below for OSC string terminators for linux -// http://man7.org/linux/man-pages/man4/console_codes.4.html -func isOscStringTerminator(b byte) bool { - - if b == ANSI_BEL || b == 0x5C { - return true - } - - return false -} diff --git a/vendor/github.com/Masterminds/semver/v3/CHANGELOG.md b/vendor/github.com/Masterminds/semver/v3/CHANGELOG.md index f95a504fe..fabe5e43d 100644 --- a/vendor/github.com/Masterminds/semver/v3/CHANGELOG.md +++ b/vendor/github.com/Masterminds/semver/v3/CHANGELOG.md @@ -1,5 +1,31 @@ # Changelog +## 3.4.0 (2025-06-27) + +### Added + +- #268: Added property to Constraints to include prereleases for Check and Validate + +### Changed + +- #263: Updated Go testing for 1.24, 1.23, and 1.22 +- #269: Updated the error message handling for message case and wrapping errors +- #266: Restore the ability to have leading 0's when parsing with NewVersion. + Opt-out of this by setting CoerceNewVersion to false. + +### Fixed + +- #257: Fixed the CodeQL link (thanks @dmitris) +- #262: Restored detailed errors when failed to parse with NewVersion. Opt-out + of this by setting DetailedNewVersionErrors to false for faster performance. +- #267: Handle pre-releases for an "and" group if one constraint includes them + +## 3.3.1 (2024-11-19) + +### Fixed + +- #253: Fix for allowing some version that were invalid + ## 3.3.0 (2024-08-27) ### Added @@ -137,7 +163,7 @@ functions. These are described in the added and changed sections below. - #78: Fix unchecked error in example code (thanks @ravron) - #70: Fix the handling of pre-releases and the 0.0.0 release edge case - #97: Fixed copyright file for proper display on GitHub -- #107: Fix handling prerelease when sorting alphanum and num +- #107: Fix handling prerelease when sorting alphanum and num - #109: Fixed where Validate sometimes returns wrong message on error ## 1.4.2 (2018-04-10) diff --git a/vendor/github.com/Masterminds/semver/v3/README.md b/vendor/github.com/Masterminds/semver/v3/README.md index ed5693608..2f56c676a 100644 --- a/vendor/github.com/Masterminds/semver/v3/README.md +++ b/vendor/github.com/Masterminds/semver/v3/README.md @@ -50,6 +50,18 @@ other versions, convert the version back into a string, and get the original string. Getting the original string is useful if the semantic version was coerced into a valid form. +There are package level variables that affect how `NewVersion` handles parsing. + +- `CoerceNewVersion` is `true` by default. When set to `true` it coerces non-compliant + versions into SemVer. For example, allowing a leading 0 in a major, minor, or patch + part. This enables the use of CalVer in versions even when not compliant with SemVer. + When set to `false` less coercion work is done. +- `DetailedNewVersionErrors` provides more detailed errors. It only has an affect when + `CoerceNewVersion` is set to `false`. When `DetailedNewVersionErrors` is set to `true` + it can provide some more insight into why a version is invalid. Setting + `DetailedNewVersionErrors` to `false` is faster on performance but provides less + detailed error messages if a version fails to parse. + ## Sorting Semantic Versions A set of versions can be sorted using the `sort` package from the standard library. @@ -160,6 +172,10 @@ means `>=1.2.3-BETA` will return `1.2.3-alpha`. What you might expect from case sensitivity doesn't apply here. This is due to ASCII sort ordering which is what the spec specifies. +The `Constraints` instance returned from `semver.NewConstraint()` has a property +`IncludePrerelease` that, when set to true, will return prerelease versions when calls +to `Check()` and `Validate()` are made. + ### Hyphen Range Comparisons There are multiple methods to handle ranges and the first is hyphens ranges. @@ -250,7 +266,7 @@ or [create a pull request](https://github.com/Masterminds/semver/pulls). Security is an important consideration for this project. The project currently uses the following tools to help discover security issues: -* [CodeQL](https://github.com/Masterminds/semver) +* [CodeQL](https://codeql.github.com) * [gosec](https://github.com/securego/gosec) * Daily Fuzz testing diff --git a/vendor/github.com/Masterminds/semver/v3/constraints.go b/vendor/github.com/Masterminds/semver/v3/constraints.go index 8461c7ed9..8b7a10f83 100644 --- a/vendor/github.com/Masterminds/semver/v3/constraints.go +++ b/vendor/github.com/Masterminds/semver/v3/constraints.go @@ -12,6 +12,13 @@ import ( // checked against. type Constraints struct { constraints [][]*constraint + containsPre []bool + + // IncludePrerelease specifies if pre-releases should be included in + // the results. Note, if a constraint range has a prerelease than + // prereleases will be included for that AND group even if this is + // set to false. + IncludePrerelease bool } // NewConstraint returns a Constraints instance that a Version instance can @@ -22,11 +29,10 @@ func NewConstraint(c string) (*Constraints, error) { c = rewriteRange(c) ors := strings.Split(c, "||") - or := make([][]*constraint, len(ors)) + lenors := len(ors) + or := make([][]*constraint, lenors) + hasPre := make([]bool, lenors) for k, v := range ors { - - // TODO: Find a way to validate and fetch all the constraints in a simpler form - // Validate the segment if !validConstraintRegex.MatchString(v) { return nil, fmt.Errorf("improper constraint: %s", v) @@ -43,12 +49,22 @@ func NewConstraint(c string) (*Constraints, error) { return nil, err } + // If one of the constraints has a prerelease record this. + // This information is used when checking all in an "and" + // group to ensure they all check for prereleases. + if pc.con.pre != "" { + hasPre[k] = true + } + result[i] = pc } or[k] = result } - o := &Constraints{constraints: or} + o := &Constraints{ + constraints: or, + containsPre: hasPre, + } return o, nil } @@ -57,10 +73,10 @@ func (cs Constraints) Check(v *Version) bool { // TODO(mattfarina): For v4 of this library consolidate the Check and Validate // functions as the underlying functions make that possible now. // loop over the ORs and check the inner ANDs - for _, o := range cs.constraints { + for i, o := range cs.constraints { joy := true for _, c := range o { - if check, _ := c.check(v); !check { + if check, _ := c.check(v, (cs.IncludePrerelease || cs.containsPre[i])); !check { joy = false break } @@ -83,12 +99,12 @@ func (cs Constraints) Validate(v *Version) (bool, []error) { // Capture the prerelease message only once. When it happens the first time // this var is marked var prerelesase bool - for _, o := range cs.constraints { + for i, o := range cs.constraints { joy := true for _, c := range o { // Before running the check handle the case there the version is // a prerelease and the check is not searching for prereleases. - if c.con.pre == "" && v.pre != "" { + if !(cs.IncludePrerelease || cs.containsPre[i]) && v.pre != "" { if !prerelesase { em := fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) e = append(e, em) @@ -98,7 +114,7 @@ func (cs Constraints) Validate(v *Version) (bool, []error) { } else { - if _, err := c.check(v); err != nil { + if _, err := c.check(v, (cs.IncludePrerelease || cs.containsPre[i])); err != nil { e = append(e, err) joy = false } @@ -227,8 +243,8 @@ type constraint struct { } // Check if a version meets the constraint -func (c *constraint) check(v *Version) (bool, error) { - return constraintOps[c.origfunc](v, c) +func (c *constraint) check(v *Version, includePre bool) (bool, error) { + return constraintOps[c.origfunc](v, c, includePre) } // String prints an individual constraint into a string @@ -236,7 +252,7 @@ func (c *constraint) string() string { return c.origfunc + c.orig } -type cfunc func(v *Version, c *constraint) (bool, error) +type cfunc func(v *Version, c *constraint, includePre bool) (bool, error) func parseConstraint(c string) (*constraint, error) { if len(c) > 0 { @@ -272,7 +288,7 @@ func parseConstraint(c string) (*constraint, error) { // The constraintRegex should catch any regex parsing errors. So, // we should never get here. - return nil, errors.New("constraint Parser Error") + return nil, errors.New("constraint parser error") } cs.con = con @@ -290,7 +306,7 @@ func parseConstraint(c string) (*constraint, error) { // The constraintRegex should catch any regex parsing errors. So, // we should never get here. - return nil, errors.New("constraint Parser Error") + return nil, errors.New("constraint parser error") } cs := &constraint{ @@ -305,16 +321,14 @@ func parseConstraint(c string) (*constraint, error) { } // Constraint functions -func constraintNotEqual(v *Version, c *constraint) (bool, error) { - if c.dirty { - - // If there is a pre-release on the version but the constraint isn't looking - // for them assume that pre-releases are not compatible. See issue 21 for - // more details. - if v.Prerelease() != "" && c.con.Prerelease() == "" { - return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) - } +func constraintNotEqual(v *Version, c *constraint, includePre bool) (bool, error) { + // The existence of prereleases is checked at the group level and passed in. + // Exit early if the version has a prerelease but those are to be ignored. + if v.Prerelease() != "" && !includePre { + return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) + } + if c.dirty { if c.con.Major() != v.Major() { return true, nil } @@ -345,12 +359,11 @@ func constraintNotEqual(v *Version, c *constraint) (bool, error) { return true, nil } -func constraintGreaterThan(v *Version, c *constraint) (bool, error) { +func constraintGreaterThan(v *Version, c *constraint, includePre bool) (bool, error) { - // If there is a pre-release on the version but the constraint isn't looking - // for them assume that pre-releases are not compatible. See issue 21 for - // more details. - if v.Prerelease() != "" && c.con.Prerelease() == "" { + // The existence of prereleases is checked at the group level and passed in. + // Exit early if the version has a prerelease but those are to be ignored. + if v.Prerelease() != "" && !includePre { return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) } @@ -391,11 +404,10 @@ func constraintGreaterThan(v *Version, c *constraint) (bool, error) { return false, fmt.Errorf("%s is less than or equal to %s", v, c.orig) } -func constraintLessThan(v *Version, c *constraint) (bool, error) { - // If there is a pre-release on the version but the constraint isn't looking - // for them assume that pre-releases are not compatible. See issue 21 for - // more details. - if v.Prerelease() != "" && c.con.Prerelease() == "" { +func constraintLessThan(v *Version, c *constraint, includePre bool) (bool, error) { + // The existence of prereleases is checked at the group level and passed in. + // Exit early if the version has a prerelease but those are to be ignored. + if v.Prerelease() != "" && !includePre { return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) } @@ -406,12 +418,11 @@ func constraintLessThan(v *Version, c *constraint) (bool, error) { return false, fmt.Errorf("%s is greater than or equal to %s", v, c.orig) } -func constraintGreaterThanEqual(v *Version, c *constraint) (bool, error) { +func constraintGreaterThanEqual(v *Version, c *constraint, includePre bool) (bool, error) { - // If there is a pre-release on the version but the constraint isn't looking - // for them assume that pre-releases are not compatible. See issue 21 for - // more details. - if v.Prerelease() != "" && c.con.Prerelease() == "" { + // The existence of prereleases is checked at the group level and passed in. + // Exit early if the version has a prerelease but those are to be ignored. + if v.Prerelease() != "" && !includePre { return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) } @@ -422,11 +433,10 @@ func constraintGreaterThanEqual(v *Version, c *constraint) (bool, error) { return false, fmt.Errorf("%s is less than %s", v, c.orig) } -func constraintLessThanEqual(v *Version, c *constraint) (bool, error) { - // If there is a pre-release on the version but the constraint isn't looking - // for them assume that pre-releases are not compatible. See issue 21 for - // more details. - if v.Prerelease() != "" && c.con.Prerelease() == "" { +func constraintLessThanEqual(v *Version, c *constraint, includePre bool) (bool, error) { + // The existence of prereleases is checked at the group level and passed in. + // Exit early if the version has a prerelease but those are to be ignored. + if v.Prerelease() != "" && !includePre { return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) } @@ -455,11 +465,10 @@ func constraintLessThanEqual(v *Version, c *constraint) (bool, error) { // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0, <1.3.0 // ~1.2.3, ~>1.2.3 --> >=1.2.3, <1.3.0 // ~1.2.0, ~>1.2.0 --> >=1.2.0, <1.3.0 -func constraintTilde(v *Version, c *constraint) (bool, error) { - // If there is a pre-release on the version but the constraint isn't looking - // for them assume that pre-releases are not compatible. See issue 21 for - // more details. - if v.Prerelease() != "" && c.con.Prerelease() == "" { +func constraintTilde(v *Version, c *constraint, includePre bool) (bool, error) { + // The existence of prereleases is checked at the group level and passed in. + // Exit early if the version has a prerelease but those are to be ignored. + if v.Prerelease() != "" && !includePre { return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) } @@ -487,16 +496,15 @@ func constraintTilde(v *Version, c *constraint) (bool, error) { // When there is a .x (dirty) status it automatically opts in to ~. Otherwise // it's a straight = -func constraintTildeOrEqual(v *Version, c *constraint) (bool, error) { - // If there is a pre-release on the version but the constraint isn't looking - // for them assume that pre-releases are not compatible. See issue 21 for - // more details. - if v.Prerelease() != "" && c.con.Prerelease() == "" { +func constraintTildeOrEqual(v *Version, c *constraint, includePre bool) (bool, error) { + // The existence of prereleases is checked at the group level and passed in. + // Exit early if the version has a prerelease but those are to be ignored. + if v.Prerelease() != "" && !includePre { return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) } if c.dirty { - return constraintTilde(v, c) + return constraintTilde(v, c, includePre) } eq := v.Equal(c.con) @@ -516,11 +524,10 @@ func constraintTildeOrEqual(v *Version, c *constraint) (bool, error) { // ^0.0.3 --> >=0.0.3 <0.0.4 // ^0.0 --> >=0.0.0 <0.1.0 // ^0 --> >=0.0.0 <1.0.0 -func constraintCaret(v *Version, c *constraint) (bool, error) { - // If there is a pre-release on the version but the constraint isn't looking - // for them assume that pre-releases are not compatible. See issue 21 for - // more details. - if v.Prerelease() != "" && c.con.Prerelease() == "" { +func constraintCaret(v *Version, c *constraint, includePre bool) (bool, error) { + // The existence of prereleases is checked at the group level and passed in. + // Exit early if the version has a prerelease but those are to be ignored. + if v.Prerelease() != "" && !includePre { return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) } diff --git a/vendor/github.com/Masterminds/semver/v3/version.go b/vendor/github.com/Masterminds/semver/v3/version.go index 304edc342..7a3ba7388 100644 --- a/vendor/github.com/Masterminds/semver/v3/version.go +++ b/vendor/github.com/Masterminds/semver/v3/version.go @@ -14,28 +14,40 @@ import ( // The compiled version of the regex created at init() is cached here so it // only needs to be created once. var versionRegex *regexp.Regexp +var looseVersionRegex *regexp.Regexp + +// CoerceNewVersion sets if leading 0's are allowd in the version part. Leading 0's are +// not allowed in a valid semantic version. When set to true, NewVersion will coerce +// leading 0's into a valid version. +var CoerceNewVersion = true + +// DetailedNewVersionErrors specifies if detailed errors are returned from the NewVersion +// function. This is used when CoerceNewVersion is set to false. If set to false +// ErrInvalidSemVer is returned for an invalid version. This does not apply to +// StrictNewVersion. Setting this function to false returns errors more quickly. +var DetailedNewVersionErrors = true var ( // ErrInvalidSemVer is returned a version is found to be invalid when // being parsed. - ErrInvalidSemVer = errors.New("Invalid Semantic Version") + ErrInvalidSemVer = errors.New("invalid semantic version") // ErrEmptyString is returned when an empty string is passed in for parsing. - ErrEmptyString = errors.New("Version string empty") + ErrEmptyString = errors.New("version string empty") // ErrInvalidCharacters is returned when invalid characters are found as // part of a version - ErrInvalidCharacters = errors.New("Invalid characters in version") + ErrInvalidCharacters = errors.New("invalid characters in version") // ErrSegmentStartsZero is returned when a version segment starts with 0. // This is invalid in SemVer. - ErrSegmentStartsZero = errors.New("Version segment starts with 0") + ErrSegmentStartsZero = errors.New("version segment starts with 0") // ErrInvalidMetadata is returned when the metadata is an invalid format - ErrInvalidMetadata = errors.New("Invalid Metadata string") + ErrInvalidMetadata = errors.New("invalid metadata string") // ErrInvalidPrerelease is returned when the pre-release is an invalid format - ErrInvalidPrerelease = errors.New("Invalid Prerelease string") + ErrInvalidPrerelease = errors.New("invalid prerelease string") ) // semVerRegex is the regular expression used to parse a semantic version. @@ -45,6 +57,12 @@ const semVerRegex string = `v?(0|[1-9]\d*)(?:\.(0|[1-9]\d*))?(?:\.(0|[1-9]\d*))? `(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?` + `(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?` +// looseSemVerRegex is a regular expression that lets invalid semver expressions through +// with enough detail that certain errors can be checked for. +const looseSemVerRegex string = `v?([0-9]+)(\.[0-9]+)?(\.[0-9]+)?` + + `(-([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` + + `(\+([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` + // Version represents a single semantic version. type Version struct { major, minor, patch uint64 @@ -55,6 +73,7 @@ type Version struct { func init() { versionRegex = regexp.MustCompile("^" + semVerRegex + "$") + looseVersionRegex = regexp.MustCompile("^" + looseSemVerRegex + "$") } const ( @@ -142,8 +161,27 @@ func StrictNewVersion(v string) (*Version, error) { // attempts to convert it to SemVer. If you want to validate it was a strict // semantic version at parse time see StrictNewVersion(). func NewVersion(v string) (*Version, error) { + if CoerceNewVersion { + return coerceNewVersion(v) + } m := versionRegex.FindStringSubmatch(v) if m == nil { + + // Disabling detailed errors is first so that it is in the fast path. + if !DetailedNewVersionErrors { + return nil, ErrInvalidSemVer + } + + // Check for specific errors with the semver string and return a more detailed + // error. + m = looseVersionRegex.FindStringSubmatch(v) + if m == nil { + return nil, ErrInvalidSemVer + } + err := validateVersion(m) + if err != nil { + return nil, err + } return nil, ErrInvalidSemVer } @@ -156,13 +194,13 @@ func NewVersion(v string) (*Version, error) { var err error sv.major, err = strconv.ParseUint(m[1], 10, 64) if err != nil { - return nil, fmt.Errorf("Error parsing version segment: %s", err) + return nil, fmt.Errorf("error parsing version segment: %w", err) } if m[2] != "" { sv.minor, err = strconv.ParseUint(m[2], 10, 64) if err != nil { - return nil, fmt.Errorf("Error parsing version segment: %s", err) + return nil, fmt.Errorf("error parsing version segment: %w", err) } } else { sv.minor = 0 @@ -171,7 +209,61 @@ func NewVersion(v string) (*Version, error) { if m[3] != "" { sv.patch, err = strconv.ParseUint(m[3], 10, 64) if err != nil { - return nil, fmt.Errorf("Error parsing version segment: %s", err) + return nil, fmt.Errorf("error parsing version segment: %w", err) + } + } else { + sv.patch = 0 + } + + // Perform some basic due diligence on the extra parts to ensure they are + // valid. + + if sv.pre != "" { + if err = validatePrerelease(sv.pre); err != nil { + return nil, err + } + } + + if sv.metadata != "" { + if err = validateMetadata(sv.metadata); err != nil { + return nil, err + } + } + + return sv, nil +} + +func coerceNewVersion(v string) (*Version, error) { + m := looseVersionRegex.FindStringSubmatch(v) + if m == nil { + return nil, ErrInvalidSemVer + } + + sv := &Version{ + metadata: m[8], + pre: m[5], + original: v, + } + + var err error + sv.major, err = strconv.ParseUint(m[1], 10, 64) + if err != nil { + return nil, fmt.Errorf("error parsing version segment: %w", err) + } + + if m[2] != "" { + sv.minor, err = strconv.ParseUint(strings.TrimPrefix(m[2], "."), 10, 64) + if err != nil { + return nil, fmt.Errorf("error parsing version segment: %w", err) + } + } else { + sv.minor = 0 + } + + if m[3] != "" { + sv.patch, err = strconv.ParseUint(strings.TrimPrefix(m[3], "."), 10, 64) + if err != nil { + return nil, fmt.Errorf("error parsing version segment: %w", err) } } else { sv.patch = 0 @@ -615,7 +707,7 @@ func validatePrerelease(p string) error { eparts := strings.Split(p, ".") for _, p := range eparts { if p == "" { - return ErrInvalidMetadata + return ErrInvalidPrerelease } else if containsOnly(p, num) { if len(p) > 1 && p[0] == '0' { return ErrSegmentStartsZero @@ -643,3 +735,54 @@ func validateMetadata(m string) error { } return nil } + +// validateVersion checks for common validation issues but may not catch all errors +func validateVersion(m []string) error { + var err error + var v string + if m[1] != "" { + if len(m[1]) > 1 && m[1][0] == '0' { + return ErrSegmentStartsZero + } + _, err = strconv.ParseUint(m[1], 10, 64) + if err != nil { + return fmt.Errorf("error parsing version segment: %w", err) + } + } + + if m[2] != "" { + v = strings.TrimPrefix(m[2], ".") + if len(v) > 1 && v[0] == '0' { + return ErrSegmentStartsZero + } + _, err = strconv.ParseUint(v, 10, 64) + if err != nil { + return fmt.Errorf("error parsing version segment: %w", err) + } + } + + if m[3] != "" { + v = strings.TrimPrefix(m[3], ".") + if len(v) > 1 && v[0] == '0' { + return ErrSegmentStartsZero + } + _, err = strconv.ParseUint(v, 10, 64) + if err != nil { + return fmt.Errorf("error parsing version segment: %w", err) + } + } + + if m[5] != "" { + if err = validatePrerelease(m[5]); err != nil { + return err + } + } + + if m[8] != "" { + if err = validateMetadata(m[8]); err != nil { + return err + } + } + + return nil +} diff --git a/vendor/github.com/moby/term/term_unix.go b/vendor/github.com/moby/term/term_unix.go index 2ec7706a1..579ce5530 100644 --- a/vendor/github.com/moby/term/term_unix.go +++ b/vendor/github.com/moby/term/term_unix.go @@ -81,7 +81,7 @@ func setRawTerminal(fd uintptr) (*State, error) { return makeRaw(fd) } -func setRawTerminalOutput(fd uintptr) (*State, error) { +func setRawTerminalOutput(uintptr) (*State, error) { return nil, nil } diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/.codecov.yml b/vendor/github.com/opensearch-project/opensearch-go/v3/.codecov.yml new file mode 100644 index 000000000..7b390d3a0 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/.codecov.yml @@ -0,0 +1,15 @@ +# https://docs.codecov.com/docs/pull-request-comments +comment: + layout: "diff, flags, files" + behavior: default + require_changes: false # if true: only post the comment if coverage changes + require_base: false # [true :: must have a base report to post] + require_head: true # [true :: must have a head report to post] + hide_project_coverage: false # [true :: only show coverage on the git diff] + +coverage: + status: + project: + default: + threshold: 5% # allow 5% coverage decrease + patch: off diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/.dockerignore b/vendor/github.com/opensearch-project/opensearch-go/v3/.dockerignore new file mode 100644 index 000000000..4c8512b08 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/.dockerignore @@ -0,0 +1,2 @@ +.git/ +tmp/ diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/.gitignore b/vendor/github.com/opensearch-project/opensearch-go/v3/.gitignore new file mode 100644 index 000000000..8c2fd150a --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/.gitignore @@ -0,0 +1,9 @@ +tmp/ +*.test + +# editors +.idea +.vscode +bin/ + +.DS_Store \ No newline at end of file diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/.golangci.yml b/vendor/github.com/opensearch-project/opensearch-go/v3/.golangci.yml new file mode 100644 index 000000000..9d303223b --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/.golangci.yml @@ -0,0 +1,175 @@ +run: + timeout: 10m + modules-download-mode: readonly + +linters-settings: + errcheck: + check-blank: true + check-type-assertions: false + errorlint: + check-generated: false + default-signifies-exhaustive: false + exhaustive: + default-signifies-exhaustive: false + gci: + sections: + - standard + - default + - prefix(github.com/opensearch-project/opensearch-go) + goconst: + min-len: 3 + min-occurrences: 3 + godox: + keywords: + - BUG + - FIXME + - HACK + goimports: + local-prefixes: github.com/opensearch-project/opensearch-go + lll: + line-length: 140 + nolintlint: + allow-leading-space: false + require-explanation: true + require-specific: true + unparam: + check-exported: true + misspell: + locale: US + ignore-words: + - expect + - cancelled + prealloc: + simple: true + range-loops: true + for-loops: false + revive: + rules: + - name: exported + severity: error + disabled: false + arguments: + - "checkPrivateReceivers" + - "sayRepetitiveInsteadOfStutters" + +linters: + disable-all: true + enable: + - asasalint + - asciicheck + - bidichk + - bodyclose + - containedctx + - contextcheck + - decorder + - dogsled + - dupl + - dupword + - durationcheck + - errcheck + - errchkjson + - errname + - errorlint + - execinquery + - exhaustive + - exportloopref + - gci + - ginkgolinter + - gocheckcompilerdirectives + - gochecknoglobals + - gochecknoinits + - goconst + - gocritic + - godox + - gofmt + - gofumpt + - goheader + - goimports + - gomoddirectives + - gomodguard + - goprintffuncname + - gosec + - gosimple + - govet + - grouper + - importas + - ineffassign + - interfacebloat + - lll + - loggercheck + - makezero + - mirror + - misspell + - musttag + - nakedret + - nestif + - nilerr + - nilnil + - noctx + - nolintlint + - nonamedreturns + - nosprintfhostport + - prealloc + - predeclared + - promlinter + - reassign + - revive + - rowserrcheck + - sqlclosecheck + - staticcheck + - stylecheck + - tagalign + - testpackage + - thelper + - tparallel + - typecheck + - unconvert + - unparam + - unused + - usestdlibvars + - wastedassign + - whitespace + - zerologlint + +issues: + include: + - EXC0012 + - EXC0014 + exclude-rules: + - path: (_test\.go|internal/) + linters: + - cyclop + - dupl + - errcheck + - gochecknoglobals + - gochecknoinits + - goconst + - noctx + - linters: + - gosec + text: "math/rand" + path: _test\.go + - linters: + - gosec + text: "TLS InsecureSkipVerify set true" + path: (_test\.go|internal/) + - linters: + - gosec + text: "G108: Profiling endpoint is automatically exposed on /debug/pprof" + path: _test\.go + - linters: + - goconst + path: opensearchapi\/api_ + - linters: + - errcheck + text: "Error return value of `debugLogger.Logf` is not checked" + - linters: + - errcheck + - gochecknoglobals + path: opensearchtransport\/logger\.go + - linters: + - nestif + path: opensearchtransport/opensearchtransport.go + - linters: + - dupl + path: (-params\.go|api_indices|api_dangling\.go|api_point_in_time\.go|rethrottle\.go|api_cat-.*\.go) diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/.whitesource b/vendor/github.com/opensearch-project/opensearch-go/v3/.whitesource new file mode 100644 index 000000000..db4b0fec8 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/.whitesource @@ -0,0 +1,15 @@ +{ + "scanSettings": { + "configMode": "AUTO", + "configExternalURL": "", + "projectToken": "", + "baseBranches": [] + }, + "checkRunSettings": { + "vulnerableCheckRunConclusionLevel": "failure", + "displayMode": "diff" + }, + "issueSettings": { + "minSeverityLevel": "LOW" + } +} \ No newline at end of file diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/ADMINS.md b/vendor/github.com/opensearch-project/opensearch-go/v3/ADMINS.md new file mode 100644 index 000000000..f9220c93b --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/ADMINS.md @@ -0,0 +1,38 @@ +- [Overview](#overview) +- [Current Admins](#current-admins) +- [Admin Responsibilities](#admin-responsibilities) + - [Prioritize Security](#prioritize-security) + - [Enforce Code of Conduct](#enforce-code-of-conduct) + - [Adopt Organizational Best Practices](#adopt-organizational-best-practices) + +## Overview + +This document explains who the admins are (see below), what they do in this repo, and how they should be doing it. If you're interested in becoming a maintainer, see [MAINTAINERS](MAINTAINERS.md). If you're interested in contributing, see [CONTRIBUTING](CONTRIBUTING.md). + +## Current Admins + +| Admin | GitHub ID | Affiliation | +| --- | --- | --- | +| Charlotte | [CEHENKLE](https://github.com/CEHENKLE) | Amazon | +| Henri Yandell | [hyandell](https://github.com/hyandell) | Amazon | +| Jack Mazanec | [jmazanec15](https://github.com/jmazanec15) | Amazon | +| Vamshi Vijay Nakkirtha | [vamshin](https://github.com/vamshin) | Amazon | +| Vijayan Balasubramanian | [VijayanB](https://github.com/VijayanB) | Amazon | + +## Admin Responsibilities + +As an admin you own stewartship of the repository and its settings. Admins have [admin-level permissions on a repository](https://docs.github.com/en/organizations/managing-access-to-your-organizations-repositories/repository-permission-levels-for-an-organization). Use those privileges to serve the community and protect the repository as follows. + +### Prioritize Security + +Security is your number one priority. Manage security keys and safeguard access to the repository. + +Note that this repository is monitored and supported 24/7 by Amazon Security, see [Reporting a Vulnerability](SECURITY.md) for details. + +### Enforce Code of Conduct + +Act on [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md) violations by revoking access, and blocking malicious actors. + +### Adopt Organizational Best Practices + +Adopt organizational best practices, work in the open, and collaborate with other admins by opening issues before making process changes. Prefer consistency, and avoid diverging from practices in the opensearch-project organization. diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/CHANGELOG.md b/vendor/github.com/opensearch-project/opensearch-go/v3/CHANGELOG.md new file mode 100644 index 000000000..eb4b94926 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/CHANGELOG.md @@ -0,0 +1,157 @@ +# CHANGELOG + +Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) + +## [3.1.0] + +### Added + +- Adds new struct fields introduced in OpenSearch 2.12 ([#482](https://github.com/opensearch-project/opensearch-go/pull/482)) +- Adds initial admin password environment variable and CI changes to support 2.12.0 release ([#449](https://github.com/opensearch-project/opensearch-go/pull/449)) +- Adds `merge_id` field for indices segment request ([#488](https://github.com/opensearch-project/opensearch-go/pull/488)) + +### Changed + +- Updates workflow action versions ([#488](https://github.com/opensearch-project/opensearch-go/pull/488)) +- Changes integration tests to work with secure and unsecure OpenSearch ([#488](https://github.com/opensearch-project/opensearch-go/pull/488)) +- Moves functions from `opensearch/internal/test` to `internal/test` for more general test uses ([#488](https://github.com/opensearch-project/opensearch-go/pull/488)) +- Changes `custom_foldername` field to pointer as it can be `null` ([#488](https://github.com/opensearch-project/opensearch-go/pull/488)) +- Changs cat indices Primary and Replica field to pointer as it can be `null` ([#488](https://github.com/opensearch-project/opensearch-go/pull/488)) +- Replaces `ioutil` with `io` in examples and integration tests [#495](https://github.com/opensearch-project/opensearch-go/pull/495) + +### Fixed + +- Fix incorrect SigV4 `x-amz-content-sha256` with AWS SDK v1 requests without a body ([#496](https://github.com/opensearch-project/opensearch-go/pull/496)) + +### Dependencies + +- Bumps `github.com/aws/aws-sdk-go` from 1.48.13 to 1.50.36 +- Bumps `github.com/aws/aws-sdk-go-v2/config` from 1.25.11 to 1.27.7 +- Bumps `github.com/stretchr/testify` from 1.8.4 to 1.9.0 + +## [3.0.0] + +### Added + +- Adds `Err()` function to Response for detailed errors ([#246](https://github.com/opensearch-project/opensearch-go/pull/246)) +- Adds golangci-lint as code analysis tool ([#313](https://github.com/opensearch-project/opensearch-go/pull/313)) +- Adds govulncheck to check for go vulnerablities ([#405](https://github.com/opensearch-project/opensearch-go/pull/405)) +- Adds opensearchapi with new client and function structure ([#421](https://github.com/opensearch-project/opensearch-go/pull/421)) +- Adds integration tests for all opensearchapi functions ([#421](https://github.com/opensearch-project/opensearch-go/pull/421)) +- Adds guide on making raw JSON REST requests ([#399](https://github.com/opensearch-project/opensearch-go/pull/399)) +- Adds IPV6 support in the DiscoverNodes method ([#458](https://github.com/opensearch-project/opensearch-go/issues/458)) + +### Changed + +- Removes the need for double error checking ([#246](https://github.com/opensearch-project/opensearch-go/pull/246)) +- Updates and adjusted golangci-lint, solve linting complains for signer ([#352](https://github.com/opensearch-project/opensearch-go/pull/352)) +- Solves linting complains for opensearchtransport ([#353](https://github.com/opensearch-project/opensearch-go/pull/353)) +- Updates Developer guide to include docker build instructions ([#385](https://github.com/opensearch-project/opensearch-go/pull/385)) +- Tests against version 2.9.0, 2.10.0, run tests in all branches, changes integration tests to wait for OpenSearch to start ([#392](https://github.com/opensearch-project/opensearch-go/pull/392)) +- Makefile: uses docker golangci-lint, run integration test on `.` folder, change coverage generation ([#392](https://github.com/opensearch-project/opensearch-go/pull/392)) +- golangci-lint: updates rules and fail when issues are found ([#421](https://github.com/opensearch-project/opensearch-go/pull/421)) +- go: updates to golang version 1.20 ([#421](https://github.com/opensearch-project/opensearch-go/pull/421)) +- guids: updates to work for the new opensearchapi ([#421](https://github.com/opensearch-project/opensearch-go/pull/421)) +- Adjusts tests to new opensearchapi functions and structs ([#421](https://github.com/opensearch-project/opensearch-go/pull/421)) +- Changes codecov to comment code coverage to each PR ([#410](https://github.com/opensearch-project/opensearch-go/pull/410)) +- Changes module version from v2 to v3 ([#444](https://github.com/opensearch-project/opensearch-go/pull/444)) + +### Deprecated + +- Deprecates legacy API `/_template` ([#390](https://github.com/opensearch-project/opensearch-go/pull/390)) + +### Removed + +- Removes all old opensearchapi functions ([#421](https://github.com/opensearch-project/opensearch-go/pull/421)) +- Removes `/internal/build` code and folders ([#421](https://github.com/opensearch-project/opensearch-go/pull/421)) + +### Fixed + +- Corrects AWSv4 signature on DataStream `Stats` with no index name specified ([#338](https://github.com/opensearch-project/opensearch-go/pull/338)) +- Fixes GetSourceRequest `Source` field and deprecated the `Source` parameter ([#402](https://github.com/opensearch-project/opensearch-go/pull/402)) +- Corrects developer guide summary with golang version 1.20 ([#434](https://github.com/opensearch-project/opensearch-go/pull/434)) + +### Dependencies + +- Bumps `github.com/aws/aws-sdk-go` from 1.44.263 to 1.48.13 +- Bumps `github.com/aws/aws-sdk-go-v2` from 1.18.0 to 1.23.5 +- Bumps `github.com/aws/aws-sdk-go-v2/config` from 1.18.25 to 1.25.11 +- Bumps `github.com/stretchr/testify` from 1.8.2 to 1.8.4 +- Bumps `golang.org/x/net` from 0.7.0 to 0.17.0 +- Bumps `github.com/golangci/golangci-lint-action` from 1.53.3 to 1.54.2 + +## [2.3.0] + +### Added + +- Adds implementation of Data Streams API ([#257](https://github.com/opensearch-project/opensearch-go/pull/257)) +- Adds Point In Time API ([#253](https://github.com/opensearch-project/opensearch-go/pull/253)) +- Adds InfoResp type ([#253](https://github.com/opensearch-project/opensearch-go/pull/253)) +- Adds markdown linter ([#261](https://github.com/opensearch-project/opensearch-go/pull/261)) +- Adds testcases to check upsert functionality ([#269](https://github.com/opensearch-project/opensearch-go/pull/269)) +- Adds @Jakob3xD to co-maintainers ([#270](https://github.com/opensearch-project/opensearch-go/pull/270)) +- Adds dynamic type to \_source field ([#285](https://github.com/opensearch-project/opensearch-go/pull/285)) +- Adds testcases for Document API ([#285](https://github.com/opensearch-project/opensearch-go/pull/285)) +- Adds `index_lifecycle` guide ([#287](https://github.com/opensearch-project/opensearch-go/pull/287)) +- Adds `bulk` guide ([#292](https://github.com/opensearch-project/opensearch-go/pull/292)) +- Adds `search` guide ([#291](https://github.com/opensearch-project/opensearch-go/pull/291)) +- Adds `document_lifecycle` guide ([#290](https://github.com/opensearch-project/opensearch-go/pull/290)) +- Adds `index_template` guide ([#289](https://github.com/opensearch-project/opensearch-go/pull/289)) +- Adds `advanced_index_actions` guide ([#288](https://github.com/opensearch-project/opensearch-go/pull/288)) +- Adds testcases to check UpdateByQuery functionality ([#304](https://github.com/opensearch-project/opensearch-go/pull/304)) +- Adds additional timeout after cluster start ([#303](https://github.com/opensearch-project/opensearch-go/pull/303)) +- Adds docker healthcheck to auto restart the container ([#315](https://github.com/opensearch-project/opensearch-go/pull/315)) + +### Changed + +- Uses `[]string` instead of `string` in `SnapshotDeleteRequest` ([#237](https://github.com/opensearch-project/opensearch-go/pull/237)) +- Updates workflows to reduce CI time, consolidate OpenSearch versions, update compatibility matrix ([#242](https://github.com/opensearch-project/opensearch-go/pull/242)) +- Moves @svencowart to emeritus maintainers ([#270](https://github.com/opensearch-project/opensearch-go/pull/270)) +- Reads, closes and replaces the http Reponse Body ([#300](https://github.com/opensearch-project/opensearch-go/pull/300)) + +### Fixed + +- Corrects curl logging to emit the correct URL destination ([#101](https://github.com/opensearch-project/opensearch-go/pull/101)) + +### Dependencies + +- Bumps `github.com/aws/aws-sdk-go` from 1.44.180 to 1.44.263 +- Bumps `github.com/aws/aws-sdk-go-v2` from 1.17.4 to 1.18.0 +- Bumps `github.com/aws/aws-sdk-go-v2/config` from 1.18.8 to 1.18.25 +- Bumps `github.com/stretchr/testify` from 1.8.1 to 1.8.2 + +## [2.2.0] + +### Added + +- Adds Github workflow for changelog verification ([#172](https://github.com/opensearch-project/opensearch-go/pull/172)) +- Adds Go Documentation link for the client ([#182](https://github.com/opensearch-project/opensearch-go/pull/182)) +- Adds support for Amazon OpenSearch Serverless ([#216](https://github.com/opensearch-project/opensearch-go/pull/216)) + +### Removed + +- Removes info call before performing every request ([#219](https://github.com/opensearch-project/opensearch-go/pull/219)) + +### Fixed + +- Renames the sequence number struct tag to if_seq_no to fix optimistic concurrency control ([#166](https://github.com/opensearch-project/opensearch-go/pull/166)) +- Fixes `RetryOnConflict` on bulk indexer ([#215](https://github.com/opensearch-project/opensearch-go/pull/215)) + +### Dependencies + +- Bumps `github.com/aws/aws-sdk-go-v2` from 1.17.1 to 1.17.3 +- Bumps `github.com/aws/aws-sdk-go-v2/config` from 1.17.10 to 1.18.8 +- Bumps `github.com/aws/aws-sdk-go` from 1.44.176 to 1.44.180 +- Bumps `github.com/aws/aws-sdk-go` from 1.44.132 to 1.44.180 +- Bumps `github.com/stretchr/testify` from 1.8.0 to 1.8.1 +- Bumps `github.com/aws/aws-sdk-go` from 1.44.45 to 1.44.132 + +[Unreleased]: https://github.com/opensearch-project/opensearch-go/compare/v3.1.0...HEAD +[3.1.0]: https://github.com/opensearch-project/opensearch-go/compare/v3.0.0...v3.1.0 +[3.0.0]: https://github.com/opensearch-project/opensearch-go/compare/v2.3.0...v3.0.0 +[2.3.0]: https://github.com/opensearch-project/opensearch-go/compare/v2.2.0...v2.3.0 +[2.2.0]: https://github.com/opensearch-project/opensearch-go/compare/v2.1.0...v2.2.0 +[2.1.0]: https://github.com/opensearch-project/opensearch-go/compare/v2.0.1...v2.1.0 +[2.0.1]: https://github.com/opensearch-project/opensearch-go/compare/v2.0.0...v2.0.1 +[2.0.0]: https://github.com/opensearch-project/opensearch-go/compare/v1.1.0...v2.0.0 +[1.0.0]: https://github.com/opensearch-project/opensearch-go/compare/v1.0.0...v1.1.0 diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/CODE_OF_CONDUCT.md b/vendor/github.com/opensearch-project/opensearch-go/v3/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..c5efd05f7 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/CODE_OF_CONDUCT.md @@ -0,0 +1,22 @@ +This code of conduct applies to all spaces provided by the OpenSource project including in code, documentation, issue trackers, mailing lists, chat channels, wikis, blogs, social media and any other communication channels used by the project. + +**Our open source communities endeavor to:** + +- Be Inclusive: We are committed to being a community where everyone can join and contribute. This means using inclusive and welcoming language. +- Be Welcoming: We are committed to maintaining a safe space for everyone to be able to contribute. +- Be Respectful: We are committed to encouraging differing viewpoints, accepting constructive criticism and work collaboratively towards decisions that help the project grow. Disrespectful and unacceptable behavior will not be tolerated. +- Be Collaborative: We are committed to supporting what is best for our community and users. When we build anything for the benefit of the project, we should document the work we do and communicate to others on how this affects their work. + +**Our Responsibility. As contributors, members, or bystanders we each individually have the responsibility to behave professionally and respectfully at all times. Disrespectful and unacceptable behaviors include, but are not limited to:** + +- The use of violent threats, abusive, discriminatory, or derogatory language; +- Offensive comments related to gender, gender identity and expression, sexual orientation, disability, mental illness, race, political or religious affiliation; +- Posting of sexually explicit or violent content; +- The use of sexualized language and unwelcome sexual attention or advances; +- Public or private harassment of any kind; +- Publishing private information, such as physical or electronic address, without permission; +- Other conduct which could reasonably be considered inappropriate in a professional setting; +- Advocating for or encouraging any of the above behaviors. +- Enforcement and Reporting Code of Conduct Issues: + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported. [Contact us](mailto:opensource-codeofconduct@amazon.com). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/COMPATIBILITY.md b/vendor/github.com/opensearch-project/opensearch-go/v3/COMPATIBILITY.md new file mode 100644 index 000000000..8fe1797a8 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/COMPATIBILITY.md @@ -0,0 +1,15 @@ +- [Compatibility with OpenSearch](#compatibility-with-opensearch) +- [Upgrading](#upgrading) + +## Compatibility with OpenSearch + +The below matrix shows the compatibility of the [`opensearch-go`](https://pkg.go.dev/github.com/opensearch-project/opensearch-go) with versions of [`OpenSearch`](https://opensearch.org/downloads.html#opensearch). + +| Client Version | OpenSearch Version | +| -------------- | ------------------ | +| 1.x.0 | 1.x | +| 2.x.0 | 1.3.13-2.11.0 | + +## Upgrading + +Major versions of OpenSearch introduce breaking changes that require careful upgrades of the client. While `opensearch-go-client` 2.0.0 works against the latest OpenSearch 1.x, certain deprecated features removed in OpenSearch 2.0 have also been removed from the client. Please refer to the [OpenSearch documentation](https://opensearch.org/docs/latest/clients/index/) for more information. diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/CONTRIBUTING.md b/vendor/github.com/opensearch-project/opensearch-go/v3/CONTRIBUTING.md new file mode 100644 index 000000000..e7b0764fd --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/CONTRIBUTING.md @@ -0,0 +1,113 @@ +- [Contributing to OpenSearch](#contributing-to-opensearch) +- [First Things First](#first-things-first) +- [Ways to Contribute](#ways-to-contribute) + - [Bug Reports](#bug-reports) + - [Feature Requests](#feature-requests) + - [Contributing Code](#contributing-code) +- [Developer Certificate of Origin](#developer-certificate-of-origin) +- [Changelog](#changelog) + - [Adding Changes](#adding-changes) +- [Review Process](#review-process) + +## Contributing to OpenSearch + +OpenSearch is a community project that is built and maintained by people just like **you**. We're glad you're interested in helping out. There are several different ways you can do it, but before we talk about that, let's talk about how to get started. + +## First Things First + +1. **When in doubt, open an issue** - For almost any type of contribution, the first step is opening an issue. Even if you think you already know what the solution is, writing down a description of the problem you're trying to solve will help everyone get context when they review your pull request. If it's truly a trivial change (e.g. spelling error), you can skip this step -- but as the subject says, when it doubt, [open an issue](https://github.com/opensearch-project/opensearch-go/issues/new/choose). + +2. **Only submit your own work** (or work you have sufficient rights to submit) - Please make sure that any code or documentation you submit is your work or you have the rights to submit. We respect the intellectual property rights of others, and as part of contributing, we'll ask you to sign your contribution with a "Developer Certificate of Origin" (DCO) that states you have the rights to submit this work and you understand we'll use your contribution. There's more information about this topic in the [DCO section](#developer-certificate-of-origin). + +## Ways to Contribute + +### Bug Reports + +Ugh! Bugs! + +A bug is when software behaves in a way that you didn't expect and the developer didn't intend. To help us understand what's going on, we first want to make sure you're working from the latest version. + +Once you've confirmed that the bug still exists in the latest version, you'll want to check to make sure it's not something we already know about on the [open issues GitHub page](https://github.com/opensearch-project/opensearch-go/issues/new/choose). + +If you've upgraded to the latest version and you can't find it in our open issues list, then you'll need to tell us how to reproduce it Provide as much information as you can. You may think that the problem lies with your query, when actually it depends on how your data is indexed. The easier it is for us to recreate your problem, the faster it is likely to be fixed. + +### Feature Requests + +If you've thought of a way that OpenSearch could be better, we want to hear about it. We track feature requests using GitHub, so please feel free to open an issue which describes the feature you would like to see, why you need it, and how it should work. + +### Contributing Code + +As with other types of contributions, the first step is to [open an issue on GitHub](https://github.com/opensearch-project/opensearch-go/issues/new/choose). Opening an issue before you make changes makes sure that someone else isn't already working on that particular problem. It also lets us all work together to find the right approach before you spend a bunch of time on a PR. So again, when in doubt, open an issue. + +## Developer Certificate of Origin + +OpenSearch is an open source product released under the Apache 2.0 license (see either [the Apache site](https://www.apache.org/licenses/LICENSE-2.0) or the [LICENSE.txt file](LICENSE.txt)). The Apache 2.0 license allows you to freely use, modify, distribute, and sell your own products that include Apache 2.0 licensed software. + +We respect intellectual property rights of others and we want to make sure all incoming contributions are correctly attributed and licensed. A Developer Certificate of Origin (DCO) is a lightweight mechanism to do that. + +The DCO is a declaration attached to every contribution made by every developer. In the commit message of the contribution, the developer simply adds a `Signed-off-by` statement and thereby agrees to the DCO, which you can find below or at [DeveloperCertificate.org](http://developercertificate.org/). + +``` +Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +(a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +(b) The contribution is based upon previous work that, to the + best of my knowledge, is covered under an appropriate open + source license and I have the right under that license to + submit that work with modifications, whether created in whole + or in part by me, under the same open source license (unless + I am permitted to submit under a different license), as + Indicated in the file; or + +(c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +(d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including + all personal information I submit with it, including my + sign-off) is maintained indefinitely and may be redistributed + consistent with this project or the open source license(s) + involved. +``` + +We require that every contribution to OpenSearch is signed with a Developer Certificate of Origin. Additionally, please use your real name. We do not accept anonymous contributors nor those utilizing pseudonyms. + +Each commit must include a DCO which looks like this + +``` +Signed-off-by: Jane Smith +``` + +You may type this line on your own when writing your commit messages. However, if your user.name and user.email are set in your git configs, you can use `-s` or `– – signoff` to add the `Signed-off-by` line to the end of the commit message. + +## Changelog + +OpenSearch-go maintains a version specific changelog by enforcing a change to the ongoing [CHANGELOG](CHANGELOG.md) file adhering to the [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format. + +The changes are curated by version, with the changes to the main branch added chronologically to the `Unreleased` version. Each version has corresponding sections which list out the category of the change - `Added`, `Changed`, `Deprecated`, `Removed`, `Fixed`, `Security`. + +### Adding Changes + +As a contributor, you must ensure that every pull request has its changes listed out within the corresponding version and appropriate section of the [CHANGELOG](CHANGELOG.md) file. + +Adding in the change is a two step process - + +1. Add your changes to the corresponding section within the CHANGELOG file with dummy pull request information, publish the PR. + +2. Update the entry for your change in [`CHANGELOG.md`](CHANGELOG.md) and make sure that you reference the pull request there. + +## Review Process + +We deeply appreciate everyone who takes the time to make a contribution. We will review all contributions as quickly as possible. As a reminder, [opening an issue](https://github.com/opensearch-project/opensearch-go/issues/new/choose) discussing your change before you make it is the best way to smooth the PR process. This will prevent a rejection because someone else is already working on the problem, or because the solution is incompatible with the architectural direction. + +During the PR process, expect that there will be some back-and-forth. Please try to respond to comments in a timely fashion, and if you don't wish to continue with the PR, let us know. If a PR takes too many iterations for its complexity or size, we may reject it. Additionally, if you stop responding we may close the PR as abandoned. In either case, if you feel this was done in error, please add a comment on the PR. + +If we accept the PR, a [maintainer](MAINTAINERS.md) will merge your change and usually take care of backporting it to appropriate branches ourselves. + +If we reject the PR, we will close the pull request with a comment explaining why. This decision isn't always final: if you feel we have misunderstood your intended change or otherwise think that we should reconsider then please continue the conversation with a comment on the PR and we'll do our best to address any further points you raise. diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/DEVELOPER_GUIDE.md b/vendor/github.com/opensearch-project/opensearch-go/v3/DEVELOPER_GUIDE.md new file mode 100644 index 000000000..d668c9618 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/DEVELOPER_GUIDE.md @@ -0,0 +1,147 @@ +- [Developer Guide](#developer-guide) + - [Getting Started](#getting-started) + - [Git Clone OpenSearch Go Client Repository](#git-clone-opensearch-go-client-repository) + - [Install Prerequisites](#install-prerequisites) + - [Go 1.20](#go-120) + - [Docker](#docker) + - [Windows](#windows) + - [Unit Testing](#unit-testing) + - [Integration Testing](#integration-testing) + - [Composing an OpenSearch Docker Container](#composing-an-opensearch-docker-container) + - [Execute integration tests from your terminal](#execute-integration-tests-from-your-terminal) + - [Lint](#lint) + - [Markdown lint](#markdown-lint) + - [Go lint](#go-lint) + - [Coverage](#coverage) + - [Use an Editor](#use-an-editor) + - [GoLand](#goland) + - [Vim](#vim) + +# Developer Guide + +So you want to contribute code to the OpenSearch Go Client? Excellent! We're glad you're here. Here's what you need to do: + +## Getting Started + +### Git Clone OpenSearch Go Client Repository + +Fork [opensearch-project/opensearch-go](https://github.com/opensearch-project/opensearch-go) and clone locally, e.g. `git clone https://github.com/[your username]/opensearch-go.git`. + +### Install Prerequisites + +#### Go 1.20 + +OpenSearch Go Client builds using [Go](https://go.dev/doc/install) 1.20 at a minimum. + +#### Docker + +[Docker](https://docs.docker.com/get-docker/) is required for building some OpenSearch artifacts and executing integration tests. + +#### Windows + +To build the project on Windows, use [WSL2](https://learn.microsoft.com/en-us/windows/wsl/install), the compatibility layer for running Linux applications. + +Install `make` +``` +sudo apt install make +``` + +### Unit Testing + +Go has a simple tool for running tests, and we simplified it further by creating this make command: + +``` +make test-unit +``` + +Individual unit tests can be run with the following command: + +``` +cd folder-path/to/test; +go test -v -run TestName; +``` + +### Integration Testing + +In order to test opensearch-go client, you need a running OpenSearch cluster. You can use Docker to accomplish this. The [Docker Compose file](.ci/opensearch/docker-compose.yml) supports the ability to run integration tests for the project in local environments. If you have not installed docker-compose, you can install it from this [link](https://docs.docker.com/compose/install/). + +### Composing an OpenSearch Docker Container + +Ensure that Docker is installed on your local machine. You can check by running `docker --version`. Next, navigate to your local opensearch-go repository. Run the following command to build and start the OpenSearch docker container. + +``` +make cluster.build cluster.start +``` + +This command will start the OpenSearch container using the `docker-compose.yaml` configuration file. During the build process, the necessary dependencies and files will be downloaded, which may take some time depending on your internet connection and system resources. + +Once the container is built and running, you can open a web browser and navigate to localhost:9200 to access the OpenSearch docker container. + +In order to differentiate unit tests from integration tests, Go has a built-in mechanism for allowing you to logically separate your tests with [build tags](https://pkg.go.dev/cmd/go#hdr-Build_constraints). The build tag needs to be placed as close to the top of the file as possible, and must have a blank line beneath it. Hence, create all integration tests with build tag 'integration'. + +#### Execute integration tests from your terminal + +1. Run below command to start containers. By default, it will launch latest OpenSearch cluster. + ``` + make cluster.build cluster.start + ``` +2. Run all integration tests. + ``` + make test-integ race=true + ``` +3. Stop and clean containers. + ``` + make cluster.stop cluster.clean + ``` + +## Lint + +To keep all the code in a certain uniform format, it was decided to use some writing rules. If you wrote something wrong, it's okay, you can simply run the script to check the necessary files, and optionally format the content. But keep in mind that all these checks are repeated on the pipeline, so it's better to check locally. + +### Markdown lint + +To check the markdown files, run the following command: + +``` +make lint.markdown +``` + +### Go lint + +To check all go files, run the following command: + +``` +make linters +``` + +## Coverage + +To get the repository test coverage, run the following command: + +For the results to be display in your terminal: + +``` +make coverage +``` + +For the results to be display in your browser: + +``` +make coverage-html +``` + +## Use an Editor + +### GoLand + +You can import the OpenSearch project into GoLand as follows: + +1. Select **File | Open** +2. In the subsequent dialog navigate to the ~/go/src/opensearch-go and click **Open** + +After you have opened your project, you need to specify the location of the Go SDK. You can either specify a local path to the SDK or download it. To set the Go SDK, navigate to **Go | GOROOT** and set accordingly. + +### Vim + +To improve your vim experience with Go, you might want to check out [fatih/vim-go](https://github.com/fatih/vim-go). +For example it correctly formats the file and validates it on save. diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/LICENSE.txt b/vendor/github.com/opensearch-project/opensearch-go/v3/LICENSE.txt new file mode 100644 index 000000000..261eeb9e9 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/LICENSE.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/MAINTAINERS.md b/vendor/github.com/opensearch-project/opensearch-go/v3/MAINTAINERS.md new file mode 100644 index 000000000..e68e93297 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/MAINTAINERS.md @@ -0,0 +1,21 @@ +## Overview + +This document contains a list of maintainers in this repo. See [opensearch-project/.github/RESPONSIBILITIES.md](https://github.com/opensearch-project/.github/blob/main/RESPONSIBILITIES.md#maintainer-responsibilities) that explains what the role of maintainer means, what maintainers do in this and other repos, and how they should be doing it. If you're interested in contributing, and becoming a maintainer, see [CONTRIBUTING](CONTRIBUTING.md). + +## Current Maintainers + +| Maintainer | GitHub ID | Affiliation | +| --- | --- | --- | +| Daniel Doubrovkine | [dblock](https://github.com/dblock) | Amazon | +| Jakob Hahn | [Jakob3xD](https://github.com/Jakob3xD) | Hetzner Online GmbH | +| Vacha Shah | [VachaShah](https://github.com/VachaShah) | Amazon | +| Vijayan Balasubramanian | [VijayanB](https://github.com/VijayanB) | Amazon | + +## Emeritus + +| Maintainer | GitHub ID | Affiliation | +| --- | --- | --- | +| Jack Mazanec | [jmazanec15](https://github.com/jmazanec15) | Amazon | +| Rob Cowart | [robcowart](https://github.com/robcowart) | ElastiFlow | +| Sven Cowart | [svencowart](https://github.com/svencowart) | | +| Vamshi Vijay Nakkirtha | [vamshin](https://github.com/vamshin) | Amazon | diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/Makefile b/vendor/github.com/opensearch-project/opensearch-go/v3/Makefile new file mode 100644 index 000000000..e04d58df8 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/Makefile @@ -0,0 +1,239 @@ +SHELL := /bin/bash + +##@ Format project using goimports tool +format: + goimports -w .; + +##@ Test +test-unit: ## Run unit tests + @printf "\033[2m→ Running unit tests...\033[0m\n" +ifdef race + $(eval testunitargs += "-race") +endif + $(eval testunitargs += "-cover" "./..." "-args" "-test.gocoverdir=$(PWD)/tmp/unit") + @mkdir -p $(PWD)/tmp/unit + @echo "go test -v" $(testunitargs); \ + go test -v $(testunitargs); +ifdef coverage + @go tool covdata textfmt -i=$(PWD)/tmp/unit -o $(PWD)/tmp/unit.cov +endif +test: test-unit + +test-integ: ## Run integration tests + @printf "\033[2m→ Running integration tests...\033[0m\n" + $(eval testintegtags += "integration") +ifdef multinode + $(eval testintegtags += "multinode") +endif +ifdef race + $(eval testintegargs += "-race") +endif + $(eval testintegargs += "-cover" "-tags=$(testintegtags)" "-timeout=1h" "./..." "-args" "-test.gocoverdir=$(PWD)/tmp/integration") + @mkdir -p $(PWD)/tmp/integration + @echo "go test -v" $(testintegargs); \ + go test -v $(testintegargs); +ifdef coverage + @go tool covdata textfmt -i=$(PWD)/tmp/integration -o $(PWD)/tmp/integ.cov +endif + +test-integ-secure: ##Run secure integration tests + @SECURE_INTEGRATION=true make test-integ + +test-bench: ## Run benchmarks + @printf "\033[2m→ Running benchmarks...\033[0m\n" + go test -run=none -bench=. -benchmem ./... + +coverage: ## Print test coverage report + @make gen-coverage + @go tool cover -func=$(PWD)/tmp/total.cov + @printf "\033[0m--------------------------------------------------------------------------------\n\033[0m" + +coverage-html: ## Open test coverage report in browser + @make gen-coverage + @go tool cover -html $(PWD)/tmp/total.cov + +gen-coverage: ## Generate test coverage report + @printf "\033[2m→ Generating test coverage report...\033[0m\n" + @rm -rf tmp + @mkdir tmp + @mkdir tmp/unit + @mkdir tmp/integration + @make test-unit coverage=true + @make test-integ coverage=true + @make build-coverage + +build-coverage: + @go tool covdata textfmt -i=$(PWD)/tmp/unit,$(PWD)/tmp/integration -o $(PWD)/tmp/total.cov + +##@ Development +lint: ## Run lint on the package + @printf "\033[2m→ Running lint...\033[0m\n" + go vet github.com/opensearch-project/opensearch-go/... + go list github.com/opensearch-project/opensearch-go/... | 'grep' -v internal | xargs golint -set_exit_status + +package := "prettier" +lint.markdown: + @printf "\033[2m→ Checking node installed...\033[0m\n" + if type node > /dev/null 2>&1 && which node > /dev/null 2>&1 ; then \ + node -v; \ + echo -e "\033[33m Node is installed, continue...\033[0m\n"; \ + else \ + echo -e "\033[31m Please install node\033[0m\n"; \ + exit 1; \ + fi + @printf "\033[2m→ Checking npm installed...\033[0m\n" + if type npm > /dev/null 2>&1 && which npm > /dev/null 2>&1 ; then \ + npm -v; \ + echo -e "\033[33m NPM is installed, continue...\033[0m\n"; \ + else \ + echo -e "\033[31m Please install npm\033[0m\n"; \ + exit 1; \ + fi + @printf "\033[2m→ Checking $(package) installed...\033[0m\n" + if [ `npm list -g | grep -c $(package)` -eq 0 -o ! -d node_module ]; then \ + echo -e "\033[33m Installing $(package)...\033[0m"; \ + npm install -g $(package) --no-shrinkwrap; \ + fi + @printf "\033[2m→ Running markdown lint...\033[0m\n" + if npx $(package) --prose-wrap never --check **/*.md; [[ $$? -ne 0 ]]; then \ + echo -e "\033[32m→ Found invalid files. Want to auto-format invalid files? (y/n) \033[0m"; \ + read RESP; \ + if [[ $$RESP = "y" || $$RESP = "Y" ]]; then \ + echo -e "\033[33m Formatting...\033[0m"; \ + npx $(package) --prose-wrap never --write **/*.md; \ + echo -e "\033[34m \nAll invalid files are formatted\033[0m"; \ + else \ + echo -e "\033[33m Unfortunately you are cancelled auto fixing. But we will definitely fix it in the pipeline\033[0m"; \ + fi \ + fi + + +backport: ## Backport one or more commits from main into version branches +ifeq ($(origin commits), undefined) + @echo "Missing commit(s), exiting..." + @exit 2 +endif +ifndef branches + $(eval branches_list = '1.x') +else + $(eval branches_list = $(shell echo $(branches) | tr ',' ' ') ) +endif + $(eval commits_list = $(shell echo $(commits) | tr ',' ' ')) + @printf "\033[2m→ Backporting commits [$(commits)]\033[0m\n" + @{ \ + set -e -o pipefail; \ + for commit in $(commits_list); do \ + git show --pretty='%h | %s' --no-patch $$commit; \ + done; \ + echo ""; \ + for branch in $(branches_list); do \ + printf "\033[2m→ $$branch\033[0m\n"; \ + git checkout $$branch; \ + for commit in $(commits_list); do \ + git cherry-pick -x $$commit; \ + done; \ + git status --short --branch; \ + echo ""; \ + done; \ + printf "\033[2m→ Push updates to Github:\033[0m\n"; \ + for branch in $(branches_list); do \ + echo "git push --verbose origin $$branch"; \ + done; \ + } + +release: ## Release a new version to Github + $(eval branch = $(shell git rev-parse --abbrev-ref HEAD)) + $(eval current_version = $(shell cat internal/version/version.go | sed -Ee 's/const Client = "(.*)"/\1/' | tail -1)) + @printf "\033[2m→ [$(branch)] Current version: $(current_version)...\033[0m\n" +ifndef version + @printf "\033[31m[!] Missing version argument, exiting...\033[0m\n" + @exit 2 +endif +ifeq ($(version), "") + @printf "\033[31m[!] Empty version argument, exiting...\033[0m\n" + @exit 2 +endif + @printf "\033[2m→ [$(branch)] Creating version $(version)...\033[0m\n" + @{ \ + set -e -o pipefail; \ + cp internal/version/version.go internal/version/version.go.OLD && \ + cat internal/version/version.go.OLD | sed -e 's/Client = ".*"/Client = "$(version)"/' > internal/version/version.go && \ + go vet internal/version/version.go && \ + go fmt internal/version/version.go && \ + git diff --color-words internal/version/version.go | tail -n 1; \ + } + @{ \ + set -e -o pipefail; \ + printf "\033[2m→ Commit and create Git tag? (y/n): \033[0m\c"; \ + read continue; \ + if [[ $$continue == "y" ]]; then \ + git add internal/version/version.go && \ + git commit --no-status --quiet --message "Release $(version)" && \ + git tag --annotate v$(version) --message 'Release $(version)'; \ + printf "\033[2m→ Push `git show --pretty='%h (%s)' --no-patch HEAD` to Github:\033[0m\n\n"; \ + printf "\033[1m git push origin HEAD && git push origin v$(version)\033[0m\n\n"; \ + mv internal/version/version.go.OLD internal/version/version.go && \ + git add internal/version/version.go && \ + original_version=`cat internal/version/version.go | sed -ne 's;^const Client = "\(.*\)"$$;\1;p'` && \ + git commit --no-status --quiet --message "Update version to $$original_version"; \ + printf "\033[2m→ Version updated to [$$original_version].\033[0m\n\n"; \ + else \ + echo "Aborting..."; \ + rm internal/version/version.go.OLD; \ + exit 1; \ + fi; \ + } + +godoc: ## Display documentation for the package + @printf "\033[2m→ Generating documentation...\033[0m\n" + @echo "* http://localhost:6060/pkg/github.com/opensearch-project/opensearch-go" + @echo "* http://localhost:6060/pkg/github.com/opensearch-project/opensearch-go/opensearchapi" + @echo "* http://localhost:6060/pkg/github.com/opensearch-project/opensearch-go/opensearchtransport" + @echo "* http://localhost:6060/pkg/github.com/opensearch-project/opensearch-go/opensearchutil" + @printf "\n" + godoc --http=localhost:6060 --play + +cluster.build: + docker-compose --project-directory .ci/opensearch build; + +cluster.start: + docker-compose --project-directory .ci/opensearch up -d ; + +cluster.stop: + docker-compose --project-directory .ci/opensearch down ; + + +cluster.clean: ## Remove unused Docker volumes and networks + @printf "\033[2m→ Cleaning up Docker assets...\033[0m\n" + docker volume prune --force + docker network prune --force + docker system prune --volumes --force + +linters: + docker run -t --rm -v $$(pwd):/app -v ~/.cache/golangci-lint/v1.54.2:/root/.cache -w /app golangci/golangci-lint:v1.54.2 golangci-lint run --timeout=5m + +workflow: ## Run all github workflow commands here sequentially + +# Lint + make lint +# License Checker + .github/check-license-headers.sh +# Unit Test + make test-unit race=true +# Benchmarks Test + make test-bench +# Integration Test +### OpenSearch + make cluster.clean cluster.build cluster.start + make test-integ race=true + make cluster.stop + +##@ Other +#------------------------------------------------------------------------------ +help: ## Display help + @awk 'BEGIN {FS = ":.*##"; printf "Usage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) +#------------- -------------- + +.DEFAULT_GOAL := help +.PHONY: help backport cluster cluster.clean coverage godoc lint release test test-bench test-integ test-unit linters linters.install +.SILENT: lint.markdown diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/NOTICE.txt b/vendor/github.com/opensearch-project/opensearch-go/v3/NOTICE.txt new file mode 100644 index 000000000..eec263f0c --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/NOTICE.txt @@ -0,0 +1,8 @@ +OpenSearch (https://opensearch.org/) +Copyright 2021 OpenSearch Contributors + +This product includes software developed by +Elasticsearch (http://www.elastic.co). + +This product includes software developed by The Apache Software +Foundation (http://www.apache.org/). \ No newline at end of file diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/OpenSearch.svg b/vendor/github.com/opensearch-project/opensearch-go/v3/OpenSearch.svg new file mode 100644 index 000000000..bd4ae0fe8 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/OpenSearch.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/README.md b/vendor/github.com/opensearch-project/opensearch-go/v3/README.md new file mode 100644 index 000000000..a8fdc8124 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/README.md @@ -0,0 +1,42 @@ +[![Go Reference](https://pkg.go.dev/badge/github.com/opensearch-project/opensearch-go.svg)](https://pkg.go.dev/github.com/opensearch-project/opensearch-go/v3) [![Build](https://github.com/opensearch-project/opensearch-go/actions/workflows/lint.yml/badge.svg)](https://github.com/opensearch-project/opensearch-go/actions/workflows/lint.yml) [![Unit](https://github.com/opensearch-project/opensearch-go/actions/workflows/test-unit.yml/badge.svg)](https://github.com/opensearch-project/opensearch-go/actions/workflows/test-unit.yml) [![Integration](https://github.com/opensearch-project/opensearch-go/actions/workflows/test-integration.yml/badge.svg)](https://github.com/opensearch-project/opensearch-go/actions/workflows/test-integration.yml) [![codecov](https://codecov.io/gh/opensearch-project/opensearch-go/branch/main/graph/badge.svg?token=MI9g3KYHVx)](https://codecov.io/gh/opensearch-project/opensearch-go) [![Chat](https://img.shields.io/badge/chat-on%20forums-blue)](https://discuss.opendistrocommunity.dev/c/clients/) ![PRs welcome!](https://img.shields.io/badge/PRs-welcome!-success) + +![OpenSearch logo](OpenSearch.svg) + +OpenSearch Go Client + +- [Welcome!](#welcome) +- [Project Resources](#project-resources) +- [Code of Conduct](#code-of-conduct) +- [License](#license) +- [Copyright](#copyright) + +## Welcome! + +**opensearch-go** is [a community-driven, open source fork](https://aws.amazon.com/blogs/opensource/introducing-opensearch/) of go-elasticsearch licensed under the [Apache v2.0 License](LICENSE.txt). For more information, see [opensearch.org](https://opensearch.org/). + +## Project Resources + +- [Project Website](https://opensearch.org/) +- [Developer Guide](DEVELOPER_GUIDE.md) +- [User Guide](USER_GUIDE.md) +- [Documentation](https://opensearch.org/docs/latest/clients/go/) +- [API Documentation](https://pkg.go.dev/github.com/opensearch-project/opensearch-go/v3) +- Need help? Try [Forums](https://discuss.opendistrocommunity.dev/c/clients/) +- [Project Principles](https://opensearch.org/#principles) +- [Contributing to OpenSearch](CONTRIBUTING.md) +- [Maintainer Responsibilities](MAINTAINERS.md) +- [Release Management](RELEASING.md) +- [Admin Responsibilities](ADMINS.md) +- [Security](SECURITY.md) + +## Code of Conduct + +This project has adopted the [Amazon Open Source Code of Conduct](CODE_OF_CONDUCT.md). For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq), or contact [opensource-codeofconduct@amazon.com](mailto:opensource-codeofconduct@amazon.com) with any additional questions or comments. + +## License + +This project is licensed under the [Apache v2.0 License](LICENSE.txt). + +## Copyright + +Copyright OpenSearch Contributors. See [NOTICE](NOTICE.txt) for details. diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/RELEASING.md b/vendor/github.com/opensearch-project/opensearch-go/v3/RELEASING.md new file mode 100644 index 000000000..af97b5478 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/RELEASING.md @@ -0,0 +1,60 @@ +- [Overview](#overview) +- [Branching](#branching) + - [Release Branching](#release-branching) + - [Feature Branches](#feature-branches) +- [Release Labels](#release-labels) +- [Releasing](#releasing) + +## Overview + +This document explains the release strategy for artifacts in this organization. + +## Branching + +### Release Branching + +Given the current major release of 1.0, projects in this organization maintain the following active branches. + +- **main**: The next _major_ release. This is the branch where all merges take place and code moves fast. +- **1.x**: The next _minor_ release. Once a change is merged into `main`, decide whether to backport it to `1.x`. +- **1.0**: The _current_ release. In between minor releases, only hotfixes (e.g. security) are backported to `1.0`. + +Label PRs with the next major version label (e.g. `2.0.0`) and merge changes into `main`. Label PRs that you believe need to be backported as `1.x` and `1.0`. Backport PRs by checking out the versioned branch, cherry-pick changes and open a PR against each target backport branch. + +### Feature Branches + +Do not creating branches in the upstream repo, use your fork, for the exception of long lasting feature branches that require active collaboration from multiple developers. Name feature branches `feature/`. Once the work is merged to `main`, please make sure to delete the feature branch. + +## Release Labels + +Repositories create consistent release labels, such as `v1.0.0`, `v1.1.0` and `v2.0.0`, as well as `patch` and `backport`. Use release labels to target an issue or a PR for a given release. See [MAINTAINERS](MAINTAINERS.md#triage-open-issues) for more information on triaging issues. + +## Releasing + +The release process is standard across repositories in this org and is run by a release manager volunteering from amongst [MAINTAINERS](MAINTAINERS.md). + +1. Ensure that the version in [version.go](internal/version/version.go) is correct for the next release. +2. For major version releases, ensure that all references are up-to-date, e.g. `github.com/opensearch-project/opensearch-go/v3`, see [opensearch-go#444](https://github.com/opensearch-project/opensearch-go/pull/444). +3. Edit the [CHANGELOG](CHANGELOG.md) and replace the `Unreleased` section with the version about to be released. +4. Add a comparison link to the new version at the bottom of the [CHANGELOG](CHANGELOG.md). +5. Create a pull request with the changes into `main`, e.g. [opensearch-go#443](https://github.com/opensearch-project/opensearch-go/pull/443). +6. Create a tag, e.g. `v3.0.1`, and push it to the GitHub repo. This [makes the new version available](https://go.dev/doc/modules/publishing) on [pkg.go.dev](https://pkg.go.dev/github.com/opensearch-project/opensearch-go). +7. Draft and publish a [new GitHub release](https://github.com/opensearch-project/opensearch-go/releases/new) from the newly created tag. +8. Create a new `Unreleased` section in the [CHANGELOG](CHANGELOG.md), increment version in [version.go](internal/version/version.go) to the next developer iteration (e.g. `3.0.2`), and make a pull request with this change into `main`, e.g. [opensearch-go#448](https://github.com/opensearch-project/opensearch-go/pull/448). + ``` + ## [Unreleased] + + ### Added + + ### Changed + + ### Deprecated + + ### Removed + + ### Fixed + + ### Security + + ### Dependencies + ``` \ No newline at end of file diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/SECURITY.md b/vendor/github.com/opensearch-project/opensearch-go/v3/SECURITY.md new file mode 100644 index 000000000..b862921043 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/SECURITY.md @@ -0,0 +1,3 @@ +## Reporting a Vulnerability + +If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/) or directly via email to aws-security@amazon.com. Please do **not** create a public GitHub issue. diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/UPGRADING.md b/vendor/github.com/opensearch-project/opensearch-go/v3/UPGRADING.md new file mode 100644 index 000000000..c80a6f014 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/UPGRADING.md @@ -0,0 +1,246 @@ +- [Upgrading Opensearch GO Client](#upgrading-opensearch-go-client) + - [Upgraading to >= 3.0.0](#upgrading-to->=-3.0.0) + - [client creation](#client-creation) + - [requests](#requests) + - [responses](#responses) + - [error handing](#error-handling) + - [Upgraading to >= 2.3.0](#upgrading-to->=-2.3.0) + - [snapshot delete](#snapshot-delete) + +# Upgrading Opensearch GO Client + +## Upgrading to >= 3.0.0 + +Version 3.0.0 is a major refactor of the client. + +### Client Creation +You now create the client from the opensearchapi and not from the opensearch lib. This was done to make the different APIs independent from each other. Plugin APIs like Security will get there own folder and therefore its own sub-lib. + +Before 3.0.0: +```go +// default client +client, err := opensearch.NewDefaultClient() + +// with config +client, err := opensearch.NewClient( + opensearch.Config{ + Transport: &http.Transport{ + TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, + }, + Addresses: []string{"https://localhost:9200"}, + Username: "admin", + Password: "admin", + }, +) +``` + +With 3.0.0: + +```go +// default client +client, err := opensearchapi.NewDefaultClient() + +// with config +client, err := opensearchapi.NewClient( + opensearchapi.Config{ + Client: opensearch.Config{ + Transport: &http.Transport{ + TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, // For testing only. Use certificate for validation. + }, + Addresses: []string{"https://localhost:9200"}, + Username: "admin", // For testing only. Don't store credentials in code. + Password: "admin", + }, + }, +) +``` + +### Requests + +Prior version 3.0.0 there were two options on how to perform requests. You could either use the request struct of the wished function and execute it with the client .Do() function or use the client function and add wanted args with so called With() functions. With the new version you now use functions attached to the client and give a context and the wanted request body as argument. + +Before 3.0.0: + +```go +// using the client function and adding args by using the With() functions +createIndex, err := client.Indices.Create( + "some-index", + client.Indices.Create.WithContext(ctx), + client.Indices.Create.WithBody(strings.NewReader(`{"settings":{"index":{"number_of_shards":4}}}`)), +) + +// using the request struct +createIndex := opensearchapi.IndicesCreateRequest{ + Index: "some-index", + Body: strings.NewReader(`{"settings":{"index":{"number_of_shards":4}}}`), +} +createIndexResponse, err := createIndex.Do(ctx, client) +``` + +With 3.0.0: + +```go +createIndexResponse, err := client.Indices.Create( + ctx, + opensearchapi.IndicesCreateReq{ + Index: "some-index", + Body: strings.NewReader(`{"settings":{"index":{"number_of_shards":4}}}`), + }, +) +``` + + +### Responses + +With the version 3.0.0 the lib no longer returns the opensearch.Response which is just a wrap up http.Response. Instead it will check the response for errors and try to parse the body into existing structs. Please note that some responses are so complex that we parse them as [json.RawMessage](https://pkg.go.dev/encoding/json#RawMessage) so you can parse them to your expected struct. If you need the opensearch.Response, then you can call .Inspect(). + +Before 3.0.0: + +```go +// Create the request +createIndex := opensearchapi.IndicesCreateRequest{ + Index: "some-index", + Body: strings.NewReader(`{"settings":{"index":{"number_of_shards":4}}}`), +} +// Execute the requests +resp, err := createIndex.Do(ctx, client) +if err != nil { + return err +} +// Close the body +defer resp.Body.Close() + +// Check if the status code is >299 +if resp.IsError() { + return fmt.Errorf("Opensearch Returned an error: %#v", resp) +} + +// Create a struct that represents the create index response +createResp := struct { + Acknowledged bool `json:"acknowledged"` + ShardsAcknowledged bool `json:"shards_acknowledged"` + Index string `json:"index"` +} + +// Try to parse the response into the created struct +if err := json.NewDecoder(resp.Body).Decode(&createResp); err != nil { + return fmt.Errorf("Undexpected response body: %s, %#v, %s"resp.StatusCode, resp.Body, err) +} +// Print the created index name +fmt.Println(createResp.Index) +``` + +With 3.0.0: + +```go +// Create and execute the requests +createResp, err := client.Indices.Create( + ctx, + opensearchapi.IndicesCreateReq{ + Index: "some-index", + Body: strings.NewReader(`{"settings":{"index":{"number_of_shards":4}}}`), + }, +) +if err != nil { + return err +} +// Print the created index name +fmt.Println(createResp.Index) + +// To get the opensearch.Response/http.Response +rawResp := createResp.Inspect().Response +``` + +### Error Handling + +With opensearch-go >= 3.0.0 opensearchapi responses are now checked for errors. Checking for errors twice is no longer needed. + +Prior versions only returned an error if the request failed to execute. For example if the client can't reach the server or the TLS handshake failed. With opensearch-go >= 3.0.0 each opensearchapi requests will return an error if the response http status code is > 299. The error can be parsed into the new `opensearchapi.Error` type by using `errors.As` to match for exceptions and get a more detailed view. + +Before 3.0.0: + +```go +// Create the request +createIndex := opensearchapi.IndicesCreateRequest{ + Index: "some-index", + Body: strings.NewReader(`{"settings":{"index":{"number_of_shards":4}}}`), +} + +// Execute the requests +resp, err := createIndex.Do(ctx, client) +if err != nil { + return err +} +// Close the body +defer resp.Body.Close() + +// Check if the status code is >299 +if createIndexResp.IsError() { + fmt.Errorf("Opensearch returned an error. Status: %d", createIndexResp.StatusCode) +} +``` + +With 3.0.0: + +```go +var opensearchError opensearchapi.Error +// Create and execute the requests +createResp, err := client.Indices.Create( + ctx, + opensearchapi.IndicesCreateReq{ + Index: "some-index", + Body: strings.NewReader(`{"settings":{"index":{"number_of_shards":4}}}`), + }, +) +// Load err into opensearchapi.Error to access the fields and tolerate if the index already exists +if err != nil { + if errors.As(err, &opensearchError) { + if opensearchError.Err.Type != "resource_already_exists_exception" { + return err + } + } else { + return err + } +} +``` + +## Upgrading to >= 2.3.0 + +### Snapshot Delete + +`SnapshotDeleteRequest` and `SnapshotDelete` changed the argument `Snapshot` type from `string` to `[]string`. + +Before 2.3.0: + +```go +// If you have a string containing your snapshot +stringSnapshotsToDelete := "snapshot-1,snapshot-2" +reqSnapshots := &opensearchapi.SnapshotDeleteRequest{ + Repository: repo, + Snapshot: stringSnapshotsToDelete, +} + +// If you have a slice of strings containing your snapshot +sliceSnapshotToDelete := []string{"snapshot-1","snapshot-2"} +reqSnapshots := &opensearchapi.SnapshotDeleteRequest{ + Repository: repo, + Snapshot: strings.Join(sliceSnapshotsToDelete, ","), +} +``` + +With 2.3.0: + +```go +// If you have a string containing your snapshots +stringSnapshotsToDelete := strings.Split("snapshot-1,snapshot-2", ",") +reqSnapshots := &opensearchapi.SnapshotDeleteRequest{ + Repository: repo, + Snapshot: stringSnapshotsToDelete, +} + +// If you have a slice of strings containing your snapshots +sliceSnapshotToDelete := []string{"snapshot-1", "snapshot-2"} +reqSnapshots := &opensearchapi.SnapshotDeleteRequest{ + Repository: repo, + Snapshot: sliceSnapshotsToDelete, +``` diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/USER_GUIDE.md b/vendor/github.com/opensearch-project/opensearch-go/v3/USER_GUIDE.md new file mode 100644 index 000000000..59d033de1 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/USER_GUIDE.md @@ -0,0 +1,390 @@ +- [User Guide](#user-guide) + - [Example](#example) + - [Amazon OpenSearch Service](#amazon-opensearch-service) + - [AWS SDK v1](#aws-sdk-v1) + - [AWS SDK v2](#aws-sdk-v2) + - [Guides by Topic](#guides-by-topic) + +# User Guide + +## Example + +In the example below, we create a client, an index with non-default settings, insert a document to the index, search for the document, delete the document and finally delete the index. + +```go +package main + +import ( + "context" + "crypto/tls" + "errors" + "fmt" + "net/http" + "os" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" + "github.com/opensearch-project/opensearch-go/v3/opensearchapi" + "github.com/opensearch-project/opensearch-go/v3/opensearchutil" +) + +const IndexName = "go-test-index1" + +func main() { + if err := example(); err != nil { + fmt.Println(fmt.Sprintf("Error: %s", err)) + os.Exit(1) + } +} + +func example() error { + // Initialize the client with SSL/TLS enabled. + client, err := opensearchapi.NewClient( + opensearchapi.Config{ + Client: opensearch.Config{ + Transport: &http.Transport{ + TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, // For testing only. Use certificate for validation. + }, + Addresses: []string{"https://localhost:9200"}, + Username: "admin", // For testing only. Don't store credentials in code. + Password: "admin", + }, + }, + ) + if err != nil { + return err + } + + ctx := context.Background() + // Print OpenSearch version information on console. + infoResp, err := client.Info(ctx, nil) + if err != nil { + return err + } + fmt.Printf("Cluster INFO:\n Cluster Name: %s\n Cluster UUID: %s\n Version Number: %s\n", infoResp.ClusterName, infoResp.ClusterUUID, infoResp.Version.Number) + + // Define index mapping. + // Note: these particular settings (eg, shards/replicas) + // will have no effect in AWS OpenSearch Serverless + mapping := strings.NewReader(`{ + "settings": { + "index": { + "number_of_shards": 4 + } + } + }`) + + // Create an index with non-default settings. + var opensearchError opensearchapi.Error + createIndexResponse, err := client.Indices.Create( + ctx, + opensearchapi.IndicesCreateReq{ + Index: IndexName, + Body: mapping, + }, + ) + // Load err into opensearchapi.Error to access the fields and tolerate if the index already exists + if err != nil { + if errors.As(err, &opensearchError) { + if opensearchError.Err.Type != "resource_already_exists_exception" { + return err + } + } else { + return err + } + } + fmt.Printf("Created Index: %s\n Shards Acknowledged: %t\n", createIndexResponse.Index, createIndexResponse.ShardsAcknowledged) + + // When using a structure, the conversion process to io.Reader can be omitted using utility functions. + document := struct { + Title string `json:"title"` + Director string `json:"director"` + Year string `json:"year"` + }{ + Title: "Moneyball", + Director: "Bennett Miller", + Year: "2011", + } + + docId := "1" + insertResp, err := client.Index( + ctx, + opensearchapi.IndexReq{ + Index: IndexName, + DocumentID: docId, + Body: opensearchutil.NewJSONReader(&document), + } + ) + if err != nil { + return err + } + fmt.Printf("Created document in %s\n ID: %s\n", insertResp.Index, insertResp.ID) + + // Search for the document. + content := strings.NewReader(`{ + "size": 5, + "query": { + "multi_match": { + "query": "miller", + "fields": ["title^2", "director"] + } + } + }`) + + searchResp, err := client.Search( + ctx, + &opensearchapi.SearchReq{ + Body: content, + } + ) + if err != nil { + return err + } + if searchResp.Hits.Total.Value > 0 { + indices := make([]string, 0) + for _, hit := range searchResp.Hits.Hits { + add := true + for _, index := range indices { + if index == hit.Index { + add = false + } + } + if add { + indices = append(indices, hit.Index) + } + } + fmt.Printf("Search indices: %s\n", strings.Join(indices, ",")) + } + + /* + // Delete the document. + deleteReq := opensearchapi.DeleteReq{ + Index: IndexName, + DocumentID: docId, + } + + deleteResponse, err := client.Indices.Delete(ctx, deleteReq) + if err != nil { + return err + } + fmt.Println("deleting document") + fmt.Println(deleteResponse) + */ + // Delete previously created index. + + deleteIndexResp, err := client.Indices.Delete(ctx, opensearchapi.IndicesDeleteReq{Index: []string{IndexName}}) + if err != nil { + return err + } + fmt.Println(fmt.Sprintf("Deleted index: %t", deleteIndexResp.Acknowledged)) + + // Try to delete the index again which failes as it does not exist + // Load err into opensearchapi.Error to access the fields and tolerate if the index is missing + _, err = client.Indices.Delete(ctx, deleteIndex) + if err != nil { + if errors.As(err, &opensearchError) { + if opensearchError.Err.Type != "index_not_found_exception" { + return nil + } + } else { + return err + } + } + return nil +} +``` + +## Amazon OpenSearch Service + +Before starting, we strongly recommend reading the full AWS documentation regarding using IAM credentials to sign requests to OpenSearch APIs. See [Identity and Access Management in Amazon OpenSearch Service.](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/ac.html) + +> Even if you configure a completely open resource-based access policy, all requests to the OpenSearch Service configuration API must be signed. If your policies specify IAM users or roles, requests to the OpenSearch APIs also must be signed using AWS Signature Version 4. +> +> See [Managed Domains signing-service requests.](https://docs.aws.amazon.com/opensearch-service/latest/developerguide/ac.html#managedomains-signing-service-requests) + +Depending on the version of AWS SDK used, import the v1 or v2 request signer from `signer/aws` or `signer/awsv2` respectively. Both signers are equivalent in their functionality, they provide AWS Signature Version 4 (SigV4). + +To read more about SigV4 see [Signature Version 4 signing process](https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html) + +Here are some Go samples that show how to sign each OpenSearch request and automatically search for AWS credentials from the ~/.aws folder or environment variables: + +### AWS SDK v1 + +```go +package main + +import ( + "context" + "fmt" + "os" + + "github.com/aws/aws-sdk-go/aws/session" + requestsigner "github.com/opensearch-project/opensearch-go/v3/signer/aws" + + "github.com/opensearch-project/opensearch-go/v3" + "github.com/opensearch-project/opensearch-go/v3/opensearchapi" +) + +const IndexName = "go-test-index1" + +func main() { + if err := example(); err != nil { + fmt.Println(fmt.Sprintf("Error: %s", err)) + os.Exit(1) + } +} + +const endpoint = "" // e.g. https://opensearch-domain.region.com + +func example() error { + // Create an AWS request Signer and load AWS configuration using default config folder or env vars. + // See https://docs.aws.amazon.com/opensearch-service/latest/developerguide/request-signing.html#request-signing-go + signer, err := requestsigner.NewSignerWithService( + session.Options{SharedConfigState: session.SharedConfigEnable}, + requestsigner.OpenSearchService, // Use requestsigner.OpenSearchServerless for Amazon OpenSearch Serverless. + ) + if err != nil { + return err + } + // Create an opensearch client and use the request-signer. + client, err := opensearchapi.NewClient( + opensearchapi.Config{ + Client: opensearch.Config{ + Addresses: []string{endpoint}, + Signer: signer, + }, + }, + ) + if err != nil { + return err + } + + ctx := context.Background() + + ping, err := client.Ping(ctx, nil) + if err != nil { + return err + } + + fmt.Println(ping) + + return nil +} +``` + +### AWS SDK v2 + +Use the AWS SDK v2 for Go to authenticate with Amazon OpenSearch service. + +```go +package main + +import ( + "context" + "fmt" + "os" + "strings" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/config" + + "github.com/opensearch-project/opensearch-go/v3" + "github.com/opensearch-project/opensearch-go/v3/opensearchapi" + requestsigner "github.com/opensearch-project/opensearch-go/v3/signer/awsv2" +) + +const endpoint = "" // e.g. https://opensearch-domain.region.com or Amazon OpenSearch Serverless endpoint + +func main() { + if err := example(); err != nil { + fmt.Println(fmt.Sprintf("Error: %s", err)) + os.Exit(1) + } +} +func example() error { + ctx := context.Background() + + awsCfg, err := config.LoadDefaultConfig(ctx, + config.WithRegion(""), + config.WithCredentialsProvider( + getCredentialProvider("", "", ""), + ), + ) + if err != nil { + return err + } + + // Create an AWS request Signer and load AWS configuration using default config folder or env vars. + signer, err := requestsigner.NewSignerWithService(awsCfg, "es") // Use "aoss" for Amazon OpenSearch Serverless + if err != nil { + return err + } + + // Create an opensearch client and use the request-signer. + client, err := opensearchapi.NewClient( + opensearchapi.Config{ + Client: opensearch.Config{ + Addresses: []string{endpoint}, + Signer: signer, + }, + }, + ) + if err != nil { + return err + } + + indexName := "go-test-index" + + // Define index mapping. + mapping := strings.NewReader(`{ + "settings": { + "index": { + "number_of_shards": 4 + } + } + }`) + + // Create an index with non-default settings. + createResp, err := client.Indices.Create( + ctx, + opensearchapi.IndicesCreateReq{ + Index: indexName, + Body: mapping, + }, + ) + if err != nil { + return err + } + + fmt.Println("created index: %s", createResp.Index) + + delResp, err := client.Indices.Delete(ctx, opensearchapi.IndicesDeleteReq{Indices: []string{indexName}}) + if err != nil { + return err + } + + fmt.Println("deleted index: %#v", delResp.Acknowledged) + return nil +} + +func getCredentialProvider(accessKey, secretAccessKey, token string) aws.CredentialsProviderFunc { + return func(ctx context.Context) (aws.Credentials, error) { + c := &aws.Credentials{ + AccessKeyID: accessKey, + SecretAccessKey: secretAccessKey, + SessionToken: token, + } + return *c, nil + } +} +``` + +## Guides by Topic + +- [Index Lifecycle](guides/index_lifecycle.md) +- [Document Lifecycle](guides/document_lifecycle.md) +- [Search](guides/search.md) +- [Bulk](guides/bulk.md) +- [Advanced Index Actions](guides/advanced_index_actions.md) +- [Index Templates](guides/index_template.md) +- [Data Streams](guides/data_streams.md) diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/doc.go b/vendor/github.com/opensearch-project/opensearch-go/v3/doc.go new file mode 100644 index 000000000..b2bfd6398 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/doc.go @@ -0,0 +1,74 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to opensearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/* +Package opensearch provides a Go client for OpenSearch. + +Create the client with the NewDefaultClient function: + + opensearch.NewDefaultClient() + +The OPENSEARCH_URL/ELASTICSEARCH_URL environment variable is used instead of the default URL, when set. +Use a comma to separate multiple URLs. +It is an error to set both environment variable. + +To configure the client, pass a Config object to the NewClient function: + + cfg := opensearch.Config{ + Addresses: []string{ + "http://localhost:9200", + "http://localhost:9201", + }, + Username: "foo", + Password: "bar", + Transport: &http.Transport{ + MaxIdleConnsPerHost: 10, + ResponseHeaderTimeout: time.Second, + DialContext: (&net.Dialer{Timeout: time.Second}).DialContext, + TLSClientConfig: &tls.Config{ + MinVersion: tls.VersionTLS11, + }, + }, + } + + opensearch.NewClient(cfg) + +See the opensearch_integration_test.go file for more information. + +Call the OpenSearch APIs by invoking the corresponding methods on the client: + + res, err := client.Info() + if err != nil { + log.Fatalf("Error getting response: %s", err) + } + + log.Println(res) + +See the github.com/opensearch-project/opensearch-go/opensearchapi package for more information about using the API. + +See the github.com/opensearch-project/opensearch-go/opensearchtransport package for more information about configuring the transport. +*/ +package opensearch diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/internal/version/version.go b/vendor/github.com/opensearch-project/opensearch-go/v3/internal/version/version.go new file mode 100644 index 000000000..64c3a30f9 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/internal/version/version.go @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package version + +// Client returns the client version as a string. +const Client = "3.1.0" diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearch.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearch.go new file mode 100644 index 000000000..c99052530 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearch.go @@ -0,0 +1,359 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearch + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "os" + "regexp" + "strconv" + "strings" + "time" + + "github.com/opensearch-project/opensearch-go/v3/internal/version" + "github.com/opensearch-project/opensearch-go/v3/opensearchtransport" + "github.com/opensearch-project/opensearch-go/v3/signer" +) + +const ( + defaultURL = "http://localhost:9200" + openSearch = "opensearch" + unsupportedProduct = "the client noticed that the server is not a supported distribution" + envOpenSearchURL = "OPENSEARCH_URL" +) + +// Version returns the package version as a string. +const Version = version.Client + +// SupportedElasticVersion defines the supported major elasticsearch version +const SupportedElasticVersion = 7 + +// Error vars +var ( + ErrCreateClient = errors.New("cannot create client") + ErrCreateTransport = errors.New("error creating transport") + ErrParseVersion = errors.New("failed to parse opensearch version") + ErrParseURL = errors.New("cannot parse url") + ErrTransportMissingMethodMetrics = errors.New("transport is missing method Metrics()") + ErrTransportMissingMethodDiscoverNodes = errors.New("transport is missing method DiscoverNodes()") +) + +// Config represents the client configuration. +type Config struct { + Addresses []string // A list of nodes to use. + Username string // Username for HTTP Basic Authentication. + Password string // Password for HTTP Basic Authentication. + + Header http.Header // Global HTTP request header. + + Signer signer.Signer + + // PEM-encoded certificate authorities. + // When set, an empty certificate pool will be created, and the certificates will be appended to it. + // The option is only valid when the transport is not specified, or when it's http.Transport. + CACert []byte + + RetryOnStatus []int // List of status codes for retry. Default: 502, 503, 504. + DisableRetry bool // Default: false. + EnableRetryOnTimeout bool // Default: false. + MaxRetries int // Default: 3. + + CompressRequestBody bool // Default: false. + + DiscoverNodesOnStart bool // Discover nodes when initializing the client. Default: false. + DiscoverNodesInterval time.Duration // Discover nodes periodically. Default: disabled. + + EnableMetrics bool // Enable the metrics collection. + EnableDebugLogger bool // Enable the debug logging. + + RetryBackoff func(attempt int) time.Duration // Optional backoff duration. Default: nil. + + Transport http.RoundTripper // The HTTP transport object. + Logger opensearchtransport.Logger // The logger object. + Selector opensearchtransport.Selector // The selector object. + + // Optional constructor function for a custom ConnectionPool. Default: nil. + ConnectionPoolFunc func([]*opensearchtransport.Connection, opensearchtransport.Selector) opensearchtransport.ConnectionPool +} + +// Client represents the OpenSearch client. +type Client struct { + Transport opensearchtransport.Interface +} + +type esVersion struct { + Number string `json:"number"` + BuildFlavor string `json:"build_flavor"` + Distribution string `json:"distribution"` +} + +type info struct { + Version esVersion `json:"version"` + Tagline string `json:"tagline"` +} + +// NewDefaultClient creates a new client with default options. +// +// It will use http://localhost:9200 as the default address. +// +// It will use the OPENSEARCH_URL/ELASTICSEARCH_URL environment variable, if set, +// to configure the addresses; use a comma to separate multiple URLs. +// +// It's an error to set both OPENSEARCH_URL and ELASTICSEARCH_URL. +func NewDefaultClient() (*Client, error) { + return NewClient(Config{}) +} + +// NewClient creates a new client with configuration from cfg. +// +// It will use http://localhost:9200 as the default address. +// +// It will use the OPENSEARCH_URL/ELASTICSEARCH_URL environment variable, if set, +// to configure the addresses; use a comma to separate multiple URLs. +// +// It's an error to set both OPENSEARCH_URL and ELASTICSEARCH_URL. +func NewClient(cfg Config) (*Client, error) { + var addrs []string + + if len(cfg.Addresses) == 0 { + envAddress := getAddressFromEnvironment() + addrs = envAddress + } else { + addrs = append(addrs, cfg.Addresses...) + } + + urls, err := addrsToURLs(addrs) + if err != nil { + return nil, fmt.Errorf("%w: %w", ErrCreateClient, err) + } + + if len(urls) == 0 { + //nolint:errcheck // errcheck exclude ??? + u, _ := url.Parse(defaultURL) + urls = append(urls, u) + } + + // TODO: Refactor + if urls[0].User != nil { + cfg.Username = urls[0].User.Username() + pw, _ := urls[0].User.Password() + cfg.Password = pw + } + + tp, err := opensearchtransport.New(opensearchtransport.Config{ + URLs: urls, + Username: cfg.Username, + Password: cfg.Password, + + Header: cfg.Header, + CACert: cfg.CACert, + + Signer: cfg.Signer, + + RetryOnStatus: cfg.RetryOnStatus, + DisableRetry: cfg.DisableRetry, + EnableRetryOnTimeout: cfg.EnableRetryOnTimeout, + MaxRetries: cfg.MaxRetries, + RetryBackoff: cfg.RetryBackoff, + + CompressRequestBody: cfg.CompressRequestBody, + + EnableMetrics: cfg.EnableMetrics, + EnableDebugLogger: cfg.EnableDebugLogger, + + DiscoverNodesInterval: cfg.DiscoverNodesInterval, + + Transport: cfg.Transport, + Logger: cfg.Logger, + Selector: cfg.Selector, + ConnectionPoolFunc: cfg.ConnectionPoolFunc, + }) + if err != nil { + return nil, fmt.Errorf("%w: %w", ErrCreateTransport, err) + } + + client := &Client{Transport: tp} + + if cfg.DiscoverNodesOnStart { + //nolint:errcheck // goroutine discards return values + go client.DiscoverNodes() + } + + return client, err +} + +func getAddressFromEnvironment() []string { + return addrsFromEnvironment(envOpenSearchURL) +} + +// checkCompatibleInfo validates the information given by OpenSearch +func checkCompatibleInfo(info info) error { + major, _, _, err := ParseVersion(info.Version.Number) + if err != nil { + return err + } + + if info.Version.Distribution == openSearch { + return nil + } + + if major != SupportedElasticVersion { + return errors.New(unsupportedProduct) + } + + return nil +} + +// ParseVersion returns an int64 representation of version. +func ParseVersion(version string) (int64, int64, int64, error) { + reVersion := regexp.MustCompile(`^([0-9]+)\.([0-9]+)\.([0-9]+)`) + matches := reVersion.FindStringSubmatch(version) + //nolint:gomnd // 4 is the minium regexp match length + if len(matches) < 4 { + return 0, 0, 0, fmt.Errorf("%w: regexp does not match on version string", ErrParseVersion) + } + + major, err := strconv.ParseInt(matches[1], 10, 0) + if err != nil { + return 0, 0, 0, fmt.Errorf("%w: %w", ErrParseVersion, err) + } + + minor, err := strconv.ParseInt(matches[2], 10, 0) + if err != nil { + return 0, 0, 0, fmt.Errorf("%w: %w", ErrParseVersion, err) + } + + patch, err := strconv.ParseInt(matches[3], 10, 0) + if err != nil { + return 0, 0, 0, fmt.Errorf("%w: %w", ErrParseVersion, err) + } + + return major, minor, patch, nil +} + +// Perform delegates to Transport to execute a request and return a response. +func (c *Client) Perform(req *http.Request) (*http.Response, error) { + // Perform the original request. + return c.Transport.Perform(req) +} + +// Do gets and performs the request. It also tries to parse the response into the dataPointer +func (c *Client) Do(ctx context.Context, req Request, dataPointer interface{}) (*Response, error) { + httpReq, err := req.GetRequest() + if err != nil { + return nil, err + } + + if ctx != nil { + httpReq = httpReq.WithContext(ctx) + } + + //nolint:bodyclose // body got already closed by Perform, this is a nopcloser + resp, err := c.Perform(httpReq) + if err != nil { + return nil, err + } + + response := &Response{ + StatusCode: resp.StatusCode, + Body: resp.Body, + Header: resp.Header, + } + + if dataPointer != nil && resp.Body != nil && !response.IsError() { + data, err := io.ReadAll(resp.Body) + if err != nil { + return response, fmt.Errorf("failed to read the response body, status: %d, err: %w", resp.StatusCode, err) + } + + response.Body = io.NopCloser(bytes.NewReader(data)) + + if err := json.Unmarshal(data, dataPointer); err != nil { + return response, fmt.Errorf("failed to parse body into the pointer, status: %d, body: %s, err: %w", resp.StatusCode, data, err) + } + } + + return response, nil +} + +// Metrics returns the client metrics. +func (c *Client) Metrics() (opensearchtransport.Metrics, error) { + if mt, ok := c.Transport.(opensearchtransport.Measurable); ok { + return mt.Metrics() + } + + return opensearchtransport.Metrics{}, ErrTransportMissingMethodMetrics +} + +// DiscoverNodes reloads the client connections by fetching information from the cluster. +func (c *Client) DiscoverNodes() error { + if dt, ok := c.Transport.(opensearchtransport.Discoverable); ok { + return dt.DiscoverNodes() + } + + return ErrTransportMissingMethodDiscoverNodes +} + +// addrsFromEnvironment returns a list of addresses by splitting +// the given environment variable with comma, or an empty list. +func addrsFromEnvironment(name string) []string { + var addrs []string + + if envURLs, ok := os.LookupEnv(name); ok && envURLs != "" { + list := strings.Split(envURLs, ",") + addrs = make([]string, len(list)) + + for idx, u := range list { + addrs[idx] = strings.TrimSpace(u) + } + } + + return addrs +} + +// addrsToURLs creates a list of url.URL structures from url list. +func addrsToURLs(addrs []string) ([]*url.URL, error) { + urls := make([]*url.URL, 0) + + for _, addr := range addrs { + u, err := url.Parse(strings.TrimRight(addr, "/")) + if err != nil { + return nil, fmt.Errorf("%w: %w", ErrParseURL, err) + } + + urls = append(urls, u) + } + + return urls, nil +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_aliases-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_aliases-params.go new file mode 100644 index 000000000..4381a3f53 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_aliases-params.go @@ -0,0 +1,70 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import "time" + +// AliasesParams represents possible parameters for the AliasesReq +type AliasesParams struct { + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r AliasesParams) get() map[string]string { + params := make(map[string]string) + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_aliases.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_aliases.go new file mode 100644 index 000000000..8633dcd9d --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_aliases.go @@ -0,0 +1,58 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" + "io" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// Aliases executes an /_aliases request with the required AliasesReq +func (c Client) Aliases(ctx context.Context, req AliasesReq) (*AliasesResp, error) { + var ( + data AliasesResp + err error + ) + if data.response, err = c.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// AliasesReq represents possible options for the / request +type AliasesReq struct { + Body io.Reader + + Header http.Header + Params AliasesParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r AliasesReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "POST", + "/_aliases", + r.Body, + r.Params.get(), + r.Header, + ) +} + +// AliasesResp represents the returned struct of the / response +type AliasesResp struct { + Acknowledged bool `json:"acknowledged"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r AliasesResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_bulk-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_bulk-params.go new file mode 100644 index 000000000..580aa137c --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_bulk-params.go @@ -0,0 +1,113 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" + "time" +) + +// BulkParams represents possible parameters for the BulkReq +type BulkParams struct { + Pipeline string + Refresh string + RequireAlias *bool + Routing string + Source any + SourceExcludes []string + SourceIncludes []string + Timeout time.Duration + WaitForActiveShards string + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r BulkParams) get() map[string]string { + params := make(map[string]string) + + if r.Pipeline != "" { + params["pipeline"] = r.Pipeline + } + + if r.Refresh != "" { + params["refresh"] = r.Refresh + } + + if r.RequireAlias != nil { + params["require_alias"] = strconv.FormatBool(*r.RequireAlias) + } + + if r.Routing != "" { + params["routing"] = r.Routing + } + + switch source := r.Source.(type) { + case bool: + params["_source"] = strconv.FormatBool(source) + case string: + if source != "" { + params["_source"] = source + } + case []string: + if len(source) > 0 { + params["_source"] = strings.Join(source, ",") + } + } + + if len(r.SourceExcludes) > 0 { + params["_source_excludes"] = strings.Join(r.SourceExcludes, ",") + } + + if len(r.SourceIncludes) > 0 { + params["_source_includes"] = strings.Join(r.SourceIncludes, ",") + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.WaitForActiveShards != "" { + params["wait_for_active_shards"] = r.WaitForActiveShards + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_bulk.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_bulk.go new file mode 100644 index 000000000..d1683a57a --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_bulk.go @@ -0,0 +1,109 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" + "io" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// Bulk executes a /_bulk request with the needed BulkReq +func (c Client) Bulk(ctx context.Context, req BulkReq) (*BulkResp, error) { + var ( + data BulkResp + err error + ) + if data.response, err = c.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// BulkReq represents possible options for the /_bulk request +type BulkReq struct { + Index string + Body io.Reader + Header http.Header + Params BulkParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r BulkReq) GetRequest() (*http.Request, error) { + var path strings.Builder + //nolint:gomnd // 7 is the max number of static chars + path.Grow(7 + len(r.Index)) + + if len(r.Index) > 0 { + path.WriteString("/") + path.WriteString(r.Index) + } + + path.WriteString("/_bulk") + + return opensearch.BuildRequest( + "POST", + path.String(), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// BulkResp represents the returned struct of the /_bulk response +type BulkResp struct { + Took int `json:"took"` + Errors bool `json:"errors"` + Items []map[string]BulkRespItem `json:"items"` + response *opensearch.Response +} + +// BulkRespItem represents an item of the BulkResp +type BulkRespItem struct { + Index string `json:"_index"` + ID string `json:"_id"` + Version int `json:"_version"` + Type string `json:"_type"` // Deprecated field + Result string `json:"result"` + Shards struct { + Total int `json:"total"` + Successful int `json:"successful"` + Failed int `json:"failed"` + } `json:"_shards"` + SeqNo int `json:"_seq_no"` + PrimaryTerm int `json:"_primary_term"` + Status int `json:"status"` + Error *struct { + Type string `json:"type"` + Reason string `json:"reason"` + Cause struct { + Type string `json:"type"` + Reason string `json:"reason"` + ScriptStack *[]string `json:"script_stack,omitempty"` + Script *string `json:"script,omitempty"` + Lang *string `json:"lang,omitempty"` + Position *struct { + Offset int `json:"offset"` + Start int `json:"start"` + End int `json:"end"` + } `json:"position,omitempty"` + Cause *struct { + Type string `json:"type"` + Reason string `json:"reason"` + } `json:"caused_by"` + } `json:"caused_by,omitempty"` + } `json:"error,omitempty"` +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r BulkResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-aliases-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-aliases-params.go new file mode 100644 index 000000000..c3bf97ac6 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-aliases-params.go @@ -0,0 +1,85 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" +) + +// CatAliasesParams represents possible parameters for the CatAliasesReq +type CatAliasesParams struct { + ExpandWildcards string + H []string + Local *bool + Sort []string + V *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r CatAliasesParams) get() map[string]string { + params := make(map[string]string) + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if len(r.H) > 0 { + params["h"] = strings.Join(r.H, ",") + } + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if len(r.Sort) > 0 { + params["s"] = strings.Join(r.Sort, ",") + } + + if r.V != nil { + params["v"] = strconv.FormatBool(*r.V) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + params["format"] = "json" + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-aliases.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-aliases.go new file mode 100644 index 000000000..a3ec4ac66 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-aliases.go @@ -0,0 +1,63 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// CatAliasesReq represent possible options for the /_cat/aliases request +type CatAliasesReq struct { + Aliases []string + Header http.Header + Params CatAliasesParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r CatAliasesReq) GetRequest() (*http.Request, error) { + aliases := strings.Join(r.Aliases, ",") + var path strings.Builder + path.Grow(len("/_cat/aliases/") + len(aliases)) + path.WriteString("/_cat/aliases") + if len(r.Aliases) > 0 { + path.WriteString("/") + path.WriteString(aliases) + } + return opensearch.BuildRequest( + "GET", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// CatAliasesResp represents the returned struct of the /_cat/aliases response +type CatAliasesResp struct { + Aliases []CatAliasResp + response *opensearch.Response +} + +// CatAliasResp represents one index of the CatAliasesResp +type CatAliasResp struct { + Alias string `json:"alias"` + Index string `json:"index"` + Filter string `json:"filter"` + RoutingIndex string `json:"routing.index"` + RoutingSearch string `json:"routing.search"` + IsWriteIndex string `json:"is_write_index"` +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r CatAliasesResp) Inspect() Inspect { + return Inspect{ + Response: r.response, + } +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-allocation-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-allocation-params.go new file mode 100644 index 000000000..6ddc428b2 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-allocation-params.go @@ -0,0 +1,101 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" + "time" +) + +// CatAllocationParams represents possible parameters for the CatAllocationReq +type CatAllocationParams struct { + Bytes string + ExpandWildcards string + H []string + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Sort []string + V *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r CatAllocationParams) get() map[string]string { + params := make(map[string]string) + + if r.Bytes != "" { + params["bytes"] = r.Bytes + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if len(r.H) > 0 { + params["h"] = strings.Join(r.H, ",") + } + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if len(r.Sort) > 0 { + params["s"] = strings.Join(r.Sort, ",") + } + + if r.V != nil { + params["v"] = strconv.FormatBool(*r.V) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + params["format"] = "json" + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-allocation.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-allocation.go new file mode 100644 index 000000000..d125635ce --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-allocation.go @@ -0,0 +1,67 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// CatAllocationReq represent possible options for the /_cat/allocation request +type CatAllocationReq struct { + NodeIDs []string + Header http.Header + Params CatAllocationParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r CatAllocationReq) GetRequest() (*http.Request, error) { + nodes := strings.Join(r.NodeIDs, ",") + var path strings.Builder + path.Grow(len("/_cat/allocation/") + len(nodes)) + path.WriteString("/_cat/allocation") + if len(r.NodeIDs) > 0 { + path.WriteString("/") + path.WriteString(nodes) + } + return opensearch.BuildRequest( + "GET", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// CatAllocationsResp represents the returned struct of the /_cat/allocation response +type CatAllocationsResp struct { + Allocations []CatAllocationResp + response *opensearch.Response +} + +// CatAllocationResp represents one index of the CatAllocationResp +type CatAllocationResp struct { + Shards int `json:"shards,string"` + // Pointer of string as the api can returns null for those fileds with Node set to "UNASSIGNED" + DiskIndices *string `json:"disk.indices"` + DiskUsed *string `json:"disk.used"` + DiskAvail *string `json:"disk.avail"` + DiskTotal *string `json:"disk.total"` + DiskPercent *int `json:"disk.percent,string"` + Host *string `json:"host"` + IP *string `json:"ip"` + Node string `json:"node"` +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r CatAllocationsResp) Inspect() Inspect { + return Inspect{ + Response: r.response, + } +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-cluster_manager-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-cluster_manager-params.go new file mode 100644 index 000000000..5324f5e01 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-cluster_manager-params.go @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" + "time" +) + +// CatClusterManagerParams represents possible parameters for the CatClusterManagerReq +type CatClusterManagerParams struct { + H []string + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Sort []string + V *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r CatClusterManagerParams) get() map[string]string { + params := make(map[string]string) + + if len(r.H) > 0 { + params["h"] = strings.Join(r.H, ",") + } + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if len(r.Sort) > 0 { + params["s"] = strings.Join(r.Sort, ",") + } + + if r.V != nil { + params["v"] = strconv.FormatBool(*r.V) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + params["format"] = "json" + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-cluster_manager.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-cluster_manager.go new file mode 100644 index 000000000..6897aa1d1 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-cluster_manager.go @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// CatClusterManagerReq represent possible options for the /_cat/cluster_manager request +type CatClusterManagerReq struct { + Header http.Header + Params CatClusterManagerParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r CatClusterManagerReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "GET", + "/_cat/cluster_manager", + nil, + r.Params.get(), + r.Header, + ) +} + +// CatClusterManagersResp represents the returned struct of the /_cat/cluster_manager response +type CatClusterManagersResp struct { + ClusterManagers []CatClusterManagerResp + response *opensearch.Response +} + +// CatClusterManagerResp represents one index of the CatClusterManagerResp +type CatClusterManagerResp struct { + ID string `json:"id"` + Host string `json:"host"` + IP string `json:"ip"` + Node string `json:"node"` +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r CatClusterManagersResp) Inspect() Inspect { + return Inspect{ + Response: r.response, + } +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-count-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-count-params.go new file mode 100644 index 000000000..d734ec1ce --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-count-params.go @@ -0,0 +1,75 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" +) + +// CatCountParams represents possible parameters for the CatCountReq +type CatCountParams struct { + H []string + Sort []string + V *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r CatCountParams) get() map[string]string { + params := make(map[string]string) + + if len(r.H) > 0 { + params["h"] = strings.Join(r.H, ",") + } + + if len(r.Sort) > 0 { + params["s"] = strings.Join(r.Sort, ",") + } + + if r.V != nil { + params["v"] = strconv.FormatBool(*r.V) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + params["format"] = "json" + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-count.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-count.go new file mode 100644 index 000000000..d4250301c --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-count.go @@ -0,0 +1,60 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// CatCountReq represent possible options for the /_cat/count request +type CatCountReq struct { + Indices []string + Header http.Header + Params CatCountParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r CatCountReq) GetRequest() (*http.Request, error) { + indices := strings.Join(r.Indices, ",") + var path strings.Builder + path.Grow(len("/_cat/count/") + len(indices)) + path.WriteString("/_cat/count") + if len(r.Indices) > 0 { + path.WriteString("/") + path.WriteString(indices) + } + return opensearch.BuildRequest( + "GET", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// CatCountsResp represents the returned struct of the /_cat/count response +type CatCountsResp struct { + Counts []CatCountResp + response *opensearch.Response +} + +// CatCountResp represents one index of the CatCountResp +type CatCountResp struct { + Epoch int `json:"epoch,string"` + Timestamp string `json:"timestamp"` + Count int `json:"count,string"` +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r CatCountsResp) Inspect() Inspect { + return Inspect{ + Response: r.response, + } +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-fielddata-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-fielddata-params.go new file mode 100644 index 000000000..4777669c5 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-fielddata-params.go @@ -0,0 +1,80 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" +) + +// CatFieldDataParams represents possible parameters for the CatFieldDataReq +type CatFieldDataParams struct { + Bytes string + H []string + Sort []string + V *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r CatFieldDataParams) get() map[string]string { + params := make(map[string]string) + + if r.Bytes != "" { + params["bytes"] = r.Bytes + } + + if len(r.H) > 0 { + params["h"] = strings.Join(r.H, ",") + } + + if len(r.Sort) > 0 { + params["s"] = strings.Join(r.Sort, ",") + } + + if r.V != nil { + params["v"] = strconv.FormatBool(*r.V) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + params["format"] = "json" + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-fielddata.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-fielddata.go new file mode 100644 index 000000000..aa70dae57 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-fielddata.go @@ -0,0 +1,63 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// CatFieldDataReq represent possible options for the /_cat/fielddata request +type CatFieldDataReq struct { + FieldData []string + Header http.Header + Params CatFieldDataParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r CatFieldDataReq) GetRequest() (*http.Request, error) { + fielddata := strings.Join(r.FieldData, ",") + var path strings.Builder + path.Grow(len("/_cat/fielddata/") + len(fielddata)) + path.WriteString("/_cat/fielddata") + if len(r.FieldData) > 0 { + path.WriteString("/") + path.WriteString(fielddata) + } + return opensearch.BuildRequest( + "GET", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// CatFieldDataResp represents the returned struct of the /_cat/fielddata response +type CatFieldDataResp struct { + FieldData []CatFieldDataItemResp + response *opensearch.Response +} + +// CatFieldDataItemResp represents one index of the CatFieldDataResp +type CatFieldDataItemResp struct { + ID string `json:"id"` + Host string `json:"host"` + IP string `json:"ip"` + Node string `json:"node"` + Field string `json:"field"` + Size string `json:"size"` +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r CatFieldDataResp) Inspect() Inspect { + return Inspect{ + Response: r.response, + } +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-health-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-health-params.go new file mode 100644 index 000000000..3c4233365 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-health-params.go @@ -0,0 +1,85 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" +) + +// CatHealthParams represents possible parameters for the CatHealthReq +type CatHealthParams struct { + H []string + Sort []string + Time string + TS *bool + V *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r CatHealthParams) get() map[string]string { + params := make(map[string]string) + + if len(r.H) > 0 { + params["h"] = strings.Join(r.H, ",") + } + + if len(r.Sort) > 0 { + params["s"] = strings.Join(r.Sort, ",") + } + + if r.Time != "" { + params["time"] = r.Time + } + + if r.TS != nil { + params["ts"] = strconv.FormatBool(*r.TS) + } + + if r.V != nil { + params["v"] = strconv.FormatBool(*r.V) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + params["format"] = "json" + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-health.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-health.go new file mode 100644 index 000000000..4c7df9a32 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-health.go @@ -0,0 +1,63 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// CatHealthReq represent possible options for the /_cat/health request +type CatHealthReq struct { + Header http.Header + Params CatHealthParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r CatHealthReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "GET", + "/_cat/health", + nil, + r.Params.get(), + r.Header, + ) +} + +// CatHealthResp represents the returned struct of the /_cat/health response +type CatHealthResp struct { + Health []CatHealthItemResp + response *opensearch.Response +} + +// CatHealthItemResp represents one index of the CatHealthResp +type CatHealthItemResp struct { + Epoch int `json:"epoch,string"` + Timestamp string `json:"timestamp"` + Cluster string `json:"cluster"` + Status string `json:"status"` + NodeTotal int `json:"node.total,string"` + NodeData int `json:"node.data,string"` + DiscoveredMaster bool `json:"discovered_master,string"` + DiscoveredClusterManager bool `json:"discovered_cluster_manager,string"` + Shards int `json:"shards,string"` + Primary int `json:"pri,string"` + Relocating int `json:"relo,string"` + Initializing int `json:"init,string"` + Unassigned int `json:"unassign,string"` + PendingTasks int `json:"pending_tasks,string"` + MaxTaskWaitTime string `json:"max_task_wait_time"` + ActiveShardsPercent string `json:"active_shards_percent"` +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r CatHealthResp) Inspect() Inspect { + return Inspect{ + Response: r.response, + } +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-indices-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-indices-params.go new file mode 100644 index 000000000..cca17ccdb --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-indices-params.go @@ -0,0 +1,121 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" + "time" +) + +// CatIndicesParams represents possible parameters for the CatIndicesReq +type CatIndicesParams struct { + Bytes string + ExpandWildcards string + H []string + Health string + IncludeUnloadedSegments *bool + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Primary *bool + Sort []string + Time string + V *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r CatIndicesParams) get() map[string]string { + params := make(map[string]string) + + if r.Bytes != "" { + params["bytes"] = r.Bytes + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if len(r.H) > 0 { + params["h"] = strings.Join(r.H, ",") + } + + if r.Health != "" { + params["health"] = r.Health + } + + if r.IncludeUnloadedSegments != nil { + params["include_unloaded_segments"] = strconv.FormatBool(*r.IncludeUnloadedSegments) + } + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Primary != nil { + params["pri"] = strconv.FormatBool(*r.Primary) + } + + if len(r.Sort) > 0 { + params["s"] = strings.Join(r.Sort, ",") + } + + if r.Time != "" { + params["time"] = r.Time + } + + if r.V != nil { + params["v"] = strconv.FormatBool(*r.V) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + params["format"] = "json" + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-indices.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-indices.go new file mode 100644 index 000000000..30939cbe3 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-indices.go @@ -0,0 +1,203 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// CatIndicesReq represent possible options for the /_cat/indices request +type CatIndicesReq struct { + Indices []string + Header http.Header + Params CatIndicesParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r CatIndicesReq) GetRequest() (*http.Request, error) { + indices := strings.Join(r.Indices, ",") + var path strings.Builder + path.Grow(len("/_cat/indices/") + len(indices)) + path.WriteString("/_cat/indices") + if len(r.Indices) > 0 { + path.WriteString("/") + path.WriteString(indices) + } + return opensearch.BuildRequest( + "GET", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// CatIndicesResp represents the returned struct of the /_cat/indices response +type CatIndicesResp struct { + Indices []CatIndexResp + response *opensearch.Response +} + +// CatIndexResp represents one index of the CatIndicesResp +type CatIndexResp struct { + Health string `json:"health"` + Status string `json:"status"` + Index string `json:"index"` + UUID string `json:"uuid"` + Primary *int `json:"pri,string"` + Replica *int `json:"rep,string"` + DocsCount *int `json:"docs.count,string"` + DocDeleted *int `json:"docs.deleted,string"` + CreationDate int `json:"creation.date,string"` + CreationDateString string `json:"creation.date.string"` + // Pointer as newly created indices can return null + StoreSize *string `json:"store.size"` + PrimaryStoreSize *string `json:"pri.store.size"` + CompletionSize *string `json:"completion.size"` + PrimaryCompletionSize *string `json:"pri.completion.size"` + FieldDataMemorySize *string `json:"fielddata.memory_size"` + PrimaryFieldDataMemorySize *string `json:"pri.fielddata.memory_size"` + FieldDataEvictions *int `json:"fielddata.evictions,string"` + PrimaryFieldDataEvictions *int `json:"pri.fielddata.evictions,string"` + QueryCacheMemorySize *string `json:"query_cache.memory_size"` + PrimaryQueryCacheMemorySize *string `json:"pri.query_cache.memory_size"` + QueryCacheEvictions *int `json:"query_cache.evictions,string"` + PrimaryQueryCacheEvictions *int `json:"pri.query_cache.evictions,string"` + RequestCacheMemorySize *string `json:"request_cache.memory_size"` + PrimaryRequestCacheMemorySize *string `json:"pri.request_cache.memory_size"` + RequestCacheEvictions *int `json:"request_cache.evictions,string"` + PrimaryRequestCacheEvictions *int `json:"pri.request_cache.evictions,string"` + RequestCacheHitCount *int `json:"request_cache.hit_count,string"` + PrimaryRequestCacheHitCount *int `json:"pri.request_cache.hit_count,string"` + RequestCacheMissCount *int `json:"request_cache.miss_count,string"` + PrimaryRequestCacheMissCount *int `json:"pri.request_cache.miss_count,string"` + FlushTotal *int `json:"flush.total,string"` + PrimaryFlushTotal *int `json:"pri.flush.total,string"` + FlushTime *string `json:"flush.total_time"` + PrimaryFlushTime *string `json:"pri.flush.total_time"` + GetCurrent *int `json:"get.current,string"` + PrimaryGetCurrent *int `json:"pri.get.current,string"` + GetTime *string `json:"get.time"` + PrimaryGetTime *string `json:"pri.get.time"` + GetTotal *int `json:"get.total,string"` + PrimaryGetTotal *int `json:"pri.get.total,string"` + GetExistsTime *string `json:"get.exists_time"` + PrimaryGetExistsTime *string `json:"pri.get.exists_time"` + GetExistsTotal *int `json:"get.exists_total,string"` + PrimaryGetExistsTotal *int `json:"pri.get.exists_total,string"` + GetMissingTime *string `json:"get.missing_time"` + PrimaryGetMissingTime *string `json:"pri.get.missing_time"` + GetMissingTotal *int `json:"get.missing_total,string"` + PrimaryGetMissingTotal *int `json:"pri.get.missing_total,string"` + IndexingDeleteCurrent *int `json:"indexing.delete_current,string"` + PrimaryIndexingDeleteCurrent *int `json:"pri.indexing.delete_current,string"` + IndexingDeleteTime *string `json:"indexing.delete_time"` + PrimaryIndexingDeleteTime *string `json:"pri.indexing.delete_time"` + IndexingDeleteTotal *int `json:"indexing.delete_total,string"` + PrimaryIndexingDeleteTotal *int `json:"pri.indexing.delete_total,string"` + IndexingIndexCurrent *int `json:"indexing.index_current,string"` + PrimaryIndexingIndexCurrent *int `json:"pri.indexing.index_current,string"` + IndexingIndexTime *string `json:"indexing.index_time"` + PrimaryIndexingIndexTime *string `json:"pri.indexing.index_time"` + IndexingIndexTotal *int `json:"indexing.index_total,string"` + PrimaryIndexingIndexTotal *int `json:"pri.indexing.index_total,string"` + IndexingIndexFailed *int `json:"indexing.index_failed,string"` + PrimaryIndexingIndexFailed *int `json:"pri.indexing.index_failed,string"` + MergesCurrent *int `json:"merges.current,string"` + PrimaryMergesCurrent *int `json:"pri.merges.current,string"` + MergesCurrentDocs *int `json:"merges.current_docs,string"` + PrimaryMergesCurrentDocs *int `json:"pri.merges.current_docs,string"` + MergesCurrentSize *string `json:"merges.current_size"` + PrimaryMergesCurrentSize *string `json:"pri.merges.current_size"` + MergesTotal *int `json:"merges.total,string"` + PrimaryMergesTotal *int `json:"pri.merges.total,string"` + MergesTotalDocs *int `json:"merges.total_docs,string"` + PrimaryMergesTotalDocs *int `json:"pri.merges.total_docs,string"` + MergesTotalSize *string `json:"merges.total_size"` + PrimaryMergesTotalSize *string `json:"pri.merges.total_size"` + MergesTotalTime *string `json:"merges.total_time"` + PrimaryMergesTotalTime *string `json:"pri.merges.total_time"` + RefreshTotal *int `json:"refresh.total,string"` + PrimaryRefreshTotal *int `json:"pri.refresh.total,string"` + RefreshTime *string `json:"refresh.time"` + PrimaryRefreshTime *string `json:"pri.refresh.time"` + RefreshExternalTotal *int `json:"refresh.external_total,string"` + PrimaryRefreshExternalTotal *int `json:"pri.refresh.external_total,string"` + RefreshExternalTime *string `json:"refresh.external_time"` + PrimaryRefreshExternalTime *string `json:"pri.refresh.external_time"` + RefreshListeners *int `json:"refresh.listeners,string"` + PrimaryRefreshListeners *int `json:"pri.refresh.listeners,string"` + SearchFetchCurrent *int `json:"search.fetch_current,string"` + PrimarySearchFetchCurrent *int `json:"pri.search.fetch_current,string"` + SearchFetchTime *string `json:"search.fetch_time"` + PrimarySearchFetchTime *string `json:"pri.search.fetch_time"` + SearchFetchTotal *int `json:"search.fetch_total,string"` + PrimarySearchFetchTotal *int `json:"pri.search.fetch_total,string"` + SearchOpenContexts *int `json:"search.open_contexts,string"` + PrimarySearchOpenContexts *int `json:"pri.search.open_contexts,string"` + SearchQueryCurrent *int `json:"search.query_current,string"` + PrimarySearchQueryCurrent *int `json:"pri.search.query_current,string"` + SearchQueryTime *string `json:"search.query_time"` + PrimarySearchQueryTime *string `json:"pri.search.query_time"` + SearchQueryTotal *int `json:"search.query_total,string"` + PrimarySearchQueryTotal *int `json:"pri.search.query_total,string"` + SearchConcurrentQueryCurrent *int `json:"search.concurrent_query_current,string"` + PrimarySearchConcurrentQueryCurrent *int `json:"pri.search.concurrent_query_current,string"` + SearchConcurrentQueryTime *string `json:"search.concurrent_query_time"` + PrimarySearchConcurrentQueryTime *string `json:"pri.search.concurrent_query_time"` + SearchConcurrentQueryTotal *int `json:"search.concurrent_query_total,string"` + PrimarySearchConcurrentQueryTotal *int `json:"pri.search.concurrent_query_total,string"` + SearchConcurrentAvgSliceCount *string `json:"search.concurrent_avg_slice_count"` + PrimarySearchConcurrentAvgSliceCount *string `json:"pri.search.concurrent_avg_slice_count"` + SearchScrollCurrent *int `json:"search.scroll_current,string"` + PrimarySearchScrollCurrent *int `json:"pri.search.scroll_current,string"` + SearchScrollTime *string `json:"search.scroll_time"` + PrimarySearchScrollTime *string `json:"pri.search.scroll_time"` + SearchScrollTotal *int `json:"search.scroll_total,string"` + PrimarySearchScrollTotal *int `json:"pri.search.scroll_total,string"` + SearchPointInTimeCurrent *string `json:"search.point_in_time_current"` + PrimarySearchPointInTimeCurrent *string `json:"pri.search.point_in_time_current"` + SearchPointInTimeTime *string `json:"search.point_in_time_time"` + PrimarySearchPointInTimeTime *string `json:"pri.search.point_in_time_time"` + SearchPointInTimeTotal *int `json:"search.point_in_time_total,string"` + PrimarySearchPointInTimeTotal *int `json:"pri.search.point_in_time_total,string"` + SegmentsCount *int `json:"segments.count,string"` + PrimarySegmentsCount *int `json:"pri.segments.count,string"` + SegmentsMemory *string `json:"segments.memory"` + PrimarySegmentsMemory *string `json:"pri.segments.memory"` + SegmentsIndexWriteMemory *string `json:"segments.index_writer_memory"` + PrimarySegmentsIndexWriteMemory *string `json:"pri.segments.index_writer_memory"` + SegmentsVersionMapMemory *string `json:"segments.version_map_memory"` + PrimarySegmentsVersionMapMemory *string `json:"pri.segments.version_map_memory"` + SegmentsFixedBitsetMemory *string `json:"segments.fixed_bitset_memory"` + PrimarySegmentsFixedBitsetMemory *string `json:"pri.segments.fixed_bitset_memory"` + WarmerCurrent *int `json:"warmer.current,string"` + PrimaryWarmerCurrent *int `json:"pri.warmer.current,string"` + WarmerTotal *int `json:"warmer.total,string"` + PrimaryWarmerTotal *int `json:"pri.warmer.total,string"` + WarmerTotalTime *string `json:"warmer.total_time"` + PrimaryWarmerTotalTime *string `json:"pri.warmer.total_time"` + SuggestCurrent *int `json:"suggest.current,string"` + PrimarySuggestCurrent *int `json:"pri.suggest.current,string"` + SuggestTime *string `json:"suggest.time"` + PrimarySuggestTime *string `json:"pri.suggest.time"` + SuggestTotal *int `json:"suggest.total,string"` + PrimarySuggestTotal *int `json:"pri.suggest.total,string"` + MemoryTotal string `json:"memory.total"` + PrimaryMemoryTotal string `json:"pri.memory.total"` + SearchThrottled bool `json:"search.throttled,string"` +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r CatIndicesResp) Inspect() Inspect { + return Inspect{ + Response: r.response, + } +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-master-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-master-params.go new file mode 100644 index 000000000..1f9eefd2c --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-master-params.go @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" + "time" +) + +// CatMasterParams represents possible parameters for the CatMasterReq +type CatMasterParams struct { + H []string + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Sort []string + V *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r CatMasterParams) get() map[string]string { + params := make(map[string]string) + + if len(r.H) > 0 { + params["h"] = strings.Join(r.H, ",") + } + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if len(r.Sort) > 0 { + params["s"] = strings.Join(r.Sort, ",") + } + + if r.V != nil { + params["v"] = strconv.FormatBool(*r.V) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + params["format"] = "json" + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-master.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-master.go new file mode 100644 index 000000000..bb1626203 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-master.go @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// CatMasterReq represent possible options for the /_cat/master request +type CatMasterReq struct { + Header http.Header + Params CatMasterParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r CatMasterReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "GET", + "/_cat/master", + nil, + r.Params.get(), + r.Header, + ) +} + +// CatMasterResp represents the returned struct of the /_cat/master response +type CatMasterResp struct { + Master []CatMasterItemResp + response *opensearch.Response +} + +// CatMasterItemResp represents one index of the CatMasterResp +type CatMasterItemResp struct { + ID string `json:"id"` + Host string `json:"host"` + IP string `json:"ip"` + Node string `json:"node"` +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r CatMasterResp) Inspect() Inspect { + return Inspect{ + Response: r.response, + } +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-nodeattrs-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-nodeattrs-params.go new file mode 100644 index 000000000..49e418a92 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-nodeattrs-params.go @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" + "time" +) + +// CatNodeAttrsParams represents possible parameters for the CatNodeAttrsReq +type CatNodeAttrsParams struct { + H []string + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Sort []string + V *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r CatNodeAttrsParams) get() map[string]string { + params := make(map[string]string) + + if len(r.H) > 0 { + params["h"] = strings.Join(r.H, ",") + } + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if len(r.Sort) > 0 { + params["s"] = strings.Join(r.Sort, ",") + } + + if r.V != nil { + params["v"] = strconv.FormatBool(*r.V) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + params["format"] = "json" + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-nodeattrs.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-nodeattrs.go new file mode 100644 index 000000000..8f5cb6ce9 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-nodeattrs.go @@ -0,0 +1,55 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// CatNodeAttrsReq represent possible options for the /_cat/nodeattrs request +type CatNodeAttrsReq struct { + Header http.Header + Params CatNodeAttrsParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r CatNodeAttrsReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "GET", + "/_cat/nodeattrs", + nil, + r.Params.get(), + r.Header, + ) +} + +// CatNodeAttrsResp represents the returned struct of the /_cat/nodeattrs response +type CatNodeAttrsResp struct { + NodeAttrs []CatNodeAttrsItemResp + response *opensearch.Response +} + +// CatNodeAttrsItemResp represents one index of the CatNodeAttrsResp +type CatNodeAttrsItemResp struct { + Node string `json:"node"` + ID string `json:"id"` + PID int `json:"pid,string"` + Host string `json:"host"` + IP string `json:"ip"` + Port int `json:"port,string"` + Attr string `json:"attr"` + Value string `json:"value"` +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r CatNodeAttrsResp) Inspect() Inspect { + return Inspect{ + Response: r.response, + } +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-nodes-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-nodes-params.go new file mode 100644 index 000000000..e986d33ba --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-nodes-params.go @@ -0,0 +1,111 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" + "time" +) + +// CatNodesParams represents possible parameters for the CatNodesReq +type CatNodesParams struct { + Bytes string + FullID *bool + H []string + IncludeUnloadedSegments *bool + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Sort []string + Time string + V *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r CatNodesParams) get() map[string]string { + params := make(map[string]string) + + if r.Bytes != "" { + params["bytes"] = r.Bytes + } + + if r.FullID != nil { + params["full_id"] = strconv.FormatBool(*r.FullID) + } + + if len(r.H) > 0 { + params["h"] = strings.Join(r.H, ",") + } + + if r.IncludeUnloadedSegments != nil { + params["include_unloaded_segments"] = strconv.FormatBool(*r.IncludeUnloadedSegments) + } + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if len(r.Sort) > 0 { + params["s"] = strings.Join(r.Sort, ",") + } + + if r.Time != "" { + params["time"] = r.Time + } + + if r.V != nil { + params["v"] = strconv.FormatBool(*r.V) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + params["format"] = "json" + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-nodes.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-nodes.go new file mode 100644 index 000000000..f51da626d --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-nodes.go @@ -0,0 +1,146 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// CatNodesReq represent possible options for the /_cat/nodes request +type CatNodesReq struct { + Header http.Header + Params CatNodesParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r CatNodesReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "GET", + "/_cat/nodes", + nil, + r.Params.get(), + r.Header, + ) +} + +// CatNodesResp represents the returned struct of the /_cat/nodes response +type CatNodesResp struct { + Nodes []CatNodesItemResp + response *opensearch.Response +} + +// CatNodesItemResp represents one index of the CatNodesResp +type CatNodesItemResp struct { + ID string `json:"id"` + PID string `json:"pid"` + IP string `json:"ip"` + Port int `json:"port,string"` + HTTPAddress string `json:"http_address"` + Version string `json:"version"` + Type string `json:"type"` + Build string `json:"build"` + JDK string `json:"jdk"` + DiskTotal string `json:"disk.total"` + DiskUsed string `json:"disk.used"` + DiskAvail string `json:"disk.avail"` + DiskUsedPercent string `json:"disk.used_percent"` + HeapCurrent string `json:"heap.current"` + HeapPercent int `json:"heap.percent,string"` + HeapMax string `json:"heap.max"` + RAMCurrent string `json:"ram.current"` + RAMPercent int `json:"ram.percent,string"` + RAMMax string `json:"ram.max"` + FileDescCurrent int `json:"file_desc.current,string"` + FileDescPercent int `json:"file_desc.percent,string"` + FileDescMax int `json:"file_desc.max,string"` + CPU int `json:"cpu,string"` + Load1M string `json:"load_1m"` + Load5M string `json:"load_5m"` + Load15M string `json:"load_15m"` + Uptime string `json:"uptime"` + Role string `json:"node.role"` + Roles string `json:"node.roles"` + Master string `json:"master"` + ClusterManager string `json:"cluster_manager"` + Name string `json:"name"` + CompletionSize string `json:"completion.size"` + FieldDataMemorySize string `json:"fielddata.memory_size"` + FileldDataEvictions int `json:"fielddata.evictions,string"` + QueryCacheMemorySize string `json:"query_cache.memory_size"` + QueryCacheEvictions int `json:"query_cache.evictions,string"` + QueryCacheHitCount int `json:"query_cache.hit_count,string"` + QueryCacheMissCount int `json:"query_cache.miss_count,string"` + RequestCacheMemorySize string `json:"request_cache.memory_size"` + RequestCacheEvictions int `json:"request_cache.evictions,string"` + RequestCacheHitCount int `json:"request_cache.hit_count,string"` + RequestCacheMissCount int `json:"request_cache.miss_count,string"` + FlushTotal int `json:"flush.total,string"` + FlushTotalTime string `json:"flush.total_time"` + GetCurrent int `json:"get.current,string"` + GetTime string `json:"get.time"` + GetTotal int `json:"get.total,string"` + GetExistsTime string `json:"get.exists_time"` + GetExistsTotal int `json:"get.exists_total,string"` + GetMissingTime string `json:"get.missing_time"` + GetMissingTotal int `json:"get.missing_total,string"` + IndexingDeleteCurrent int `json:"indexing.delete_current,string"` + IndexingDeleteTime string `json:"indexing.delete_time"` + IndexingDeleteTotal int `json:"indexing.delete_total,string"` + IndexingIndexCurrent int `json:"indexing.index_current,string"` + IndexingIndexTime string `json:"indexing.index_time"` + IndexingIndexTotal int `json:"indexing.index_total,string"` + IndexingIndexFailed int `json:"indexing.index_failed,string"` + MergesCurrent int `json:"merges.current,string"` + MergesCurrentDoc int `json:"merges.current_docs,string"` + MergesCurrentSize string `json:"merges.current_size"` + MergesTotal int `json:"merges.total,string"` + MergesTotalDocs int `json:"merges.total_docs,string"` + MergesTotalSize string `json:"merges.total_size"` + MergesTotalTime string `json:"merges.total_time"` + RefreshTotal int `json:"refresh.total,string"` + RefreshTime string `json:"refresh.time"` + RefreshExternalTotal int `json:"refresh.external_total,string"` + RefreshExternalTime string `json:"refresh.external_time"` + RefreshListeners int `json:"refresh.listeners,string"` + ScriptCompilations int `json:"script.compilations,string"` + ScriptCacheEvictions int `json:"script.cache_evictions,string"` + ScriptCompilationLimitTriggered int `json:"script.compilation_limit_triggered,string"` + SearchFetchCurrent int `json:"search.fetch_current,string"` + SearchFetchTime string `json:"search.fetch_time"` + SearchFetchTotal int `json:"search.fetch_total,string"` + SearchOpenContexts int `json:"search.open_contexts,string"` + SearchQueryCurrent int `json:"search.query_current,string"` + SearchQueryTime string `json:"search.query_time"` + SearchQueryTotal int `json:"search.query_total,string"` + SearchConcurrentQueryCurrent int `json:"search.concurrent_query_current,string"` + SearchConcurrentQueryTime string `json:"search.concurrent_query_time"` + SearchConcurrentQueryTotal int `json:"search.concurrent_query_total,string"` + SearchConcurrentAvgSliceCount string `json:"search.concurrent_avg_slice_count"` + SearchScrollCurrent int `json:"search.scroll_current,string"` + SearchScrollTime string `json:"search.scroll_time"` + SearchScrollTotal int `json:"search.scroll_total,string"` + SearchPointInTimeCurrent int `json:"search.point_in_time_current,string"` + SearchPointInTimeTime string `json:"search.point_in_time_time"` + SearchPointInTimeTotal int `json:"search.point_in_time_total,string"` + SegmentsCount int `json:"segments.count,string"` + SegmentsMemory string `json:"segments.memory"` + SegmentsIndexWriteMemory string `json:"segments.index_writer_memory"` + SegmentsVersionMapMemory string `json:"segments.version_map_memory"` + SegmentsFixedBitsetMemory string `json:"segments.fixed_bitset_memory"` + SuggestCurrent int `json:"suggest.current,string"` + SuggestTime string `json:"suggest.time"` + SuggestTotal int `json:"suggest.total,string"` +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r CatNodesResp) Inspect() Inspect { + return Inspect{ + Response: r.response, + } +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-pending_tasks-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-pending_tasks-params.go new file mode 100644 index 000000000..c9b07a64e --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-pending_tasks-params.go @@ -0,0 +1,96 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" + "time" +) + +// CatPendingTasksParams represents possible parameters for the CatPendingTasksReq +type CatPendingTasksParams struct { + H []string + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Sort []string + Time string + V *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r CatPendingTasksParams) get() map[string]string { + params := make(map[string]string) + + if len(r.H) > 0 { + params["h"] = strings.Join(r.H, ",") + } + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if len(r.Sort) > 0 { + params["s"] = strings.Join(r.Sort, ",") + } + + if r.Time != "" { + params["time"] = r.Time + } + + if r.V != nil { + params["v"] = strconv.FormatBool(*r.V) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + params["format"] = "json" + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-pending_tasks.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-pending_tasks.go new file mode 100644 index 000000000..c830d3635 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-pending_tasks.go @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// CatPendingTasksReq represent possible options for the /_cat/pending_tasks request +type CatPendingTasksReq struct { + Header http.Header + Params CatPendingTasksParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r CatPendingTasksReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "GET", + "/_cat/pending_tasks", + nil, + r.Params.get(), + r.Header, + ) +} + +// CatPendingTasksResp represents the returned struct of the /_cat/pending_tasks response +type CatPendingTasksResp struct { + PendingTasks []CatPendingTaskResp + response *opensearch.Response +} + +// CatPendingTaskResp represents one index of the CatPendingTasksResp +type CatPendingTaskResp struct { + InsertOrder string `json:"insertOrder"` + TimeInQueue string `json:"timeInQueue"` + Priority string `json:"priority"` + Source string `json:"source"` +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r CatPendingTasksResp) Inspect() Inspect { + return Inspect{ + Response: r.response, + } +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-plugins-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-plugins-params.go new file mode 100644 index 000000000..03670a052 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-plugins-params.go @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" + "time" +) + +// CatPluginsParams represents possible parameters for the CatPluginsReq +type CatPluginsParams struct { + H []string + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Sort []string + V *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r CatPluginsParams) get() map[string]string { + params := make(map[string]string) + + if len(r.H) > 0 { + params["h"] = strings.Join(r.H, ",") + } + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if len(r.Sort) > 0 { + params["s"] = strings.Join(r.Sort, ",") + } + + if r.V != nil { + params["v"] = strconv.FormatBool(*r.V) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + params["format"] = "json" + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-plugins.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-plugins.go new file mode 100644 index 000000000..451d23432 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-plugins.go @@ -0,0 +1,52 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// CatPluginsReq represent possible options for the /_cat/plugins request +type CatPluginsReq struct { + Header http.Header + Params CatPluginsParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r CatPluginsReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "GET", + "/_cat/plugins", + nil, + r.Params.get(), + r.Header, + ) +} + +// CatPluginsResp represents the returned struct of the /_cat/plugins response +type CatPluginsResp struct { + Plugins []CatPluginResp + response *opensearch.Response +} + +// CatPluginResp represents one index of the CatPluginsResp +type CatPluginResp struct { + ID string `json:"id,omitempty"` + Name string `json:"name,omitempty"` + Component string `json:"component,omitempty"` + Version string `json:"version,omitempty"` + Description string `json:"description,omitempty"` +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r CatPluginsResp) Inspect() Inspect { + return Inspect{ + Response: r.response, + } +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-recovery-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-recovery-params.go new file mode 100644 index 000000000..c343c010a --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-recovery-params.go @@ -0,0 +1,95 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" +) + +// CatRecoveryParams represents possible parameters for the CatRecoveryReq +type CatRecoveryParams struct { + ActiveOnly *bool + Bytes string + Detailed *bool + H []string + Sort []string + Time string + V *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r CatRecoveryParams) get() map[string]string { + params := make(map[string]string) + + if r.ActiveOnly != nil { + params["active_only"] = strconv.FormatBool(*r.ActiveOnly) + } + + if r.Bytes != "" { + params["bytes"] = r.Bytes + } + + if r.Detailed != nil { + params["detailed"] = strconv.FormatBool(*r.Detailed) + } + + if len(r.H) > 0 { + params["h"] = strings.Join(r.H, ",") + } + + if len(r.Sort) > 0 { + params["s"] = strings.Join(r.Sort, ",") + } + + if r.Time != "" { + params["time"] = r.Time + } + + if r.V != nil { + params["v"] = strconv.FormatBool(*r.V) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + params["format"] = "json" + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-recovery.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-recovery.go new file mode 100644 index 000000000..2dc29c3ed --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-recovery.go @@ -0,0 +1,83 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// CatRecoveryReq represent possible options for the /_cat/recovery request +type CatRecoveryReq struct { + Indices []string + Header http.Header + Params CatRecoveryParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r CatRecoveryReq) GetRequest() (*http.Request, error) { + indices := strings.Join(r.Indices, ",") + var path strings.Builder + path.Grow(len("/_cat/recovery/") + len(indices)) + path.WriteString("/_cat/recovery") + if len(r.Indices) > 0 { + path.WriteString("/") + path.WriteString(indices) + } + return opensearch.BuildRequest( + "GET", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// CatRecoveryResp represents the returned struct of the /_cat/recovery response +type CatRecoveryResp struct { + Recovery []CatRecoveryItemResp + response *opensearch.Response +} + +// CatRecoveryItemResp represents one index of the CatRecoveryResp +type CatRecoveryItemResp struct { + Index string `json:"index"` + Shard int `json:"shard,string"` + StartTime string `json:"start_time"` + StartTimeMillis int `json:"start_time_millis,string"` + StopTime string `json:"stop_time"` + StopTimeMillis int `json:"stop_time_millis,string"` + Time string `json:"time"` + Type string `json:"type"` + Stage string `json:"stage"` + SourceHost string `json:"source_host"` + SourceNode string `json:"source_node"` + TargetHost string `json:"target_host"` + TargetNode string `json:"target_node"` + Repository string `json:"repository"` + Snapshot string `json:"snapshot"` + Files int `json:"files,string"` + FilesRecovered int `json:"files_recovered,string"` + FilesPercent string `json:"files_percent"` + FilesTotal int `json:"files_total,string"` + Bytes int `json:"bytes,string"` + BytesRecovered int `json:"bytes_recovered,string"` + BytesPercent string `json:"bytes_percent"` + BytesTotal int `json:"bytes_total,string"` + TranslogOps int `json:"translog_ops,string"` + TranslogOpsRecovered int `json:"translog_ops_recovered,string"` + TranslogOpsPercent string `json:"translog_ops_percent"` +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r CatRecoveryResp) Inspect() Inspect { + return Inspect{ + Response: r.response, + } +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-repositories-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-repositories-params.go new file mode 100644 index 000000000..ab193d935 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-repositories-params.go @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" + "time" +) + +// CatRepositoriesParams represents possible parameters for the CatRepositoriesReq +type CatRepositoriesParams struct { + H []string + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Sort []string + V *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r CatRepositoriesParams) get() map[string]string { + params := make(map[string]string) + + if len(r.H) > 0 { + params["h"] = strings.Join(r.H, ",") + } + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if len(r.Sort) > 0 { + params["s"] = strings.Join(r.Sort, ",") + } + + if r.V != nil { + params["v"] = strconv.FormatBool(*r.V) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + params["format"] = "json" + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-repositories.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-repositories.go new file mode 100644 index 000000000..760b458ff --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-repositories.go @@ -0,0 +1,49 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// CatRepositoriesReq represent possible options for the /_cat/repositories request +type CatRepositoriesReq struct { + Header http.Header + Params CatRepositoriesParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r CatRepositoriesReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "GET", + "/_cat/repositories", + nil, + r.Params.get(), + r.Header, + ) +} + +// CatRepositoriesResp represents the returned struct of the /_cat/repositories response +type CatRepositoriesResp struct { + Repositories []CatRepositorieResp + response *opensearch.Response +} + +// CatRepositorieResp represents one index of the CatRepositoriesResp +type CatRepositorieResp struct { + ID string `json:"id"` + Type string `json:"type"` +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r CatRepositoriesResp) Inspect() Inspect { + return Inspect{ + Response: r.response, + } +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-segments-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-segments-params.go new file mode 100644 index 000000000..daf2df8a2 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-segments-params.go @@ -0,0 +1,96 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" + "time" +) + +// CatSegmentsParams represents possible parameters for the CatSegmentsReq +type CatSegmentsParams struct { + Bytes string + H []string + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Sort []string + V *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r CatSegmentsParams) get() map[string]string { + params := make(map[string]string) + + if r.Bytes != "" { + params["bytes"] = r.Bytes + } + + if len(r.H) > 0 { + params["h"] = strings.Join(r.H, ",") + } + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if len(r.Sort) > 0 { + params["s"] = strings.Join(r.Sort, ",") + } + + if r.V != nil { + params["v"] = strconv.FormatBool(*r.V) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + params["format"] = "json" + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-segments.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-segments.go new file mode 100644 index 000000000..0dec8d2b0 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-segments.go @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// CatSegmentsReq represent possible options for the /_cat/segments request +type CatSegmentsReq struct { + Indices []string + Header http.Header + Params CatSegmentsParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r CatSegmentsReq) GetRequest() (*http.Request, error) { + indices := strings.Join(r.Indices, ",") + var path strings.Builder + path.Grow(len("/_cat/segments/") + len(indices)) + path.WriteString("/_cat/segments") + if len(r.Indices) > 0 { + path.WriteString("/") + path.WriteString(indices) + } + return opensearch.BuildRequest( + "GET", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// CatSegmentsResp represents the returned struct of the /_cat/segments response +type CatSegmentsResp struct { + Segments []CatSegmentResp + response *opensearch.Response +} + +// CatSegmentResp represents one index of the CatSegmentsResp +type CatSegmentResp struct { + Index string `json:"index"` + Shard int `json:"shard,string"` + Prirep string `json:"prirep"` + IP string `json:"ip"` + ID string `json:"id"` + Segment string `json:"segment"` + Generation int `json:"generation,string"` + DocsCount int `json:"docs.count,string"` + DocsDeleted int `json:"docs.deleted,string"` + Size string `json:"size"` + SizeMemory string `json:"size.memory"` + Committed bool `json:"committed,string"` + Searchable bool `json:"searchable,string"` + Version string `json:"version"` + Compound bool `json:"compound,string"` +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r CatSegmentsResp) Inspect() Inspect { + return Inspect{ + Response: r.response, + } +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-shards-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-shards-params.go new file mode 100644 index 000000000..ea29be4d1 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-shards-params.go @@ -0,0 +1,101 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" + "time" +) + +// CatShardsParams represents possible parameters for the CatShardsReq +type CatShardsParams struct { + Bytes string + H []string + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Sort []string + Time string + V *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r CatShardsParams) get() map[string]string { + params := make(map[string]string) + + if r.Bytes != "" { + params["bytes"] = r.Bytes + } + + if len(r.H) > 0 { + params["h"] = strings.Join(r.H, ",") + } + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if len(r.Sort) > 0 { + params["s"] = strings.Join(r.Sort, ",") + } + + if r.Time != "" { + params["time"] = r.Time + } + + if r.V != nil { + params["v"] = strconv.FormatBool(*r.V) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + params["format"] = "json" + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-shards.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-shards.go new file mode 100644 index 000000000..a87d8d3ac --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-shards.go @@ -0,0 +1,136 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// CatShardsReq represent possible options for the /_cat/shards request +type CatShardsReq struct { + Indices []string + Header http.Header + Params CatShardsParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r CatShardsReq) GetRequest() (*http.Request, error) { + indices := strings.Join(r.Indices, ",") + var path strings.Builder + path.Grow(len("/_cat/shards/") + len(indices)) + path.WriteString("/_cat/shards") + if len(r.Indices) > 0 { + path.WriteString("/") + path.WriteString(indices) + } + return opensearch.BuildRequest( + "GET", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// CatShardsResp represents the returned struct of the /_cat/shards response +type CatShardsResp struct { + Shards []CatShardResp + response *opensearch.Response +} + +// CatShardResp represents one index of the CatShardsResp +type CatShardResp struct { + Index string `json:"index"` + Shard int `json:"shard,string"` + Prirep string `json:"prirep"` + State string `json:"state"` + Docs *string `json:"docs"` + Store *string `json:"store"` + IP *string `json:"ip"` + ID *string `json:"id"` + Node *string `json:"node"` + SyncID *string `json:"sync_id"` + UnassignedReason *string `json:"unassigned.reason"` + UnassignedAt *string `json:"unassigned.at"` + UnassignedFor *string `json:"unassigned.for"` + UnassignedDetails *string `json:"unassigned.details"` + RecoverysourceType *string `json:"recoverysource.type"` + CompletionSize *string `json:"completion.size"` + FielddataMemorySize *string `json:"fielddata.memory_size"` + FielddataEvictions *int `json:"fielddata.evictions,string"` + QueryCacheMemorySize *string `json:"query_cache.memory_size"` + QueryCacheEvictions *int `json:"query_cache.evictions,string"` + FlushTotal *int `json:"flush.total,string"` + FlushTotalTime *string `json:"flush.total_time"` + GetCurrent *int `json:"get.current,string"` + GetTime *string `json:"get.time"` + GetTotal *int `json:"get.total,string"` + GetExistsTime *string `json:"get.exists_time"` + GetExistsTotal *int `json:"get.exists_total,string"` + GetMissingTime *string `json:"get.missing_time"` + GetMissingTotal *int `json:"get.missing_total,string"` + IndexingDeleteCurrent *int `json:"indexing.delete_current,string"` + IndexingDeleteTime *string `json:"indexing.delete_time"` + IndexingDeleteTotal *string `json:"indexing.delete_total"` + IndexingIndexCurrent *int `json:"indexing.index_current,string"` + IndexingIndexTime *string `json:"indexing.index_time"` + IndexingIndexTotal *int `json:"indexing.index_total,string"` + IndexingIndexFailed *int `json:"indexing.index_failed,string"` + MergesCurrent *int `json:"merges.current,string"` + MergesCurrentDocs *int `json:"merges.current_docs,string"` + MergesCurrentSize *string `json:"merges.current_size"` + MergesTotal *int `json:"merges.total,string"` + MergesTotalDocs *int `json:"merges.total_docs,string"` + MergesTotalSize *string `json:"merges.total_size"` + MergesTotalTime *string `json:"merges.total_time"` + RefreshTotal *int `json:"refresh.total,string"` + RefreshTime *string `json:"refresh.time"` + RefreshExternalTotal *int `json:"refresh.external_total,string"` + RefreshExternalTime *string `json:"refresh.external_time"` + RefreshListeners *int `json:"refresh.listeners,string"` + SearchFetchCurrent *int `json:"search.fetch_current,string"` + SearchFetchTime *string `json:"search.fetch_time"` + SearchFetchTotal *int `json:"search.fetch_total,string"` + SearchOpenContexts *int `json:"search.open_contexts,string"` + SearchQueryCurrent *int `json:"search.query_current,string"` + SearchQueryTime *string `json:"search.query_time"` + SearchQueryTotal *int `json:"search.query_total,string"` + SearchConcurrentQueryCurrent *int `json:"search.concurrent_query_current,string"` + SearchConcurrentQueryTime *string `json:"search.concurrent_query_time"` + SearchConcurrentQueryTotal *int `json:"search.concurrent_query_total,string"` + SearchConcurrentAvgSliceCount *string `json:"search.concurrent_avg_slice_count"` + SearchScrollCurrent *int `json:"search.scroll_current,string"` + SearchScrollTime *string `json:"search.scroll_time"` + SearchScrollTotal *int `json:"search.scroll_total,string"` + SearchPointInTimeCurrent *int `json:"search.point_in_time_current,string"` + SearchPointInTimeTime *string `json:"search.point_in_time_time"` + SearchPointInTimeTotal *int `json:"search.point_in_time_total,string"` + SegmentsCount *int `json:"segments.count,string"` + SegmentsMemory *string `json:"segments.memory"` + SegmentsIndexWriterMemory *string `json:"segments.index_writer_memory"` + SegmentsVersionMapMemory *string `json:"segments.version_map_memory"` + SegmentsFixedBitsetMemory *string `json:"segments.fixed_bitset_memory"` + SeqNoMax *int `json:"seq_no.max,string"` + SeqNoLocalCheckpoint *int `json:"seq_no.local_checkpoint,string"` + SeqNoGlobalCheckpoint *int `json:"seq_no.global_checkpoint,string"` + WarmerCurrent *int `json:"warmer.current,string"` + WarmerTotal *int `json:"warmer.total,string"` + WarmerTotalTime *string `json:"warmer.total_time"` + PathData *string `json:"path.data"` + PathState *string `json:"path.state"` + DocsDeleted *int `json:"docs.deleted,string"` +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r CatShardsResp) Inspect() Inspect { + return Inspect{ + Response: r.response, + } +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-snapshots-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-snapshots-params.go new file mode 100644 index 000000000..16cec68ae --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-snapshots-params.go @@ -0,0 +1,96 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" + "time" +) + +// CatSnapshotsParams represents possible parameters for the CatSnapshotsReq +type CatSnapshotsParams struct { + H []string + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Sort []string + Time string + V *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r CatSnapshotsParams) get() map[string]string { + params := make(map[string]string) + + if len(r.H) > 0 { + params["h"] = strings.Join(r.H, ",") + } + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if len(r.Sort) > 0 { + params["s"] = strings.Join(r.Sort, ",") + } + + if r.Time != "" { + params["time"] = r.Time + } + + if r.V != nil { + params["v"] = strconv.FormatBool(*r.V) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + params["format"] = "json" + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-snapshots.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-snapshots.go new file mode 100644 index 000000000..0e150b0a5 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-snapshots.go @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// CatSnapshotsReq represent possible options for the /_cat/snapshots request +type CatSnapshotsReq struct { + Repository string + Header http.Header + Params CatSnapshotsParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r CatSnapshotsReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "GET", + fmt.Sprintf("%s%s", "/_cat/snapshots/", r.Repository), + nil, + r.Params.get(), + r.Header, + ) +} + +// CatSnapshotsResp represents the returned struct of the /_cat/snapshots response +type CatSnapshotsResp struct { + Snapshots []CatSnapshotResp + response *opensearch.Response +} + +// CatSnapshotResp represents one index of the CatSnapshotsResp +type CatSnapshotResp struct { + ID string `json:"id"` + Status string `json:"status"` + StartEpoch int `json:"start_epoch,string"` + StartTime string `json:"start_time"` + EndEpoch int `json:"end_epoch,string"` + EndTime string `json:"end_time"` + Duration string `json:"duration"` + Indices int `json:"indices,string"` + SuccessfulShards int `json:"successful_shards,string"` + FailedShards int `json:"failed_shards,string"` + TotalShards int `json:"total_shards,string"` + Reason string `json:"reason"` +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r CatSnapshotsResp) Inspect() Inspect { + return Inspect{ + Response: r.response, + } +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-tasks-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-tasks-params.go new file mode 100644 index 000000000..c120d18a6 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-tasks-params.go @@ -0,0 +1,105 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" +) + +// CatTasksParams represents possible parameters for the CatTasksReq +type CatTasksParams struct { + Actions []string + Detailed *bool + H []string + Nodes []string + ParentTaskID string + Local *bool + Sort []string + Time string + V *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r CatTasksParams) get() map[string]string { + params := make(map[string]string) + + if len(r.Actions) > 0 { + params["actions"] = strings.Join(r.Actions, ",") + } + + if r.Detailed != nil { + params["detailed"] = strconv.FormatBool(*r.Detailed) + } + + if len(r.H) > 0 { + params["h"] = strings.Join(r.H, ",") + } + + if len(r.Nodes) > 0 { + params["nodes"] = strings.Join(r.Nodes, ",") + } + + if r.ParentTaskID != "" { + params["parent_task_id"] = r.ParentTaskID + } + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if len(r.Sort) > 0 { + params["s"] = strings.Join(r.Sort, ",") + } + + if r.Time != "" { + params["time"] = r.Time + } + + if r.V != nil { + params["v"] = strconv.FormatBool(*r.V) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + params["format"] = "json" + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-tasks.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-tasks.go new file mode 100644 index 000000000..5a92399c1 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-tasks.go @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// CatTasksReq represent possible options for the /_cat/tasks request +type CatTasksReq struct { + Header http.Header + Params CatTasksParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r CatTasksReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "GET", + "/_cat/tasks", + nil, + r.Params.get(), + r.Header, + ) +} + +// CatTasksResp represents the returned struct of the /_cat/tasks response +type CatTasksResp struct { + Tasks []CatTaskResp + response *opensearch.Response +} + +// CatTaskResp represents one index of the CatTasksResp +type CatTaskResp struct { + ID string `json:"id"` + Action string `json:"action"` + TaskID string `json:"task_id"` + ParentTaskID string `json:"parent_task_id"` + Type string `json:"type"` + StartTime int `json:"start_time,string"` + Timestamp string `json:"timestamp"` + RunningTimeNs int `json:"running_time_ns,string"` + RunningTime string `json:"running_time"` + NodeID string `json:"node_id"` + IP string `json:"ip"` + Port int `json:"port,string"` + Node string `json:"node"` + Version string `json:"version"` + XOpaqueID string `json:"x_opaque_id"` +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r CatTasksResp) Inspect() Inspect { + return Inspect{ + Response: r.response, + } +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-templates-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-templates-params.go new file mode 100644 index 000000000..71a028742 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-templates-params.go @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" + "time" +) + +// CatTemplatesParams represents possible parameters for the CatTemplatesReq +type CatTemplatesParams struct { + H []string + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Sort []string + V *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r CatTemplatesParams) get() map[string]string { + params := make(map[string]string) + + if len(r.H) > 0 { + params["h"] = strings.Join(r.H, ",") + } + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if len(r.Sort) > 0 { + params["s"] = strings.Join(r.Sort, ",") + } + + if r.V != nil { + params["v"] = strconv.FormatBool(*r.V) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + params["format"] = "json" + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-templates.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-templates.go new file mode 100644 index 000000000..a92eb8b88 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-templates.go @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// CatTemplatesReq represent possible options for the /_cat/templates request +type CatTemplatesReq struct { + Templates []string + Header http.Header + Params CatTemplatesParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r CatTemplatesReq) GetRequest() (*http.Request, error) { + templates := strings.Join(r.Templates, ",") + var path strings.Builder + path.Grow(len("/_cat/templates/") + len(templates)) + path.WriteString("/_cat/templates") + if len(r.Templates) > 0 { + path.WriteString("/") + path.WriteString(templates) + } + return opensearch.BuildRequest( + "GET", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// CatTemplatesResp represents the returned struct of the /_cat/templates response +type CatTemplatesResp struct { + Templates []CatTemplateResp + response *opensearch.Response +} + +// CatTemplateResp represents one index of the CatTemplatesResp +type CatTemplateResp struct { + Name string `json:"name"` + IndexPatterns string `json:"index_patterns"` + Order int `json:"order,string"` + Version *string `json:"version"` + ComposedOf string `json:"composed_of"` +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r CatTemplatesResp) Inspect() Inspect { + return Inspect{ + Response: r.response, + } +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-thread_pool-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-thread_pool-params.go new file mode 100644 index 000000000..b84c961f7 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-thread_pool-params.go @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" + "time" +) + +// CatThreadPoolParams represents possible parameters for the CatThreadPoolReq +type CatThreadPoolParams struct { + H []string + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Sort []string + V *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r CatThreadPoolParams) get() map[string]string { + params := make(map[string]string) + + if len(r.H) > 0 { + params["h"] = strings.Join(r.H, ",") + } + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if len(r.Sort) > 0 { + params["s"] = strings.Join(r.Sort, ",") + } + + if r.V != nil { + params["v"] = strconv.FormatBool(*r.V) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + params["format"] = "json" + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-thread_pool.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-thread_pool.go new file mode 100644 index 000000000..71193804c --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat-thread_pool.go @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// CatThreadPoolReq represent possible options for the /_cat/thread_pool request +type CatThreadPoolReq struct { + Pools []string + Header http.Header + Params CatThreadPoolParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r CatThreadPoolReq) GetRequest() (*http.Request, error) { + pools := strings.Join(r.Pools, ",") + var path strings.Builder + path.Grow(len("/_cat/thread_pool/") + len(pools)) + path.WriteString("/_cat/thread_pool") + if len(r.Pools) > 0 { + path.WriteString("/") + path.WriteString(pools) + } + return opensearch.BuildRequest( + "GET", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// CatThreadPoolResp represents the returned struct of the /_cat/thread_pool response +type CatThreadPoolResp struct { + ThreadPool []CatThreadPoolItemResp + response *opensearch.Response +} + +// CatThreadPoolItemResp represents one index of the CatThreadPoolResp +type CatThreadPoolItemResp struct { + NodeName string `json:"node_name"` + NodeID string `json:"node_id"` + EphemeralNodeID string `json:"ephemeral_node_id"` + PID int `json:"pid,string"` + Host string `json:"host"` + IP string `json:"ip"` + Port int `json:"port,string"` + Name string `json:"name"` + Type string `json:"type"` + Active int `json:"active,string"` + PoolSize int `json:"pool_size,string"` + Queue int `json:"queue,string"` + QueueSize int `json:"queue_size,string"` + Rejected int `json:"rejected,string"` + Largest int `json:"largest,string"` + Completed int `json:"completed,string"` + Core *int `json:"core,string"` + Max *int `json:"max,string"` + Size *int `json:"size,string"` + KeepAlive *string `json:"keep_alive"` + TotalWaitTime string `json:"total_wait_time"` +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r CatThreadPoolResp) Inspect() Inspect { + return Inspect{ + Response: r.response, + } +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat.go new file mode 100644 index 000000000..7ddd0f4aa --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cat.go @@ -0,0 +1,351 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" +) + +type catClient struct { + apiClient *Client +} + +// Aliases executes a /_cat/aliases request with the optional CatAliasesReq +func (c catClient) Aliases(ctx context.Context, req *CatAliasesReq) (*CatAliasesResp, error) { + if req == nil { + req = &CatAliasesReq{} + } + + var ( + data CatAliasesResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data.Aliases); err != nil { + return &data, err + } + + return &data, nil +} + +// Allocation executes a /_cat/allocation request with the optional CatAllocationReq +func (c catClient) Allocation(ctx context.Context, req *CatAllocationReq) (*CatAllocationsResp, error) { + if req == nil { + req = &CatAllocationReq{} + } + + var ( + data CatAllocationsResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data.Allocations); err != nil { + return &data, err + } + + return &data, nil +} + +// ClusterManager executes a /_cat/cluster_manager request with the optional CatClusterManagerReq +func (c catClient) ClusterManager(ctx context.Context, req *CatClusterManagerReq) (*CatClusterManagersResp, error) { + if req == nil { + req = &CatClusterManagerReq{} + } + + var ( + data CatClusterManagersResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data.ClusterManagers); err != nil { + return &data, err + } + + return &data, nil +} + +// Count executes a /_cat/count request with the optional CatCountReq +func (c catClient) Count(ctx context.Context, req *CatCountReq) (*CatCountsResp, error) { + if req == nil { + req = &CatCountReq{} + } + + var ( + data CatCountsResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data.Counts); err != nil { + return &data, err + } + + return &data, nil +} + +// FieldData executes a /_cat/fielddata request with the optional CatFieldDataReq +func (c catClient) FieldData(ctx context.Context, req *CatFieldDataReq) (*CatFieldDataResp, error) { + if req == nil { + req = &CatFieldDataReq{} + } + + var ( + data CatFieldDataResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data.FieldData); err != nil { + return &data, err + } + + return &data, nil +} + +// Health executes a /_cat/health request with the optional CatHealthReq +func (c catClient) Health(ctx context.Context, req *CatHealthReq) (*CatHealthResp, error) { + if req == nil { + req = &CatHealthReq{} + } + + var ( + data CatHealthResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data.Health); err != nil { + return &data, err + } + + return &data, nil +} + +// Indices executes a /_cat/indices request with the optional CatIndicesReq +func (c catClient) Indices(ctx context.Context, req *CatIndicesReq) (*CatIndicesResp, error) { + if req == nil { + req = &CatIndicesReq{} + } + + var ( + data CatIndicesResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data.Indices); err != nil { + return &data, err + } + + return &data, nil +} + +// Master executes a /_cat/master request with the optional CatMasterReq +func (c catClient) Master(ctx context.Context, req *CatMasterReq) (*CatMasterResp, error) { + if req == nil { + req = &CatMasterReq{} + } + + var ( + data CatMasterResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data.Master); err != nil { + return &data, err + } + + return &data, nil +} + +// NodeAttrs executes a /_cat/nodeattrs request with the optional CatNodeAttrsReq +func (c catClient) NodeAttrs(ctx context.Context, req *CatNodeAttrsReq) (*CatNodeAttrsResp, error) { + if req == nil { + req = &CatNodeAttrsReq{} + } + + var ( + data CatNodeAttrsResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data.NodeAttrs); err != nil { + return &data, err + } + + return &data, nil +} + +// Nodes executes a /_cat/nodes request with the optional CatNodesReq +func (c catClient) Nodes(ctx context.Context, req *CatNodesReq) (*CatNodesResp, error) { + if req == nil { + req = &CatNodesReq{} + } + + var ( + data CatNodesResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data.Nodes); err != nil { + return &data, err + } + + return &data, nil +} + +// PendingTasks executes a /_cat/pending_tasks request with the optional CatPendingTasksReq +func (c catClient) PendingTasks(ctx context.Context, req *CatPendingTasksReq) (*CatPendingTasksResp, error) { + if req == nil { + req = &CatPendingTasksReq{} + } + + var ( + data CatPendingTasksResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data.PendingTasks); err != nil { + return &data, err + } + + return &data, nil +} + +// Plugins executes a /_cat/plugins request with the optional CatPluginsReq +func (c catClient) Plugins(ctx context.Context, req *CatPluginsReq) (*CatPluginsResp, error) { + if req == nil { + req = &CatPluginsReq{} + } + + var ( + data CatPluginsResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data.Plugins); err != nil { + return &data, err + } + + return &data, nil +} + +// Recovery executes a /_cat/recovery request with the optional CatRecoveryReq +func (c catClient) Recovery(ctx context.Context, req *CatRecoveryReq) (*CatRecoveryResp, error) { + if req == nil { + req = &CatRecoveryReq{} + } + + var ( + data CatRecoveryResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data.Recovery); err != nil { + return &data, err + } + + return &data, nil +} + +// Repositories executes a /_cat/repositories request with the optional CatRepositoriesReq +func (c catClient) Repositories(ctx context.Context, req *CatRepositoriesReq) (*CatRepositoriesResp, error) { + if req == nil { + req = &CatRepositoriesReq{} + } + + var ( + data CatRepositoriesResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data.Repositories); err != nil { + return &data, err + } + + return &data, nil +} + +// Segments executes a /_cat/segments request with the optional CatSegmentsReq +func (c catClient) Segments(ctx context.Context, req *CatSegmentsReq) (*CatSegmentsResp, error) { + if req == nil { + req = &CatSegmentsReq{} + } + + var ( + data CatSegmentsResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data.Segments); err != nil { + return &data, err + } + + return &data, nil +} + +// Shards executes a /_cat/shards request with the optional CatShardsReq +func (c catClient) Shards(ctx context.Context, req *CatShardsReq) (*CatShardsResp, error) { + if req == nil { + req = &CatShardsReq{} + } + + var ( + data CatShardsResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data.Shards); err != nil { + return &data, err + } + + return &data, nil +} + +// Snapshots executes a /_cat/snapshots request with the required CatSnapshotsReq +func (c catClient) Snapshots(ctx context.Context, req CatSnapshotsReq) (*CatSnapshotsResp, error) { + var ( + data CatSnapshotsResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data.Snapshots); err != nil { + return &data, err + } + + return &data, nil +} + +// Tasks executes a /_cat/tasks request with the optional CatTasksReq +func (c catClient) Tasks(ctx context.Context, req *CatTasksReq) (*CatTasksResp, error) { + if req == nil { + req = &CatTasksReq{} + } + + var ( + data CatTasksResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data.Tasks); err != nil { + return &data, err + } + + return &data, nil +} + +// Templates executes a /_cat/templates request with the optional CatTemplatesReq +func (c catClient) Templates(ctx context.Context, req *CatTemplatesReq) (*CatTemplatesResp, error) { + if req == nil { + req = &CatTemplatesReq{} + } + + var ( + data CatTemplatesResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data.Templates); err != nil { + return &data, err + } + + return &data, nil +} + +// ThreadPool executes a /_cat/thread_pool request with the optional CatThreadPoolReq +func (c catClient) ThreadPool(ctx context.Context, req *CatThreadPoolReq) (*CatThreadPoolResp, error) { + if req == nil { + req = &CatThreadPoolReq{} + } + + var ( + data CatThreadPoolResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data.ThreadPool); err != nil { + return &data, err + } + + return &data, nil +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-allocation_explain-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-allocation_explain-params.go new file mode 100644 index 000000000..bd31edfdb --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-allocation_explain-params.go @@ -0,0 +1,67 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" +) + +// ClusterAllocationExplainParams represents possible parameters for the ClusterAllocationExplainReq +type ClusterAllocationExplainParams struct { + IncludeDiskInfo *bool + IncludeYesDecisions *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r ClusterAllocationExplainParams) get() map[string]string { + params := make(map[string]string) + + if r.IncludeDiskInfo != nil { + params["include_disk_info"] = strconv.FormatBool(*r.IncludeDiskInfo) + } + + if r.IncludeYesDecisions != nil { + params["include_yes_decisions"] = strconv.FormatBool(*r.IncludeYesDecisions) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-allocation_explain.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-allocation_explain.go new file mode 100644 index 000000000..2e9622a3e --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-allocation_explain.go @@ -0,0 +1,112 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "bytes" + "encoding/json" + "io" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// ClusterAllocationExplainReq represents possible options for the /_nodes request +type ClusterAllocationExplainReq struct { + Body *ClusterAllocationExplainBody + Header http.Header + Params ClusterAllocationExplainParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r ClusterAllocationExplainReq) GetRequest() (*http.Request, error) { + var reader io.Reader + + if r.Body != nil { + body, err := json.Marshal(r.Body) + if err != nil { + return nil, err + } + + reader = bytes.NewReader(body) + } + + return opensearch.BuildRequest( + "GET", + "/_cluster/allocation/explain", + reader, + r.Params.get(), + r.Header, + ) +} + +// ClusterAllocationExplainBody represents the optional Body for the ClusterAllocationExplainReq +type ClusterAllocationExplainBody struct { + Index string `json:"index"` + Shard int `json:"shard"` + Primary bool `json:"primary"` +} + +// ClusterAllocationExplainResp represents the returned struct of the /_nodes response +type ClusterAllocationExplainResp struct { + Index string `json:"index"` + Shard int `json:"shard"` + Primary bool `json:"primary"` + CurrentState string `json:"current_state"` + CurrentNode ClusterAllocationCurrentNode `json:"current_node"` + UnassignedInfo struct { + Reason string `json:"reason"` + At string `json:"at"` + LastAllocationStatus string `json:"last_allocation_status"` + } `json:"unassigned_info"` + CanAllocate string `json:"can_allocate"` + CanRemainOnCurrentNode string `json:"can_remain_on_current_node"` + CanRebalanceCluster string `json:"can_rebalance_cluster"` + CanRebalanceToOtherNode string `json:"can_rebalance_to_other_node"` + RebalanceExplanation string `json:"rebalance_explanation"` + AllocateExplanation string `json:"allocate_explanation"` + NodeAllocationDecisions []ClusterAllocationNodeDecisions `json:"node_allocation_decisions"` + CanRebalanceClusterDecisions []ClusterAllocationExplainDeciders `json:"can_rebalance_cluster_decisions"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r ClusterAllocationExplainResp) Inspect() Inspect { + return Inspect{Response: r.response} +} + +// ClusterAllocationCurrentNode is a sub type of ClusterAllocationExplainResp containing information of the node the shard is on +type ClusterAllocationCurrentNode struct { + NodeID string `json:"id"` + NodeName string `json:"name"` + TransportAddress string `json:"transport_address"` + NodeAttributes struct { + ShardIndexingPressureEnabled string `json:"shard_indexing_pressure_enabled"` + } `json:"attributes"` + WeightRanking int `json:"weight_ranking"` +} + +// ClusterAllocationNodeDecisions is a sub type of ClusterAllocationExplainResp containing information of a node allocation decission +type ClusterAllocationNodeDecisions struct { + NodeID string `json:"node_id"` + NodeName string `json:"node_name"` + TransportAddress string `json:"transport_address"` + NodeAttributes struct { + ShardIndexingPressureEnabled string `json:"shard_indexing_pressure_enabled"` + } `json:"node_attributes"` + NodeDecision string `json:"node_decision"` + WeightRanking int `json:"weight_ranking"` + Deciders []ClusterAllocationExplainDeciders `json:"deciders"` +} + +// ClusterAllocationExplainDeciders is a sub type of ClusterAllocationExplainResp and +// ClusterAllocationNodeDecisions containing inforamtion about Deciders decissions +type ClusterAllocationExplainDeciders struct { + Decider string `json:"decider"` + Decision string `json:"decision"` + Explanation string `json:"explanation"` +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-decommission-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-decommission-params.go new file mode 100644 index 000000000..b09080c1a --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-decommission-params.go @@ -0,0 +1,102 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +// ClusterPutDecommissionParams represents possible parameters for the ClusterPutDecommissionReq +type ClusterPutDecommissionParams struct { + Pretty bool + Human bool + ErrorTrace bool +} + +func (r ClusterPutDecommissionParams) get() map[string]string { + params := make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} + +// ClusterGetDecommissionParams represents possible parameters for the ClusterGetDecommissionReq +type ClusterGetDecommissionParams struct { + Pretty bool + Human bool + ErrorTrace bool +} + +func (r ClusterGetDecommissionParams) get() map[string]string { + params := make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} + +// ClusterDeleteDecommissionParams represents possible parameters for the ClusterDeleteDecommissionReq +type ClusterDeleteDecommissionParams struct { + Pretty bool + Human bool + ErrorTrace bool +} + +func (r ClusterDeleteDecommissionParams) get() map[string]string { + params := make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-decommission.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-decommission.go new file mode 100644 index 000000000..d88d05810 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-decommission.go @@ -0,0 +1,116 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// ClusterPutDecommissionReq represents possible options for the /_cluster/decommission/awareness request +type ClusterPutDecommissionReq struct { + AwarenessAttrName string + AwarenessAttrValue string + + Header http.Header + Params ClusterPutDecommissionParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r ClusterPutDecommissionReq) GetRequest() (*http.Request, error) { + var path strings.Builder + path.Grow(34 + len(r.AwarenessAttrName) + len(r.AwarenessAttrValue)) + path.WriteString("/_cluster/decommission/awareness/") + path.WriteString(r.AwarenessAttrName) + path.WriteString("/") + path.WriteString(r.AwarenessAttrValue) + + return opensearch.BuildRequest( + "PUT", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// ClusterPutDecommissionResp represents the returned struct of the /_cluster/decommission/awareness response +type ClusterPutDecommissionResp struct { + Acknowledged bool `json:"acknowledged"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r ClusterPutDecommissionResp) Inspect() Inspect { + return Inspect{Response: r.response} +} + +// ClusterDeleteDecommissionReq represents possible options for the /_cluster/decommission/awareness request +type ClusterDeleteDecommissionReq struct { + Header http.Header + Params ClusterDeleteDecommissionParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r ClusterDeleteDecommissionReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "DELETE", + "/_cluster/decommission/awareness", + nil, + r.Params.get(), + r.Header, + ) +} + +// ClusterDeleteDecommissionResp represents the returned struct of the /_cluster/decommission/awareness response +type ClusterDeleteDecommissionResp struct { + Acknowledged bool `json:"acknowledged"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r ClusterDeleteDecommissionResp) Inspect() Inspect { + return Inspect{Response: r.response} +} + +// ClusterGetDecommissionReq represents possible options for the /_cluster/decommission/awareness request +type ClusterGetDecommissionReq struct { + AwarenessAttrName string + + Header http.Header + Params ClusterGetDecommissionParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r ClusterGetDecommissionReq) GetRequest() (*http.Request, error) { + var path strings.Builder + path.Grow(41 + len(r.AwarenessAttrName)) + path.WriteString("/_cluster/decommission/awareness/") + path.WriteString(r.AwarenessAttrName) + path.WriteString("/_status") + + return opensearch.BuildRequest( + "GET", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// ClusterGetDecommissionResp represents the returned struct of the /_cluster/decommission/awareness response +type ClusterGetDecommissionResp struct { + Values map[string]string + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r ClusterGetDecommissionResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-health-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-health-params.go new file mode 100644 index 000000000..ad2add7f7 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-health-params.go @@ -0,0 +1,118 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// ClusterHealthParams represents possible parameters for the ClusterHealthReq +type ClusterHealthParams struct { + ExpandWildcards string + Level string + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + WaitForActiveShards string + WaitForEvents string + WaitForNoInitializingShards *bool + WaitForNoRelocatingShards *bool + WaitForNodes string + WaitForStatus string + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r ClusterHealthParams) get() map[string]string { + params := make(map[string]string) + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if r.Level != "" { + params["level"] = r.Level + } + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.WaitForActiveShards != "" { + params["wait_for_active_shards"] = r.WaitForActiveShards + } + + if r.WaitForEvents != "" { + params["wait_for_events"] = r.WaitForEvents + } + + if r.WaitForNoInitializingShards != nil { + params["wait_for_no_initializing_shards"] = strconv.FormatBool(*r.WaitForNoInitializingShards) + } + + if r.WaitForNoRelocatingShards != nil { + params["wait_for_no_relocating_shards"] = strconv.FormatBool(*r.WaitForNoRelocatingShards) + } + + if r.WaitForNodes != "" { + params["wait_for_nodes"] = r.WaitForNodes + } + + if r.WaitForStatus != "" { + params["wait_for_status"] = r.WaitForStatus + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-health.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-health.go new file mode 100644 index 000000000..a92873757 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-health.go @@ -0,0 +1,69 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// ClusterHealthReq represents possible options for the /_cluster/health request +type ClusterHealthReq struct { + Indices []string + Header http.Header + Params ClusterHealthParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r ClusterHealthReq) GetRequest() (*http.Request, error) { + indices := strings.Join(r.Indices, ",") + + var path strings.Builder + path.Grow(17 + len(indices)) + path.WriteString("/_cluster/health") + if len(indices) > 0 { + path.WriteString("/") + path.WriteString(indices) + } + + return opensearch.BuildRequest( + "GET", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// ClusterHealthResp represents the returned struct of the ClusterHealthReq response +type ClusterHealthResp struct { + ClusterName string `json:"cluster_name"` + Status string `json:"status"` + TimedOut bool `json:"timed_out"` + NumberOfNodes int `json:"number_of_nodes"` + NumberOfDataNodes int `json:"number_of_data_nodes"` + DiscoveredMaster bool `json:"discovered_master"` + DiscoveredClusterManager bool `json:"discovered_cluster_manager"` + ActivePrimaryShards int `json:"active_primary_shards"` + ActiveShards int `json:"active_shards"` + RelocatingShards int `json:"relocating_shards"` + InitializingShards int `json:"initializing_shards"` + UnassignedShards int `json:"unassigned_shards"` + DelayedUnassignedShards int `json:"delayed_unassigned_shards"` + NumberOfPendingTasks int `json:"number_of_pending_tasks"` + NumberOfInFlightFetch int `json:"number_of_in_flight_fetch"` + TaskMaxWaitingInQueueMillis int `json:"task_max_waiting_in_queue_millis"` + ActiveShardsPercentAsNumber float64 `json:"active_shards_percent_as_number"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r ClusterHealthResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-pending_tasks-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-pending_tasks-params.go new file mode 100644 index 000000000..e3a7b64a2 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-pending_tasks-params.go @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// ClusterPendingTasksParams represents possible parameters for the ClusterPendingTasksReq +type ClusterPendingTasksParams struct { + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Pretty bool + Human bool + ErrorTrace bool +} + +func (r ClusterPendingTasksParams) get() map[string]string { + params := make(map[string]string) + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-pending_tasks.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-pending_tasks.go new file mode 100644 index 000000000..56bfb7532 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-pending_tasks.go @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// ClusterPendingTasksReq represents possible options for the /_cluster/pending_tasks request +type ClusterPendingTasksReq struct { + Header http.Header + Params ClusterPendingTasksParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r ClusterPendingTasksReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "GET", + "/_cluster/pending_tasks", + nil, + r.Params.get(), + r.Header, + ) +} + +// ClusterPendingTasksResp represents the returned struct of the ClusterPendingTasksReq response +type ClusterPendingTasksResp struct { + Tasks []ClusterPendingTasksItem `json:"tasks"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r ClusterPendingTasksResp) Inspect() Inspect { + return Inspect{Response: r.response} +} + +// ClusterPendingTasksItem is a sub type if ClusterPendingTasksResp containing information about a task +type ClusterPendingTasksItem struct { + InsertOrder int `json:"insert_order"` + Priority string `json:"priority"` + Source string `json:"source"` + TimeInQueueMillis int `json:"time_in_queue_millis"` + TimeInQueue string `json:"time_in_queue"` + Executing bool `json:"executing"` +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-remote_info-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-remote_info-params.go new file mode 100644 index 000000000..6c99b9d97 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-remote_info-params.go @@ -0,0 +1,52 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +// ClusterRemoteInfoParams represents possible parameters for the ClusterRemoteInfoReq +type ClusterRemoteInfoParams struct { + Pretty bool + Human bool + ErrorTrace bool +} + +func (r ClusterRemoteInfoParams) get() map[string]string { + params := make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-remote_info.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-remote_info.go new file mode 100644 index 000000000..b4b265f6c --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-remote_info.go @@ -0,0 +1,52 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// ClusterRemoteInfoReq represents possible options for the /_remote/info request +type ClusterRemoteInfoReq struct { + Header http.Header + Params ClusterRemoteInfoParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r ClusterRemoteInfoReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "GET", + "/_remote/info", + nil, + r.Params.get(), + r.Header, + ) +} + +// ClusterRemoteInfoResp represents the returned struct of the ClusterRemoteInfoReq response +type ClusterRemoteInfoResp struct { + Clusters map[string]ClusterRemoteInfoDetails + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r ClusterRemoteInfoResp) Inspect() Inspect { + return Inspect{Response: r.response} +} + +// ClusterRemoteInfoDetails is a sub type of ClusterRemoteInfoResp contains information about a remote connection +type ClusterRemoteInfoDetails struct { + Connected bool `json:"connected"` + Mode string `json:"mode"` + Seeds []string `json:"seeds"` + NumNodesConnected int `json:"num_nodes_connected"` + MaxConnectionsPerCluster int `json:"max_connections_per_cluster"` + InitialConnectTimeout string `json:"initial_connect_timeout"` + SkipUnavailable bool `json:"skip_unavailable"` +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-reroute-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-reroute-params.go new file mode 100644 index 000000000..f2caf5f3a --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-reroute-params.go @@ -0,0 +1,94 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" + "time" +) + +// ClusterRerouteParams represents possible parameters for the ClusterRerouteReq +type ClusterRerouteParams struct { + DryRun *bool + Explain *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Metric []string + RetryFailed *bool + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r ClusterRerouteParams) get() map[string]string { + params := make(map[string]string) + + if r.DryRun != nil { + params["dry_run"] = strconv.FormatBool(*r.DryRun) + } + + if r.Explain != nil { + params["explain"] = strconv.FormatBool(*r.Explain) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if len(r.Metric) > 0 { + params["metric"] = strings.Join(r.Metric, ",") + } + + if r.RetryFailed != nil { + params["retry_failed"] = strconv.FormatBool(*r.RetryFailed) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-reroute.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-reroute.go new file mode 100644 index 000000000..2178ca6db --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-reroute.go @@ -0,0 +1,75 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "encoding/json" + "io" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// ClusterRerouteReq represents possible options for the /_cluster/reroute request +type ClusterRerouteReq struct { + Body io.Reader + + Header http.Header + Params ClusterRerouteParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r ClusterRerouteReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "POST", + "/_cluster/reroute", + r.Body, + r.Params.get(), + r.Header, + ) +} + +// ClusterRerouteResp represents the returned struct of the ClusterRerouteReq response +type ClusterRerouteResp struct { + Acknowledged bool `json:"acknowledged"` + State ClusterRerouteState `json:"state"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r ClusterRerouteResp) Inspect() Inspect { + return Inspect{Response: r.response} +} + +// ClusterRerouteState is a sub type of ClusterRerouteResp containing information about the cluster and cluster routing +type ClusterRerouteState struct { + ClusterUUID string `json:"cluster_uuid"` + Version int `json:"version"` + StateUUID string `json:"state_uuid"` + MasterNode string `json:"master_node"` + ClusterManagerNode string `json:"cluster_manager_node"` + Blocks json.RawMessage `json:"blocks"` + Nodes map[string]ClusterStateNodes `json:"nodes"` + RoutingTable struct { + Indices map[string]struct { + Shards map[string][]ClusterStateRoutingIndex `json:"shards"` + } `json:"indices"` + } `json:"routing_table"` + RoutingNodes ClusterStateRoutingNodes `json:"routing_nodes"` + RepositoryCleanup struct { + RepositoryCleanup []json.RawMessage `json:"repository_cleanup"` + } `json:"repository_cleanup"` + SnapshotDeletions struct { + SnapshotDeletions []json.RawMessage `json:"snapshot_deletions"` + } `json:"snapshot_deletions"` + Snapshots struct { + Snapshots []json.RawMessage `json:"snapshots"` + } `json:"snapshots"` + Restore struct { + Snapshots []json.RawMessage `json:"snapshots"` + } `json:"restore"` +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-settings-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-settings-params.go new file mode 100644 index 000000000..7cd53f814 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-settings-params.go @@ -0,0 +1,129 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// ClusterGetSettingsParams represents possible parameters for the ClusterGetSettingsReq +type ClusterGetSettingsParams struct { + FlatSettings *bool + IncludeDefaults *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r ClusterGetSettingsParams) get() map[string]string { + params := make(map[string]string) + + if r.FlatSettings != nil { + params["flat_settings"] = strconv.FormatBool(*r.FlatSettings) + } + + if r.IncludeDefaults != nil { + params["include_defaults"] = strconv.FormatBool(*r.IncludeDefaults) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} + +// ClusterPutSettingsParams represents possible parameters for the ClusterGetSettingsReq +type ClusterPutSettingsParams struct { + FlatSettings *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r ClusterPutSettingsParams) get() map[string]string { + params := make(map[string]string) + + if r.FlatSettings != nil { + params["flat_settings"] = strconv.FormatBool(*r.FlatSettings) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-settings.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-settings.go new file mode 100644 index 000000000..22c11b4ac --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-settings.go @@ -0,0 +1,76 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "encoding/json" + "io" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// ClusterGetSettingsReq represents possible options for the /_cluster/settings request +type ClusterGetSettingsReq struct { + Header http.Header + Params ClusterGetSettingsParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r ClusterGetSettingsReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "GET", + "/_cluster/settings", + nil, + r.Params.get(), + r.Header, + ) +} + +// ClusterGetSettingsResp represents the returned struct of the ClusterGetSettingsReq response +type ClusterGetSettingsResp struct { + Persistent json.RawMessage `json:"persistent"` + Transient json.RawMessage `json:"transient"` + Defaults json.RawMessage `json:"defaults"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r ClusterGetSettingsResp) Inspect() Inspect { + return Inspect{Response: r.response} +} + +// ClusterPutSettingsReq represents possible options for the /_cluster/settings request +type ClusterPutSettingsReq struct { + Body io.Reader + Header http.Header + Params ClusterPutSettingsParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r ClusterPutSettingsReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "PUT", + "/_cluster/settings", + r.Body, + r.Params.get(), + r.Header, + ) +} + +// ClusterPutSettingsResp represents the returned struct of the /_cluster/settings response +type ClusterPutSettingsResp struct { + Acknowledged bool `json:"acknowledged"` + Persistent json.RawMessage `json:"persistent"` + Transient json.RawMessage `json:"transient"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r ClusterPutSettingsResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-state-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-state-params.go new file mode 100644 index 000000000..0ec797439 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-state-params.go @@ -0,0 +1,103 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// ClusterStateParams represents possible parameters for the ClusterStateReq +type ClusterStateParams struct { + AllowNoIndices *bool + ExpandWildcards string + FlatSettings *bool + IgnoreUnavailable *bool + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + WaitForMetadataVersion *int + WaitForTimeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r ClusterStateParams) get() map[string]string { + params := make(map[string]string) + + if r.AllowNoIndices != nil { + params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if r.FlatSettings != nil { + params["flat_settings"] = strconv.FormatBool(*r.FlatSettings) + } + + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.WaitForMetadataVersion != nil { + params["wait_for_metadata_version"] = strconv.FormatInt(int64(*r.WaitForMetadataVersion), 10) + } + + if r.WaitForTimeout != 0 { + params["wait_for_timeout"] = formatDuration(r.WaitForTimeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-state.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-state.go new file mode 100644 index 000000000..c0c3e01e0 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-state.go @@ -0,0 +1,221 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "encoding/json" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// ClusterStateReq represents possible options for the /_cluster/state request +type ClusterStateReq struct { + Metrics []string + Indices []string + + Header http.Header + Params ClusterStateParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r ClusterStateReq) GetRequest() (*http.Request, error) { + indices := strings.Join(r.Indices, ",") + metrics := strings.Join(r.Metrics, ",") + + var path strings.Builder + path.Grow(17 + len(indices) + len(metrics)) + path.WriteString("/_cluster/state") + if len(metrics) > 0 { + path.WriteString("/") + path.WriteString(metrics) + if len(indices) > 0 { + path.WriteString("/") + path.WriteString(indices) + } + } + + return opensearch.BuildRequest( + "GET", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// ClusterStateResp represents the returned struct of the ClusterStateReq response +type ClusterStateResp struct { + ClusterName string `json:"cluster_name"` + ClusterUUID string `json:"cluster_uuid"` + Version int `json:"version"` + StateUUID string `json:"state_uuid"` + MasterNode string `json:"master_node"` + ClusterManagerNode string `json:"cluster_manager_node"` + Blocks struct { + Indices map[string]map[string]ClusterStateBlocksIndex `json:"indices"` + } `json:"blocks"` + Nodes map[string]ClusterStateNodes `json:"nodes"` + Metadata ClusterStateMetaData `json:"metadata"` + response *opensearch.Response + RoutingTable struct { + Indices map[string]struct { + Shards map[string][]ClusterStateRoutingIndex `json:"shards"` + } `json:"indices"` + } `json:"routing_table"` + RoutingNodes ClusterStateRoutingNodes `json:"routing_nodes"` + Snapshots struct { + Snapshots []json.RawMessage `json:"snapshots"` + } `json:"snapshots"` + SnapshotDeletions struct { + SnapshotDeletions []json.RawMessage `json:"snapshot_deletions"` + } `json:"snapshot_deletions"` + RepositoryCleanup struct { + RepositoryCleanup []json.RawMessage `json:"repository_cleanup"` + } `json:"repository_cleanup"` + Restore struct { + Snapshots []json.RawMessage `json:"snapshots"` + } `json:"restore"` +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r ClusterStateResp) Inspect() Inspect { + return Inspect{Response: r.response} +} + +// ClusterStateBlocksIndex is a sub type of ClusterStateResp +type ClusterStateBlocksIndex struct { + Description string `json:"description"` + Retryable bool `json:"retryable"` + Levels []string `json:"levels"` +} + +// ClusterStateNodes is a sub type of ClusterStateResp +type ClusterStateNodes struct { + Name string `json:"name"` + EphemeralID string `json:"ephemeral_id"` + TransportAddress string `json:"transport_address"` + Attributes map[string]string `json:"attributes"` +} + +// ClusterStateMetaData is a sub type if ClusterStateResp containing metadata of the cluster +type ClusterStateMetaData struct { + ClusterUUID string `json:"cluster_uuid"` + ClusterUUIDCommitted bool `json:"cluster_uuid_committed"` + ClusterCoordination struct { + Term int `json:"term"` + LastCommittedConfig []string `json:"last_committed_config"` + LastAcceptedConfig []string `json:"last_accepted_config"` + VotingConfigExclusions []struct { + NodeID string `json:"node_id"` + NodeName string `json:"node_name"` + } `json:"voting_config_exclusions"` + } `json:"cluster_coordination"` + Templates map[string]json.RawMessage `json:"templates"` + Indices map[string]ClusterStateMetaDataIndex `json:"indices"` + IndexGraveyard struct { + Tombstones []struct { + Index struct { + IndexName string `json:"index_name"` + IndexUUID string `json:"index_uuid"` + } `json:"index"` + DeleteDateInMillis int `json:"delete_date_in_millis"` + } `json:"tombstones"` + } `json:"index-graveyard"` + Repositories map[string]struct { + Type string `json:"type"` + Settings map[string]string `json:"settings"` + Generation int `json:"generation"` + PendingGeneration int `json:"pending_generation"` + } `json:"repositories"` + ComponentTemplate struct { + ComponentTemplate map[string]json.RawMessage `json:"component_template"` + } `json:"component_template"` + IndexTemplate struct { + IndexTemplate map[string]json.RawMessage `json:"index_template"` + } `json:"index_template"` + StoredScripts map[string]struct { + Lang string `json:"lang"` + Source string `json:"source"` + } `json:"stored_scripts"` + Ingest struct { + Pipeline []struct { + ID string `json:"id"` + Config struct { + Description string `json:"description"` + Processors json.RawMessage `json:"processors"` + } `json:"config"` + } `json:"pipeline"` + } `json:"ingest"` + DataStream struct { + DataStream map[string]ClusterStateMetaDataStream `json:"data_stream"` + } `json:"data_stream"` +} + +// ClusterStateMetaDataIndex is a sub type of ClusterStateMetaData containing information about an index +type ClusterStateMetaDataIndex struct { + Version int `json:"version"` + MappingVersion int `json:"mapping_version"` + SettingsVersion int `json:"settings_version"` + AliasesVersion int `json:"aliases_version"` + RoutingNumShards int `json:"routing_num_shards"` + State string `json:"state"` + Settings json.RawMessage `json:"settings"` + Mappings json.RawMessage `json:"mappings"` + Aliases []string `json:"aliases"` + PrimaryTerms map[string]int `json:"primary_terms"` + InSyncAllocations map[string][]string `json:"in_sync_allocations"` + RolloverInfo map[string]struct { + MetConditions map[string]string `json:"met_conditions"` + Time int `json:"time"` + } `json:"rollover_info"` + System bool `json:"system"` +} + +// ClusterStateMetaDataStream is a sub type of ClusterStateMetaData containing information about a data stream +type ClusterStateMetaDataStream struct { + Name string `json:"name"` + TimestampField struct { + Name string `json:"name"` + } `json:"timestamp_field"` + Indices []struct { + IndexName string `json:"index_name"` + IndexUUID string `json:"index_uuid"` + } `json:"indices"` + Generation int `json:"generation"` +} + +// ClusterStateRoutingIndex is a sub type of ClusterStateResp and ClusterStateRoutingNodes containing information about shard routing +type ClusterStateRoutingIndex struct { + State string `json:"state"` + Primary bool `json:"primary"` + Node *string `json:"node"` + RelocatingNode *string `json:"relocating_node"` + Shard int `json:"shard"` + Index string `json:"index"` + ExpectedShardSizeInBytes int `json:"expected_shard_size_in_bytes"` + AllocationID *struct { + ID string `json:"id"` + } `json:"allocation_id,omitempty"` + RecoverySource *struct { + Type string `json:"type"` + } `json:"recovery_source,omitempty"` + UnassignedInfo *struct { + Reason string `json:"reason"` + At string `json:"at"` + Delayed bool `json:"delayed"` + AllocationStatus string `json:"allocation_status"` + Details string `json:"details"` + } `json:"unassigned_info,omitempty"` +} + +// ClusterStateRoutingNodes is a sub type of ClusterStateResp containing information about shard assigned to nodes +type ClusterStateRoutingNodes struct { + Unassigned []ClusterStateRoutingIndex `json:"unassigned"` + Nodes map[string][]ClusterStateRoutingIndex `json:"nodes"` +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-stats-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-stats-params.go new file mode 100644 index 000000000..630278753 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-stats-params.go @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "time" +) + +// ClusterStatsParams represents possible parameters for the ClusterStatsReq +type ClusterStatsParams struct { + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r ClusterStatsParams) get() map[string]string { + params := make(map[string]string) + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-stats.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-stats.go new file mode 100644 index 000000000..38fd8d1ec --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-stats.go @@ -0,0 +1,274 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "encoding/json" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// ClusterStatsReq represents possible options for the /_cluster/stats request +type ClusterStatsReq struct { + NodeFilters []string + + Header http.Header + Params ClusterStatsParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r ClusterStatsReq) GetRequest() (*http.Request, error) { + filters := strings.Join(r.NodeFilters, ",") + + var path strings.Builder + path.Grow(22 + len(filters)) + path.WriteString("/_cluster/stats") + if len(filters) > 0 { + path.WriteString("/nodes/") + path.WriteString(filters) + } + + return opensearch.BuildRequest( + "GET", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// ClusterStatsResp represents the returned struct of the ClusterStatsReq response +type ClusterStatsResp struct { + NodesInfo struct { + Total int `json:"total"` + Successful int `json:"successful"` + Failed int `json:"failed"` + } `json:"_nodes"` + ClusterName string `json:"cluster_name"` + ClusterUUID string `json:"cluster_uuid"` + Timestamp int64 `json:"timestamp"` + Status string `json:"status"` + Indices ClusterStatsIndices `json:"indices"` + Nodes ClusterStatsNodes `json:"nodes"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r ClusterStatsResp) Inspect() Inspect { + return Inspect{Response: r.response} +} + +// ClusterStatsIndices is a sub type of ClusterStatsResp containing cluster information about indices +type ClusterStatsIndices struct { + Count int `json:"count"` + Shards struct { + Total int `json:"total"` + Primaries int `json:"primaries"` + Replication float64 `json:"replication"` + Index struct { + Shards struct { + Min float64 `json:"min"` + Max float64 `json:"max"` + Avg float64 `json:"avg"` + } `json:"shards"` + Primaries struct { + Min float64 `json:"min"` + Max float64 `json:"max"` + Avg float64 `json:"avg"` + } `json:"primaries"` + Replication struct { + Min float64 `json:"min"` + Max float64 `json:"max"` + Avg float64 `json:"avg"` + } `json:"replication"` + } `json:"index"` + } `json:"shards"` + Docs struct { + Count int64 `json:"count"` + Deleted int `json:"deleted"` + } `json:"docs"` + Store struct { + SizeInBytes int64 `json:"size_in_bytes"` + ReservedInBytes int `json:"reserved_in_bytes"` + } `json:"store"` + Fielddata struct { + MemorySizeInBytes int `json:"memory_size_in_bytes"` + Evictions int `json:"evictions"` + } `json:"fielddata"` + QueryCache struct { + MemorySizeInBytes int `json:"memory_size_in_bytes"` + TotalCount int `json:"total_count"` + HitCount int `json:"hit_count"` + MissCount int `json:"miss_count"` + CacheSize int `json:"cache_size"` + CacheCount int `json:"cache_count"` + Evictions int `json:"evictions"` + } `json:"query_cache"` + Completion struct { + SizeInBytes int `json:"size_in_bytes"` + } `json:"completion"` + Segments struct { + Count int `json:"count"` + MemoryInBytes int `json:"memory_in_bytes"` + TermsMemoryInBytes int `json:"terms_memory_in_bytes"` + StoredFieldsMemoryInBytes int `json:"stored_fields_memory_in_bytes"` + TermVectorsMemoryInBytes int `json:"term_vectors_memory_in_bytes"` + NormsMemoryInBytes int `json:"norms_memory_in_bytes"` + PointsMemoryInBytes int `json:"points_memory_in_bytes"` + DocValuesMemoryInBytes int `json:"doc_values_memory_in_bytes"` + IndexWriterMemoryInBytes int `json:"index_writer_memory_in_bytes"` + VersionMapMemoryInBytes int `json:"version_map_memory_in_bytes"` + FixedBitSetMemoryInBytes int64 `json:"fixed_bit_set_memory_in_bytes"` + MaxUnsafeAutoIDTimestamp int64 `json:"max_unsafe_auto_id_timestamp"` + RemoteStore struct { + Upload struct { + TotalUploadSize struct { + StartedBytes int `json:"started_bytes"` + SucceededBytes int `json:"succeeded_bytes"` + FailedBytes int `json:"failed_bytes"` + } `json:"total_upload_size"` + RefreshSizeLag struct { + TotalBytes int `json:"total_bytes"` + MaxBytes int `json:"max_bytes"` + } `json:"refresh_size_lag"` + MaxRefreshTimeLagInMillis int `json:"max_refresh_time_lag_in_millis"` + TotalTimeSpentInMillis int `json:"total_time_spent_in_millis"` + Pressure struct { + TotalRejections int `json:"total_rejections"` + } `json:"pressure"` + } `json:"upload"` + Download struct { + TotalDownloadSize struct { + StartedBytes int `json:"started_bytes"` + SucceededBytes int `json:"succeeded_bytes"` + FailedBytes int `json:"failed_bytes"` + } `json:"total_download_size"` + TotalTimeSpentInMillis int `json:"total_time_spent_in_millis"` + } `json:"download"` + } `json:"remote_store"` + SegmentReplication struct { + // Type is json.RawMessage due to difference in opensearch versions from string to int + MaxBytesBehind json.RawMessage `json:"max_bytes_behind"` + TotalBytesBehind json.RawMessage `json:"total_bytes_behind"` + MaxReplicationLag json.RawMessage `json:"max_replication_lag"` + } `json:"segment_replication"` + FileSizes json.RawMessage `json:"file_sizes"` + } `json:"segments"` + Mappings struct { + FieldTypes []struct { + Name string `json:"name"` + Count int `json:"count"` + IndexCount int `json:"index_count"` + } `json:"field_types"` + } `json:"mappings"` + Analysis struct { + CharFilterTypes []json.RawMessage `json:"char_filter_types"` + TokenizerTypes []json.RawMessage `json:"tokenizer_types"` + FilterTypes []json.RawMessage `json:"filter_types"` + AnalyzerTypes []json.RawMessage `json:"analyzer_types"` + BuiltInCharFilters []json.RawMessage `json:"built_in_char_filters"` + BuiltInTokenizers []json.RawMessage `json:"built_in_tokenizers"` + BuiltInFilters []json.RawMessage `json:"built_in_filters"` + BuiltInAnalyzers []json.RawMessage `json:"built_in_analyzers"` + } `json:"analysis"` + RepositoryCleanup struct { + RepositoryCleanup []json.RawMessage `json:"repository_cleanup"` + } `json:"repository_cleanup"` +} + +// ClusterStatsNodes is a sub type of ClusterStatsResp containing information about node stats +type ClusterStatsNodes struct { + Count struct { + Total int `json:"total"` + ClusterManager int `json:"cluster_manager"` + CoordinatingOnly int `json:"coordinating_only"` + Data int `json:"data"` + Ingest int `json:"ingest"` + Master int `json:"master"` + RemoteClusterClient int `json:"remote_cluster_client"` + Search int `json:"search"` + } `json:"count"` + Versions []string `json:"versions"` + Os struct { + AvailableProcessors int `json:"available_processors"` + AllocatedProcessors int `json:"allocated_processors"` + Names []struct { + Name string `json:"name"` + Count int `json:"count"` + } `json:"names"` + PrettyNames []struct { + PrettyName string `json:"pretty_name"` + Count int `json:"count"` + } `json:"pretty_names"` + Mem struct { + TotalInBytes int64 `json:"total_in_bytes"` + FreeInBytes int64 `json:"free_in_bytes"` + UsedInBytes int64 `json:"used_in_bytes"` + FreePercent int `json:"free_percent"` + UsedPercent int `json:"used_percent"` + } `json:"mem"` + } `json:"os"` + Process struct { + CPU struct { + Percent int `json:"percent"` + } `json:"cpu"` + OpenFileDescriptors struct { + Min int `json:"min"` + Max int `json:"max"` + Avg int `json:"avg"` + } `json:"open_file_descriptors"` + } `json:"process"` + Jvm struct { + MaxUptimeInMillis int64 `json:"max_uptime_in_millis"` + Versions []struct { + Version string `json:"version"` + VMName string `json:"vm_name"` + VMVersion string `json:"vm_version"` + VMVendor string `json:"vm_vendor"` + BundledJdk bool `json:"bundled_jdk"` + UsingBundledJdk bool `json:"using_bundled_jdk"` + Count int `json:"count"` + } `json:"versions"` + Mem struct { + HeapUsedInBytes int64 `json:"heap_used_in_bytes"` + HeapMaxInBytes int64 `json:"heap_max_in_bytes"` + } `json:"mem"` + Threads int `json:"threads"` + } `json:"jvm"` + Fs struct { + TotalInBytes int64 `json:"total_in_bytes"` + FreeInBytes int64 `json:"free_in_bytes"` + AvailableInBytes int64 `json:"available_in_bytes"` + CacheReservedInBytes int `json:"cache_reserved_in_bytes"` + } `json:"fs"` + Plugins []struct { + Name string `json:"name"` + Version string `json:"version"` + OpensearchVersion string `json:"opensearch_version"` + JavaVersion string `json:"java_version"` + Description string `json:"description"` + Classname string `json:"classname"` + CustomFoldername *string `json:"custom_foldername"` + ExtendedPlugins []string `json:"extended_plugins"` + HasNativeController bool `json:"has_native_controller"` + } `json:"plugins"` + NetworkTypes struct { + TransportTypes map[string]int `json:"transport_types"` + HTTPTypes map[string]int `json:"http_types"` + } `json:"network_types"` + DiscoveryTypes map[string]int `json:"discovery_types"` + PackagingTypes []struct { + Type string `json:"type"` + Count int `json:"count"` + } `json:"packaging_types"` + Ingest struct { + NumberOfPipelines int `json:"number_of_pipelines"` + ProcessorStats json.RawMessage `json:"processor_stats"` + } `json:"ingest"` +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-voting_config_exclusions-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-voting_config_exclusions-params.go new file mode 100644 index 000000000..ac178337a --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-voting_config_exclusions-params.go @@ -0,0 +1,104 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// ClusterPostVotingConfigExclusionsParams represents possible parameters for the ClusterVotingConfigExclusionsReq +type ClusterPostVotingConfigExclusionsParams struct { + NodeIds string + NodeNames string + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r ClusterPostVotingConfigExclusionsParams) get() map[string]string { + params := make(map[string]string) + + if r.NodeIds != "" { + params["node_ids"] = r.NodeIds + } + + if r.NodeNames != "" { + params["node_names"] = r.NodeNames + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} + +// ClusterDeleteVotingConfigExclusionsParams represents possible parameters for the ClusterVotingConfigExclusionsReq +type ClusterDeleteVotingConfigExclusionsParams struct { + WaitForRemoval *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r ClusterDeleteVotingConfigExclusionsParams) get() map[string]string { + params := make(map[string]string) + + if r.WaitForRemoval != nil { + params["wait_for_removal"] = strconv.FormatBool(*r.WaitForRemoval) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-voting_config_exclusions.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-voting_config_exclusions.go new file mode 100644 index 000000000..c5c7b17ed --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster-voting_config_exclusions.go @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// ClusterPostVotingConfigExclusionsReq represents possible options for the /_cluster/voting_config_exclusions request +type ClusterPostVotingConfigExclusionsReq struct { + Header http.Header + Params ClusterPostVotingConfigExclusionsParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r ClusterPostVotingConfigExclusionsReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "POST", + "/_cluster/voting_config_exclusions", + nil, + r.Params.get(), + r.Header, + ) +} + +// ClusterDeleteVotingConfigExclusionsReq represents possible options for the /_cluster/voting_config_exclusions request +type ClusterDeleteVotingConfigExclusionsReq struct { + Header http.Header + Params ClusterDeleteVotingConfigExclusionsParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r ClusterDeleteVotingConfigExclusionsReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "DELETE", + "/_cluster/voting_config_exclusions", + nil, + r.Params.get(), + r.Header, + ) +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster.go new file mode 100644 index 000000000..d66a450af --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_cluster.go @@ -0,0 +1,241 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" + + "github.com/opensearch-project/opensearch-go/v3" +) + +type clusterClient struct { + apiClient *Client +} + +// AllocationExplain executes a /_cluster/allocation/explain request with the optional ClusterAllocationExplainReq +func (c clusterClient) AllocationExplain(ctx context.Context, req *ClusterAllocationExplainReq) (*ClusterAllocationExplainResp, error) { + if req == nil { + req = &ClusterAllocationExplainReq{} + } + + var ( + data ClusterAllocationExplainResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Health executes a /_cluster/health request with the optional ClusterHealthReq +func (c clusterClient) Health(ctx context.Context, req *ClusterHealthReq) (*ClusterHealthResp, error) { + if req == nil { + req = &ClusterHealthReq{} + } + + var ( + data ClusterHealthResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// PendingTasks executes a /_cluster/pending_tasks request with the optional ClusterPendingTasksReq +func (c clusterClient) PendingTasks(ctx context.Context, req *ClusterPendingTasksReq) (*ClusterPendingTasksResp, error) { + if req == nil { + req = &ClusterPendingTasksReq{} + } + + var ( + data ClusterPendingTasksResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// GetSettings executes a /_cluster/settings request with the optional ClusterGetSettingsReq +func (c clusterClient) GetSettings(ctx context.Context, req *ClusterGetSettingsReq) (*ClusterGetSettingsResp, error) { + if req == nil { + req = &ClusterGetSettingsReq{} + } + + var ( + data ClusterGetSettingsResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// PutSettings executes a /_cluster/settings request with the required ClusterPutSettingsReq +func (c clusterClient) PutSettings(ctx context.Context, req ClusterPutSettingsReq) (*ClusterPutSettingsResp, error) { + var ( + data ClusterPutSettingsResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// State executes a /_cluster/state request with the optional ClusterStateReq +func (c clusterClient) State(ctx context.Context, req *ClusterStateReq) (*ClusterStateResp, error) { + if req == nil { + req = &ClusterStateReq{} + } + + var ( + data ClusterStateResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Stats executes a /_cluster/stats request with the optional ClusterStatsReq +func (c clusterClient) Stats(ctx context.Context, req *ClusterStatsReq) (*ClusterStatsResp, error) { + if req == nil { + req = &ClusterStatsReq{} + } + + var ( + data ClusterStatsResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Reroute executes a /_cluster/reroute request with the required ClusterRerouteReq +func (c clusterClient) Reroute(ctx context.Context, req ClusterRerouteReq) (*ClusterRerouteResp, error) { + var ( + data ClusterRerouteResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// PostVotingConfigExclusions executes a /_cluster/voting_config_exclusions request with the optional ClusterPostVotingConfigExclusionsReq +func (c clusterClient) PostVotingConfigExclusions( + ctx context.Context, + req ClusterPostVotingConfigExclusionsReq, +) (*opensearch.Response, error) { + var ( + resp *opensearch.Response + err error + ) + if resp, err = c.apiClient.do(ctx, req, nil); err != nil { + return resp, err + } + + return resp, nil +} + +// DeleteVotingConfigExclusions executes a /_cluster/voting_config_exclusions request +// with the optional ClusterDeleteVotingConfigExclusionsReq +func (c clusterClient) DeleteVotingConfigExclusions( + ctx context.Context, + req ClusterDeleteVotingConfigExclusionsReq, +) (*opensearch.Response, error) { + var ( + resp *opensearch.Response + err error + ) + if resp, err = c.apiClient.do(ctx, req, nil); err != nil { + return resp, err + } + + return resp, nil +} + +// PutDecommission executes a /_cluster/decommission/awareness request with the optional ClusterPutDecommissionReq +func (c clusterClient) PutDecommission(ctx context.Context, req ClusterPutDecommissionReq) (*ClusterPutDecommissionResp, error) { + var ( + data ClusterPutDecommissionResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// DeleteDecommission executes a /_cluster/decommission/awareness request with the optional ClusterDeleteDecommissionReq +func (c clusterClient) DeleteDecommission( + ctx context.Context, + req *ClusterDeleteDecommissionReq, +) (*ClusterDeleteDecommissionResp, error) { + if req == nil { + req = &ClusterDeleteDecommissionReq{} + } + + var ( + data ClusterDeleteDecommissionResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// GetDecommission executes a /_cluster/decommission/awareness request with the optional ClusterGetDecommissionReq +func (c clusterClient) GetDecommission(ctx context.Context, req ClusterGetDecommissionReq) (*ClusterGetDecommissionResp, error) { + var ( + data ClusterGetDecommissionResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data.Values); err != nil { + return &data, err + } + + return &data, nil +} + +// RemoteInfo executes a /_remote/info request with the optional ClusterRemoteInfoReq +func (c clusterClient) RemoteInfo(ctx context.Context, req *ClusterRemoteInfoReq) (*ClusterRemoteInfoResp, error) { + if req == nil { + req = &ClusterRemoteInfoReq{} + } + + var ( + data ClusterRemoteInfoResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data.Clusters); err != nil { + return &data, err + } + + return &data, nil +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template-create-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template-create-params.go new file mode 100644 index 000000000..8fa51ed9a --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template-create-params.go @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// ComponentTemplateCreateParams represents possible parameters for the ComponentTemplateCreateReq +type ComponentTemplateCreateParams struct { + Create *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r ComponentTemplateCreateParams) get() map[string]string { + params := make(map[string]string) + + if r.Create != nil { + params["create"] = strconv.FormatBool(*r.Create) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template-create.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template-create.go new file mode 100644 index 000000000..608437ca8 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template-create.go @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "io" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// ComponentTemplateCreateReq represents possible options for the _component_template create request +type ComponentTemplateCreateReq struct { + ComponentTemplate string + + Body io.Reader + + Header http.Header + Params ComponentTemplateCreateParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r ComponentTemplateCreateReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "PUT", + fmt.Sprintf("/_component_template/%s", r.ComponentTemplate), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// ComponentTemplateCreateResp represents the returned struct of the index create response +type ComponentTemplateCreateResp struct { + Acknowledged bool `json:"acknowledged"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r ComponentTemplateCreateResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template-delete-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template-delete-params.go new file mode 100644 index 000000000..e150f64b9 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template-delete-params.go @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "time" +) + +// ComponentTemplateDeleteParams represents possible parameters for the ComponentTemplateDeleteReq +type ComponentTemplateDeleteParams struct { + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r ComponentTemplateDeleteParams) get() map[string]string { + params := make(map[string]string) + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template-delete.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template-delete.go new file mode 100644 index 000000000..799bdaa79 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template-delete.go @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// ComponentTemplateDeleteReq represents possible options for the _component_template delete request +type ComponentTemplateDeleteReq struct { + ComponentTemplate string + + Header http.Header + Params ComponentTemplateDeleteParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r ComponentTemplateDeleteReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "DELETE", + fmt.Sprintf("/_component_template/%s", r.ComponentTemplate), + nil, + r.Params.get(), + r.Header, + ) +} + +// ComponentTemplateDeleteResp represents the returned struct of the _component_template delete response +type ComponentTemplateDeleteResp struct { + Acknowledged bool `json:"acknowledged"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r ComponentTemplateDeleteResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template-exists-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template-exists-params.go new file mode 100644 index 000000000..effeed6f3 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template-exists-params.go @@ -0,0 +1,73 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// ComponentTemplateExistsParams represents possible parameters for the ComponentTemplateExistsReq +type ComponentTemplateExistsParams struct { + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r ComponentTemplateExistsParams) get() map[string]string { + params := make(map[string]string) + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template-exists.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template-exists.go new file mode 100644 index 000000000..3f13e8cab --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template-exists.go @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// ComponentTemplateExistsReq represents possible options for the _component_template exists request +type ComponentTemplateExistsReq struct { + ComponentTemplate string + + Header http.Header + Params ComponentTemplateExistsParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r ComponentTemplateExistsReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "HEAD", + fmt.Sprintf("/_component_template/%s", r.ComponentTemplate), + nil, + r.Params.get(), + r.Header, + ) +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template-get-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template-get-params.go new file mode 100644 index 000000000..cb73cf36c --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template-get-params.go @@ -0,0 +1,73 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// ComponentTemplateGetParams represents possible parameters for the ComponentTemplateGetReq +type ComponentTemplateGetParams struct { + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r ComponentTemplateGetParams) get() map[string]string { + params := make(map[string]string) + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template-get.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template-get.go new file mode 100644 index 000000000..637b796a8 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template-get.go @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "encoding/json" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// ComponentTemplateGetReq represents possible options for the _component_template get request +type ComponentTemplateGetReq struct { + ComponentTemplate string + + Header http.Header + Params ComponentTemplateGetParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r ComponentTemplateGetReq) GetRequest() (*http.Request, error) { + var path strings.Builder + path.Grow(len("/_component_template/") + len(r.ComponentTemplate)) + path.WriteString("/_component_template") + if len(r.ComponentTemplate) > 0 { + path.WriteString("/") + path.WriteString(r.ComponentTemplate) + } + + return opensearch.BuildRequest( + "GET", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// ComponentTemplateGetResp represents the returned struct of the index create response +type ComponentTemplateGetResp struct { + ComponentTemplates []ComponentTemplateGetDetails `json:"component_templates"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r ComponentTemplateGetResp) Inspect() Inspect { + return Inspect{Response: r.response} +} + +// ComponentTemplateGetDetails is a sub type of ComponentTemplateGetResp containing information about component template +type ComponentTemplateGetDetails struct { + Name string `json:"name"` + ComponentTemplate struct { + Template struct { + Mappings json.RawMessage `json:"mappings"` + Settings json.RawMessage `json:"settings"` + Aliases json.RawMessage `json:"aliases"` + } `json:"template"` + } `json:"component_template"` +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template.go new file mode 100644 index 000000000..008efbcec --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_component_template.go @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" + + "github.com/opensearch-project/opensearch-go/v3" +) + +type componentTemplateClient struct { + apiClient *Client +} + +// Create executes a creade componentTemplate request with the required ComponentTemplateCreateReq +func (c componentTemplateClient) Create(ctx context.Context, req ComponentTemplateCreateReq) (*ComponentTemplateCreateResp, error) { + var ( + data ComponentTemplateCreateResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Delete executes a delete componentTemplate request with the required ComponentTemplateDeleteReq +func (c componentTemplateClient) Delete(ctx context.Context, req ComponentTemplateDeleteReq) (*ComponentTemplateDeleteResp, error) { + var ( + data ComponentTemplateDeleteResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Get executes a get componentTemplate request with the optional ComponentTemplateGetReq +func (c componentTemplateClient) Get(ctx context.Context, req *ComponentTemplateGetReq) (*ComponentTemplateGetResp, error) { + if req == nil { + req = &ComponentTemplateGetReq{} + } + + var ( + data ComponentTemplateGetResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Exists executes a exists componentTemplate request with the required ComponentTemplatExistsReq +func (c componentTemplateClient) Exists(ctx context.Context, req ComponentTemplateExistsReq) (*opensearch.Response, error) { + return c.apiClient.do(ctx, req, nil) +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_dangling-delete-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_dangling-delete-params.go new file mode 100644 index 000000000..4d785bc66 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_dangling-delete-params.go @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// DanglingDeleteParams represents possible parameters for the DanglingDeleteReq +type DanglingDeleteParams struct { + AcceptDataLoss *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r DanglingDeleteParams) get() map[string]string { + params := make(map[string]string) + + if r.AcceptDataLoss != nil { + params["accept_data_loss"] = strconv.FormatBool(*r.AcceptDataLoss) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_dangling-delete.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_dangling-delete.go new file mode 100644 index 000000000..5705614aa --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_dangling-delete.go @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// DanglingDeleteReq represents possible options for the delete dangling request +type DanglingDeleteReq struct { + IndexUUID string + + Header http.Header + Params DanglingDeleteParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r DanglingDeleteReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "DELETE", + fmt.Sprintf("/_dangling/%s", r.IndexUUID), + nil, + r.Params.get(), + r.Header, + ) +} + +// DanglingDeleteResp represents the returned struct of the delete dangling response +type DanglingDeleteResp struct { + Acknowledged bool `json:"acknowledged"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r DanglingDeleteResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_dangling-get-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_dangling-get-params.go new file mode 100644 index 000000000..b76f38292 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_dangling-get-params.go @@ -0,0 +1,52 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +// DanglingGetParams represents possible parameters for the DanglingGetReq +type DanglingGetParams struct { + Pretty bool + Human bool + ErrorTrace bool +} + +func (r DanglingGetParams) get() map[string]string { + params := make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_dangling-get.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_dangling-get.go new file mode 100644 index 000000000..5b20c88d1 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_dangling-get.go @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// DanglingGetReq represents possible options for the dangling get request +type DanglingGetReq struct { + Header http.Header + Params DanglingGetParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r DanglingGetReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "GET", + "/_dangling", + nil, + r.Params.get(), + r.Header, + ) +} + +// DanglingGetResp represents the returned struct of the dangling get response +type DanglingGetResp struct { + Nodes struct { + Total int `json:"total"` + Successful int `json:"successful"` + Failed int `json:"failed"` + Failures []struct { + Type string `json:"type"` + Reason string `json:"reason"` + NodeID string `json:"node_id"` + CausedBy struct { + Type string `json:"type"` + Reason string `json:"reason"` + } `json:"caused_by"` + } `json:"failures"` + } `json:"_nodes"` + ClusterName string `json:"cluster_name"` + DanglingIndices []struct { + IndexName string `json:"index_name"` + IndexUUID string `json:"index_uuid"` + CreationDateMillis int64 `json:"creation_date_millis"` + NodeIds []string `json:"node_ids"` + } `json:"dangling_indices"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r DanglingGetResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_dangling-import-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_dangling-import-params.go new file mode 100644 index 000000000..fb4858b71 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_dangling-import-params.go @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// DanglingImportParams represents possible parameters for the DanglingImportReq +type DanglingImportParams struct { + AcceptDataLoss *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r DanglingImportParams) get() map[string]string { + params := make(map[string]string) + + if r.AcceptDataLoss != nil { + params["accept_data_loss"] = strconv.FormatBool(*r.AcceptDataLoss) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_dangling-import.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_dangling-import.go new file mode 100644 index 000000000..27d2fc592 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_dangling-import.go @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// DanglingImportReq represents possible options for the dangling import request +type DanglingImportReq struct { + IndexUUID string + + Header http.Header + Params DanglingImportParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r DanglingImportReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "POST", + fmt.Sprintf("/_dangling/%s", r.IndexUUID), + nil, + r.Params.get(), + r.Header, + ) +} + +// DanglingImportResp represents the returned struct of thedangling import response +type DanglingImportResp struct { + Acknowledged bool `json:"acknowledged"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r DanglingImportResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_dangling.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_dangling.go new file mode 100644 index 000000000..60922fde2 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_dangling.go @@ -0,0 +1,58 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" +) + +type danglingClient struct { + apiClient *Client +} + +// Delete executes a delete dangling request with the required DanglingDeleteReq +func (c danglingClient) Delete(ctx context.Context, req DanglingDeleteReq) (*DanglingDeleteResp, error) { + var ( + data DanglingDeleteResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Import executes an import dangling request with the required DanglingImportReq +func (c danglingClient) Import(ctx context.Context, req DanglingImportReq) (*DanglingImportResp, error) { + var ( + data DanglingImportResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Get executes a /_dangling request with the optional DanglingGetReq +func (c danglingClient) Get(ctx context.Context, req *DanglingGetReq) (*DanglingGetResp, error) { + if req == nil { + req = &DanglingGetReq{} + } + + var ( + data DanglingGetResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream-create-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream-create-params.go new file mode 100644 index 000000000..8e13bf85f --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream-create-params.go @@ -0,0 +1,52 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +// DataStreamCreateParams represents possible parameters for the DataStreamCreateReq +type DataStreamCreateParams struct { + Pretty bool + Human bool + ErrorTrace bool +} + +func (r DataStreamCreateParams) get() map[string]string { + params := make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream-create.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream-create.go new file mode 100644 index 000000000..9ba4cee57 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream-create.go @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// DataStreamCreateReq represents possible options for the _data_stream create request +type DataStreamCreateReq struct { + DataStream string + + Header http.Header + Params DataStreamCreateParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r DataStreamCreateReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "PUT", + fmt.Sprintf("/_data_stream/%s", r.DataStream), + nil, + r.Params.get(), + r.Header, + ) +} + +// DataStreamCreateResp represents the returned struct of the _data_stream create response +type DataStreamCreateResp struct { + Acknowledged bool `json:"acknowledged"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r DataStreamCreateResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream-delete-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream-delete-params.go new file mode 100644 index 000000000..d666a15cb --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream-delete-params.go @@ -0,0 +1,65 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import "time" + +// DataStreamDeleteParams represents possible parameters for the DataStreamDeleteReq +type DataStreamDeleteParams struct { + ClusterManagerTimeout time.Duration + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r DataStreamDeleteParams) get() map[string]string { + params := make(map[string]string) + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream-delete.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream-delete.go new file mode 100644 index 000000000..0bdb44810 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream-delete.go @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// DataStreamDeleteReq represents possible options for the index _data_stream delete request +type DataStreamDeleteReq struct { + DataStream string + + Header http.Header + Params DataStreamDeleteParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r DataStreamDeleteReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "DELETE", + fmt.Sprintf("/_data_stream/%s", r.DataStream), + nil, + r.Params.get(), + r.Header, + ) +} + +// DataStreamDeleteResp represents the returned struct of the _data_stream delete response +type DataStreamDeleteResp struct { + Acknowledged bool `json:"acknowledged"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r DataStreamDeleteResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream-get-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream-get-params.go new file mode 100644 index 000000000..3e4787869 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream-get-params.go @@ -0,0 +1,60 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import "time" + +// DataStreamGetParams represents possible parameters for the DataStreamGetReq +type DataStreamGetParams struct { + ClusterManagerTimeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r DataStreamGetParams) get() map[string]string { + params := make(map[string]string) + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream-get.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream-get.go new file mode 100644 index 000000000..595c28a00 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream-get.go @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// DataStreamGetReq represents possible options for the _data_stream get request +type DataStreamGetReq struct { + DataStreams []string + + Header http.Header + Params DataStreamGetParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r DataStreamGetReq) GetRequest() (*http.Request, error) { + dataStreams := strings.Join(r.DataStreams, ",") + + var path strings.Builder + path.Grow(len("/_data_stream/") + len(dataStreams)) + path.WriteString("/_data_stream") + if len(r.DataStreams) > 0 { + path.WriteString("/") + path.WriteString(dataStreams) + } + + return opensearch.BuildRequest( + "GET", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// DataStreamGetResp represents the returned struct of the _data_stream get response +type DataStreamGetResp struct { + DataStreams []DataStreamGetDetails `json:"data_streams"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r DataStreamGetResp) Inspect() Inspect { + return Inspect{Response: r.response} +} + +// DataStreamGetDetails is a sub type if DataStreamGetResp containing information about a data stream +type DataStreamGetDetails struct { + Name string `json:"name"` + TimestampField struct { + Name string `json:"name"` + } `json:"timestamp_field"` + Indices []DataStreamIndices `json:"indices"` + Generation int `json:"generation"` + Status string `json:"status"` + Template string `json:"template"` +} + +// DataStreamIndices is a sub type of DataStreamGetDetails containing information about an index +type DataStreamIndices struct { + Name string `json:"index_name"` + UUID string `json:"index_uuid"` +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream-stats-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream-stats-params.go new file mode 100644 index 000000000..55dc54033 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream-stats-params.go @@ -0,0 +1,60 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import "time" + +// DataStreamStatsParams represents possible parameters for the DataStreamCreateReq +type DataStreamStatsParams struct { + ClusterManagerTimeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r DataStreamStatsParams) get() map[string]string { + params := make(map[string]string) + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream-stats.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream-stats.go new file mode 100644 index 000000000..2596d70fb --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream-stats.go @@ -0,0 +1,71 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// DataStreamStatsReq represents possible options for the _data_stream stats request +type DataStreamStatsReq struct { + DataStreams []string + + Header http.Header + Params DataStreamStatsParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r DataStreamStatsReq) GetRequest() (*http.Request, error) { + dataStreams := strings.Join(r.DataStreams, ",") + + var path strings.Builder + path.Grow(len("/_data_stream//_stats") + len(dataStreams)) + path.WriteString("/_data_stream/") + if len(r.DataStreams) > 0 { + path.WriteString(dataStreams) + path.WriteString("/") + } + path.WriteString("_stats") + + return opensearch.BuildRequest( + "GET", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// DataStreamStatsResp represents the returned struct of the _data_stream stats response +type DataStreamStatsResp struct { + Shards struct { + Total int `json:"total"` + Successful int `json:"successful"` + Failed int `json:"failed"` + } `json:"_shards"` + DataStreamCount int `json:"data_stream_count"` + BackingIndices int `json:"backing_indices"` + TotalStoreSizeBytes int64 `json:"total_store_size_bytes"` + DataStreams []DataStreamStatsDetails `json:"data_streams"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r DataStreamStatsResp) Inspect() Inspect { + return Inspect{Response: r.response} +} + +// DataStreamStatsDetails is a sub type of DataStreamStatsResp containing information about a data stream +type DataStreamStatsDetails struct { + DataStream string `json:"data_stream"` + BackingIndices int `json:"backing_indices"` + StoreSizeBytes int64 `json:"store_size_bytes"` + MaximumTimestamp int64 `json:"maximum_timestamp"` +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream.go new file mode 100644 index 000000000..2942d1d6b --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_datastream.go @@ -0,0 +1,75 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" +) + +type dataStreamClient struct { + apiClient *Client +} + +// Create executes a creade dataStream request with the required DataStreamCreateReq +func (c dataStreamClient) Create(ctx context.Context, req DataStreamCreateReq) (*DataStreamCreateResp, error) { + var ( + data DataStreamCreateResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Delete executes a delete dataStream request with the required DataStreamDeleteReq +func (c dataStreamClient) Delete(ctx context.Context, req DataStreamDeleteReq) (*DataStreamDeleteResp, error) { + var ( + data DataStreamDeleteResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Get executes a get dataStream request with the optional DataStreamGetReq +func (c dataStreamClient) Get(ctx context.Context, req *DataStreamGetReq) (*DataStreamGetResp, error) { + if req == nil { + req = &DataStreamGetReq{} + } + + var ( + data DataStreamGetResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Stats executes a stats dataStream request with the optional DataStreamStatsReq +func (c dataStreamClient) Stats(ctx context.Context, req *DataStreamStatsReq) (*DataStreamStatsResp, error) { + if req == nil { + req = &DataStreamStatsReq{} + } + + var ( + data DataStreamStatsResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-create-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-create-params.go new file mode 100644 index 000000000..9c87e7354 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-create-params.go @@ -0,0 +1,93 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// DocumentCreateParams represents possible parameters for the DocumentCreateReq +type DocumentCreateParams struct { + Pipeline string + Refresh string + Routing string + Timeout time.Duration + Version *int + VersionType string + WaitForActiveShards string + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r DocumentCreateParams) get() map[string]string { + params := make(map[string]string) + + if r.Pipeline != "" { + params["pipeline"] = r.Pipeline + } + + if r.Refresh != "" { + params["refresh"] = r.Refresh + } + + if r.Routing != "" { + params["routing"] = r.Routing + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Version != nil { + params["version"] = strconv.FormatInt(int64(*r.Version), 10) + } + + if r.VersionType != "" { + params["version_type"] = r.VersionType + } + + if r.WaitForActiveShards != "" { + params["wait_for_active_shards"] = r.WaitForActiveShards + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-create.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-create.go new file mode 100644 index 000000000..8af66b308 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-create.go @@ -0,0 +1,66 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "io" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// DocumentCreateReq represents possible options for the //_create request +type DocumentCreateReq struct { + Index string + DocumentID string + + Body io.Reader + + Header http.Header + Params DocumentCreateParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r DocumentCreateReq) GetRequest() (*http.Request, error) { + var path strings.Builder + path.Grow(10 + len(r.Index) + len(r.DocumentID)) + path.WriteString("/") + path.WriteString(r.Index) + path.WriteString("/_create/") + path.WriteString(r.DocumentID) + return opensearch.BuildRequest( + "PUT", + path.String(), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// DocumentCreateResp represents the returned struct of the /_doc response +type DocumentCreateResp struct { + Index string `json:"_index"` + ID string `json:"_id"` + Version int `json:"_version"` + Result string `json:"result"` + Type string `json:"_type"` // Deprecated field + ForcedRefresh bool `json:"forced_refresh"` + Shards struct { + Total int `json:"total"` + Successful int `json:"successful"` + Failed int `json:"failed"` + } `json:"_shards"` + SeqNo int `json:"_seq_no"` + PrimaryTerm int `json:"_primary_term"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r DocumentCreateResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-delete-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-delete-params.go new file mode 100644 index 000000000..69308d913 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-delete-params.go @@ -0,0 +1,98 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// DocumentDeleteParams represents possible parameters for the DocumentDeleteReq +type DocumentDeleteParams struct { + IfPrimaryTerm *int + IfSeqNo *int + Refresh string + Routing string + Timeout time.Duration + Version *int + VersionType string + WaitForActiveShards string + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r DocumentDeleteParams) get() map[string]string { + params := make(map[string]string) + + if r.IfPrimaryTerm != nil { + params["if_primary_term"] = strconv.FormatInt(int64(*r.IfPrimaryTerm), 10) + } + + if r.IfSeqNo != nil { + params["if_seq_no"] = strconv.FormatInt(int64(*r.IfSeqNo), 10) + } + + if r.Refresh != "" { + params["refresh"] = r.Refresh + } + + if r.Routing != "" { + params["routing"] = r.Routing + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Version != nil { + params["version"] = strconv.FormatInt(int64(*r.Version), 10) + } + + if r.VersionType != "" { + params["version_type"] = r.VersionType + } + + if r.WaitForActiveShards != "" { + params["wait_for_active_shards"] = r.WaitForActiveShards + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-delete.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-delete.go new file mode 100644 index 000000000..b840ff629 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-delete.go @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// DocumentDeleteReq represents possible options for the //_doc/ delete request +type DocumentDeleteReq struct { + Index string + DocumentID string + + Header http.Header + Params DocumentDeleteParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r DocumentDeleteReq) GetRequest() (*http.Request, error) { + var path strings.Builder + path.Grow(7 + len(r.Index) + len(r.DocumentID)) + path.WriteString("/") + path.WriteString(r.Index) + path.WriteString("/_doc/") + path.WriteString(r.DocumentID) + return opensearch.BuildRequest( + "DELETE", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// DocumentDeleteResp represents the returned struct of the //_doc/ response +type DocumentDeleteResp struct { + Index string `json:"_index"` + ID string `json:"_id"` + Version int `json:"_version"` + Result string `json:"result"` + Type string `json:"_type"` // Deprecated field + Shards struct { + Total int `json:"total"` + Successful int `json:"successful"` + Failed int `json:"failed"` + } `json:"_shards"` + SeqNo int `json:"_seq_no"` + PrimaryTerm int `json:"_primary_term"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r DocumentDeleteResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-delete_by_query-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-delete_by_query-params.go new file mode 100644 index 000000000..b6b1a4f48 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-delete_by_query-params.go @@ -0,0 +1,234 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "fmt" + "strconv" + "strings" + "time" +) + +// DocumentDeleteByQueryParams represents possible parameters for the DocumentDeleteByQueryReq +type DocumentDeleteByQueryParams struct { + AllowNoIndices *bool + Analyzer string + AnalyzeWildcard *bool + Conflicts string + DefaultOperator string + Df string + ExpandWildcards string + From *int + IgnoreUnavailable *bool + Lenient *bool + MaxDocs *int + Preference string + Query string + Refresh *bool + RequestCache *bool + RequestsPerSecond *int + Routing []string + Scroll time.Duration + ScrollSize *int + SearchTimeout time.Duration + SearchType string + Size *int + Slices interface{} + Sort []string + Source interface{} + SourceExcludes []string + SourceIncludes []string + Stats []string + TerminateAfter *int + Timeout time.Duration + Version *bool + WaitForActiveShards string + WaitForCompletion *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r DocumentDeleteByQueryParams) get() map[string]string { + params := make(map[string]string) + + if r.AllowNoIndices != nil { + params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) + } + + if r.Analyzer != "" { + params["analyzer"] = r.Analyzer + } + + if r.AnalyzeWildcard != nil { + params["analyze_wildcard"] = strconv.FormatBool(*r.AnalyzeWildcard) + } + + if r.Conflicts != "" { + params["conflicts"] = r.Conflicts + } + + if r.DefaultOperator != "" { + params["default_operator"] = r.DefaultOperator + } + + if r.Df != "" { + params["df"] = r.Df + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if r.From != nil { + params["from"] = strconv.FormatInt(int64(*r.From), 10) + } + + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + + if r.Lenient != nil { + params["lenient"] = strconv.FormatBool(*r.Lenient) + } + + if r.MaxDocs != nil { + params["max_docs"] = strconv.FormatInt(int64(*r.MaxDocs), 10) + } + + if r.Preference != "" { + params["preference"] = r.Preference + } + + if r.Query != "" { + params["q"] = r.Query + } + + if r.Refresh != nil { + params["refresh"] = strconv.FormatBool(*r.Refresh) + } + + if r.RequestCache != nil { + params["request_cache"] = strconv.FormatBool(*r.RequestCache) + } + + if r.RequestsPerSecond != nil { + params["requests_per_second"] = strconv.FormatInt(int64(*r.RequestsPerSecond), 10) + } + + if len(r.Routing) > 0 { + params["routing"] = strings.Join(r.Routing, ",") + } + + if r.Scroll != 0 { + params["scroll"] = formatDuration(r.Scroll) + } + + if r.ScrollSize != nil { + params["scroll_size"] = strconv.FormatInt(int64(*r.ScrollSize), 10) + } + + if r.SearchTimeout != 0 { + params["search_timeout"] = formatDuration(r.SearchTimeout) + } + + if r.SearchType != "" { + params["search_type"] = r.SearchType + } + + if r.Size != nil { + params["size"] = strconv.FormatInt(int64(*r.Size), 10) + } + + if r.Slices != nil { + params["slices"] = fmt.Sprintf("%v", r.Slices) + } + + if len(r.Sort) > 0 { + params["sort"] = strings.Join(r.Sort, ",") + } + + switch source := r.Source.(type) { + case bool: + params["_source"] = strconv.FormatBool(source) + case string: + if source != "" { + params["_source"] = source + } + case []string: + if len(source) > 0 { + params["_source"] = strings.Join(source, ",") + } + } + + if len(r.SourceExcludes) > 0 { + params["_source_excludes"] = strings.Join(r.SourceExcludes, ",") + } + + if len(r.SourceIncludes) > 0 { + params["_source_includes"] = strings.Join(r.SourceIncludes, ",") + } + + if len(r.Stats) > 0 { + params["stats"] = strings.Join(r.Stats, ",") + } + + if r.TerminateAfter != nil { + params["terminate_after"] = strconv.FormatInt(int64(*r.TerminateAfter), 10) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Version != nil { + params["version"] = strconv.FormatBool(*r.Version) + } + + if r.WaitForActiveShards != "" { + params["wait_for_active_shards"] = r.WaitForActiveShards + } + + if r.WaitForCompletion != nil { + params["wait_for_completion"] = strconv.FormatBool(*r.WaitForCompletion) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-delete_by_query.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-delete_by_query.go new file mode 100644 index 000000000..909ec85e8 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-delete_by_query.go @@ -0,0 +1,64 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "encoding/json" + "fmt" + "io" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// DocumentDeleteByQueryReq represents possible options for the //_delete_by_query request +type DocumentDeleteByQueryReq struct { + Indices []string + + Body io.Reader + + Header http.Header + Params DocumentDeleteByQueryParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r DocumentDeleteByQueryReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "POST", + fmt.Sprintf("/%s/_delete_by_query", strings.Join(r.Indices, ",")), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// DocumentDeleteByQueryResp represents the returned struct of the //_delete_by_query response +type DocumentDeleteByQueryResp struct { + Took int `json:"took"` + TimedOut bool `json:"timed_out"` + Total int `json:"total"` + Deleted int `json:"deleted"` + Batches int `json:"batches"` + VersionConflicts int `json:"version_conflicts"` + Noops int `json:"noops"` + Retries struct { + Bulk int `json:"bulk"` + Search int `json:"search"` + } `json:"retries"` + ThrottledMillis int `json:"throttled_millis"` + RequestsPerSecond float32 `json:"requests_per_second"` + ThrottledUntilMillis int `json:"throttled_until_millis"` + Failures []json.RawMessage `json:"failures"` // Unknow struct, open an issue with an example response so we can add it + Task string `json:"task,omitempty"` // Needed when wait_for_completion is set to false + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r DocumentDeleteByQueryResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-delete_by_query_rethrottle-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-delete_by_query_rethrottle-params.go new file mode 100644 index 000000000..af978ec58 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-delete_by_query_rethrottle-params.go @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" +) + +// DocumentDeleteByQueryRethrottleParams represents possible parameters for the DocumentDeleteByQueryRethrottleReq +type DocumentDeleteByQueryRethrottleParams struct { + RequestsPerSecond *int + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r DocumentDeleteByQueryRethrottleParams) get() map[string]string { + params := make(map[string]string) + + if r.RequestsPerSecond != nil { + params["requests_per_second"] = strconv.FormatInt(int64(*r.RequestsPerSecond), 10) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-delete_by_query_rethrottle.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-delete_by_query_rethrottle.go new file mode 100644 index 000000000..15efe22f4 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-delete_by_query_rethrottle.go @@ -0,0 +1,96 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "encoding/json" + "fmt" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// DocumentDeleteByQueryRethrottleReq represents possible options for the /_delete_by_query//_rethrottle request +type DocumentDeleteByQueryRethrottleReq struct { + TaskID string + + Header http.Header + Params DocumentDeleteByQueryRethrottleParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r DocumentDeleteByQueryRethrottleReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "POST", + fmt.Sprintf("/_delete_by_query/%s/_rethrottle", r.TaskID), + nil, + r.Params.get(), + r.Header, + ) +} + +// DocumentDeleteByQueryRethrottleResp represents the returned struct of the /_delete_by_query//_rethrottle response +type DocumentDeleteByQueryRethrottleResp struct { + Nodes map[string]struct { + Name string `json:"name"` + TransportAddress string `json:"transport_address"` + Host string `json:"host"` + IP string `json:"ip"` + Roles []string `json:"roles"` + Attributes map[string]string `json:"attributes"` + Tasks map[string]struct { + Node string `json:"node"` + ID int `json:"id"` + Type string `json:"type"` + Action string `json:"action"` + Status struct { + Total int `json:"total"` + Updated int `json:"updated"` + Created int `json:"created"` + Deleted int `json:"deleted"` + Batches int `json:"batches"` + VersionConflicts int `json:"version_conflicts"` + Noops int `json:"noops"` + Retries struct { + Bulk int `json:"bulk"` + Search int `json:"search"` + } `json:"retries"` + ThrottledMillis int `json:"throttled_millis"` + RequestsPerSecond float64 `json:"requests_per_second"` + ThrottledUntilMillis int `json:"throttled_until_millis"` + } `json:"status"` + Description string `json:"description"` + StartTimeInMillis int64 `json:"start_time_in_millis"` + RunningTimeInNanos int `json:"running_time_in_nanos"` + Cancellable bool `json:"cancellable"` + Cancelled bool `json:"cancelled"` + Headers json.RawMessage `json:"headers"` + ResourceStats struct { + Average DocumentDeleteByQueryRethrottleResourceInfo `json:"average"` + Max DocumentDeleteByQueryRethrottleResourceInfo `json:"max"` + Min DocumentDeleteByQueryRethrottleResourceInfo `json:"min"` + Total DocumentDeleteByQueryRethrottleResourceInfo `json:"total"` + ThreadInfo struct { + ActiveThreads int `json:"active_threads"` + ThreadExecutions int `json:"thread_executions"` + } `json:"thread_info"` + } `json:"resource_stats"` + } `json:"tasks"` + } `json:"nodes"` + response *opensearch.Response +} + +// DocumentDeleteByQueryRethrottleResourceInfo is a sub type of DocumentDeleteByQueryRethrottleResp containing resource stats +type DocumentDeleteByQueryRethrottleResourceInfo struct { + CPUTimeInNanos int `json:"cpu_time_in_nanos"` + MemoryInBytes int `json:"memory_in_bytes"` +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r DocumentDeleteByQueryRethrottleResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-exists-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-exists-params.go new file mode 100644 index 000000000..0ff9011c2 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-exists-params.go @@ -0,0 +1,117 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" +) + +// DocumentExistsParams represents possible parameters for the DocumentExistsReq +type DocumentExistsParams struct { + Preference string + Realtime *bool + Refresh *bool + Routing string + Source interface{} + SourceExcludes []string + SourceIncludes []string + StoredFields []string + Version *int + VersionType string + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r DocumentExistsParams) get() map[string]string { + params := make(map[string]string) + + if r.Preference != "" { + params["preference"] = r.Preference + } + + if r.Realtime != nil { + params["realtime"] = strconv.FormatBool(*r.Realtime) + } + + if r.Refresh != nil { + params["refresh"] = strconv.FormatBool(*r.Refresh) + } + + if r.Routing != "" { + params["routing"] = r.Routing + } + + switch source := r.Source.(type) { + case bool: + params["_source"] = strconv.FormatBool(source) + case string: + if source != "" { + params["_source"] = source + } + case []string: + if len(source) > 0 { + params["_source"] = strings.Join(source, ",") + } + } + + if len(r.SourceExcludes) > 0 { + params["_source_excludes"] = strings.Join(r.SourceExcludes, ",") + } + + if len(r.SourceIncludes) > 0 { + params["_source_includes"] = strings.Join(r.SourceIncludes, ",") + } + + if len(r.StoredFields) > 0 { + params["stored_fields"] = strings.Join(r.StoredFields, ",") + } + + if r.Version != nil { + params["version"] = strconv.FormatInt(int64(*r.Version), 10) + } + + if r.VersionType != "" { + params["version_type"] = r.VersionType + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-exists.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-exists.go new file mode 100644 index 000000000..23b9f58ef --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-exists.go @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// DocumentExistsReq represents possible options for the document exists request +type DocumentExistsReq struct { + Index string + DocumentID string + + Header http.Header + Params DocumentExistsParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r DocumentExistsReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "HEAD", + fmt.Sprintf("/%s/_doc/%s", r.Index, r.DocumentID), + nil, + r.Params.get(), + r.Header, + ) +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-exists_source-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-exists_source-params.go new file mode 100644 index 000000000..965c200f5 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-exists_source-params.go @@ -0,0 +1,112 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" +) + +// DocumentExistsSourceParams represents possible parameters for the DocumentExistsSourceReq +type DocumentExistsSourceParams struct { + Preference string + Realtime *bool + Refresh *bool + Routing string + Source interface{} + SourceExcludes []string + SourceIncludes []string + Version *int + VersionType string + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r DocumentExistsSourceParams) get() map[string]string { + params := make(map[string]string) + + if r.Preference != "" { + params["preference"] = r.Preference + } + + if r.Realtime != nil { + params["realtime"] = strconv.FormatBool(*r.Realtime) + } + + if r.Refresh != nil { + params["refresh"] = strconv.FormatBool(*r.Refresh) + } + + if r.Routing != "" { + params["routing"] = r.Routing + } + + switch source := r.Source.(type) { + case bool: + params["_source"] = strconv.FormatBool(source) + case string: + if source != "" { + params["_source"] = source + } + case []string: + if len(source) > 0 { + params["_source"] = strings.Join(source, ",") + } + } + + if len(r.SourceExcludes) > 0 { + params["_source_excludes"] = strings.Join(r.SourceExcludes, ",") + } + + if len(r.SourceIncludes) > 0 { + params["_source_includes"] = strings.Join(r.SourceIncludes, ",") + } + + if r.Version != nil { + params["version"] = strconv.FormatInt(int64(*r.Version), 10) + } + + if r.VersionType != "" { + params["version_type"] = r.VersionType + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-exists_source.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-exists_source.go new file mode 100644 index 000000000..cb02f6745 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-exists_source.go @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// DocumentExistsSourceReq represents possible options for the _source exists request +type DocumentExistsSourceReq struct { + Index string + DocumentID string + + Header http.Header + Params DocumentExistsSourceParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r DocumentExistsSourceReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "HEAD", + fmt.Sprintf("/%s/_source/%s", r.Index, r.DocumentID), + nil, + r.Params.get(), + r.Header, + ) +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-explain-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-explain-params.go new file mode 100644 index 000000000..0dafc9c47 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-explain-params.go @@ -0,0 +1,127 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" +) + +// DocumentExplainParams represents possible parameters for the DocumentExplainReq +type DocumentExplainParams struct { + Analyzer string + AnalyzeWildcard *bool + DefaultOperator string + Df string + Lenient *bool + Preference string + Query string + Routing string + Source interface{} + SourceExcludes []string + SourceIncludes []string + StoredFields []string + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r DocumentExplainParams) get() map[string]string { + params := make(map[string]string) + + if r.Analyzer != "" { + params["analyzer"] = r.Analyzer + } + + if r.AnalyzeWildcard != nil { + params["analyze_wildcard"] = strconv.FormatBool(*r.AnalyzeWildcard) + } + + if r.DefaultOperator != "" { + params["default_operator"] = r.DefaultOperator + } + + if r.Df != "" { + params["df"] = r.Df + } + + if r.Lenient != nil { + params["lenient"] = strconv.FormatBool(*r.Lenient) + } + + if r.Preference != "" { + params["preference"] = r.Preference + } + + if r.Query != "" { + params["q"] = r.Query + } + + if r.Routing != "" { + params["routing"] = r.Routing + } + + switch source := r.Source.(type) { + case bool: + params["_source"] = strconv.FormatBool(source) + case string: + if source != "" { + params["_source"] = source + } + case []string: + if len(source) > 0 { + params["_source"] = strings.Join(source, ",") + } + } + + if len(r.SourceExcludes) > 0 { + params["_source_excludes"] = strings.Join(r.SourceExcludes, ",") + } + + if len(r.SourceIncludes) > 0 { + params["_source_includes"] = strings.Join(r.SourceIncludes, ",") + } + + if len(r.StoredFields) > 0 { + params["stored_fields"] = strings.Join(r.StoredFields, ",") + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-explain.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-explain.go new file mode 100644 index 000000000..619b3fcdc --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-explain.go @@ -0,0 +1,59 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "io" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// DocumentExplainReq represents possible options for the //_explain/ request +type DocumentExplainReq struct { + Index string + DocumentID string + + Body io.Reader + + Header http.Header + Params DocumentExplainParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r DocumentExplainReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "POST", + fmt.Sprintf("/%s/_explain/%s", r.Index, r.DocumentID), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// DocumentExplainResp represents the returned struct of the //_explain/ response +type DocumentExplainResp struct { + Index string `json:"_index"` + ID string `json:"_id"` + Type string `json:"_type"` // Deprecated field + Matched bool `json:"matched"` + Explanation DocumentExplainDetails `json:"explanation"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r DocumentExplainResp) Inspect() Inspect { + return Inspect{Response: r.response} +} + +// DocumentExplainDetails is a sub type of DocumentExplainResp containing information about why a query does what it does +type DocumentExplainDetails struct { + Value float64 `json:"value"` + Description string `json:"description"` + Details []DocumentExplainDetails `json:"details"` +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-get-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-get-params.go new file mode 100644 index 000000000..7406c5bc8 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-get-params.go @@ -0,0 +1,117 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" +) + +// DocumentGetParams represents possible parameters for the DocumentGetReq +type DocumentGetParams struct { + Preference string + Realtime *bool + Refresh *bool + Routing string + Source interface{} + SourceExcludes []string + SourceIncludes []string + StoredFields []string + Version *int + VersionType string + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r DocumentGetParams) get() map[string]string { + params := make(map[string]string) + + if r.Preference != "" { + params["preference"] = r.Preference + } + + if r.Realtime != nil { + params["realtime"] = strconv.FormatBool(*r.Realtime) + } + + if r.Refresh != nil { + params["refresh"] = strconv.FormatBool(*r.Refresh) + } + + if r.Routing != "" { + params["routing"] = r.Routing + } + + switch source := r.Source.(type) { + case bool: + params["_source"] = strconv.FormatBool(source) + case string: + if source != "" { + params["_source"] = source + } + case []string: + if len(source) > 0 { + params["_source"] = strings.Join(source, ",") + } + } + + if len(r.SourceExcludes) > 0 { + params["_source_excludes"] = strings.Join(r.SourceExcludes, ",") + } + + if len(r.SourceIncludes) > 0 { + params["_source_includes"] = strings.Join(r.SourceIncludes, ",") + } + + if len(r.StoredFields) > 0 { + params["stored_fields"] = strings.Join(r.StoredFields, ",") + } + + if r.Version != nil { + params["version"] = strconv.FormatInt(int64(*r.Version), 10) + } + + if r.VersionType != "" { + params["version_type"] = r.VersionType + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-get.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-get.go new file mode 100644 index 000000000..697c5ae97 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-get.go @@ -0,0 +1,53 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "encoding/json" + "fmt" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// DocumentGetReq represents possible options for the //_doc/ get request +type DocumentGetReq struct { + Index string + DocumentID string + + Header http.Header + Params DocumentGetParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r DocumentGetReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "GET", + fmt.Sprintf("/%s/_doc/%s", r.Index, r.DocumentID), + nil, + r.Params.get(), + r.Header, + ) +} + +// DocumentGetResp represents the returned struct of the //_doc/ get response +type DocumentGetResp struct { + Index string `json:"_index"` + ID string `json:"_id"` + Version int `json:"_version"` + SeqNo int `json:"_seq_no"` + PrimaryTerm int `json:"_primary_term"` + Found bool `json:"found"` + Type string `json:"_type"` // Deprecated field + Source json.RawMessage `json:"_source"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r DocumentGetResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-source-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-source-params.go new file mode 100644 index 000000000..566d5b098 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-source-params.go @@ -0,0 +1,113 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" +) + +// DocumentSourceParams represents possible parameters for the DocumentSourceReq +type DocumentSourceParams struct { + Preference string + Realtime *bool + Refresh *bool + Routing string + // Deprecated: This parameter is similar to SourceIncludes, please use that instead. + Source interface{} + SourceExcludes []string + SourceIncludes []string + Version *int + VersionType string + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r DocumentSourceParams) get() map[string]string { + params := make(map[string]string) + + if r.Preference != "" { + params["preference"] = r.Preference + } + + if r.Realtime != nil { + params["realtime"] = strconv.FormatBool(*r.Realtime) + } + + if r.Refresh != nil { + params["refresh"] = strconv.FormatBool(*r.Refresh) + } + + if r.Routing != "" { + params["routing"] = r.Routing + } + + switch source := r.Source.(type) { + case bool: + params["_source"] = strconv.FormatBool(source) + case string: + if source != "" { + params["_source"] = source + } + case []string: + if len(source) > 0 { + params["_source"] = strings.Join(source, ",") + } + } + + if len(r.SourceExcludes) > 0 { + params["_source_excludes"] = strings.Join(r.SourceExcludes, ",") + } + + if len(r.SourceIncludes) > 0 { + params["_source_includes"] = strings.Join(r.SourceIncludes, ",") + } + + if r.Version != nil { + params["version"] = strconv.FormatInt(int64(*r.Version), 10) + } + + if r.VersionType != "" { + params["version_type"] = r.VersionType + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-source.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-source.go new file mode 100644 index 000000000..101055c92 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document-source.go @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "encoding/json" + "fmt" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// DocumentSourceReq represents possible options for the //_source/ get request +type DocumentSourceReq struct { + Index string + DocumentID string + + Header http.Header + Params DocumentSourceParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r DocumentSourceReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "GET", + fmt.Sprintf("/%s/_source/%s", r.Index, r.DocumentID), + nil, + r.Params.get(), + r.Header, + ) +} + +// DocumentSourceResp represents the returned struct of the //_source/ get response +type DocumentSourceResp struct { + Source json.RawMessage + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r DocumentSourceResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document.go new file mode 100644 index 000000000..d6c88592a --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_document.go @@ -0,0 +1,120 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +package opensearchapi + +import ( + "context" + + "github.com/opensearch-project/opensearch-go/v3" +) + +type documentClient struct { + apiClient *Client +} + +// Create executes a creade document request with the required DocumentCreateReq +func (c documentClient) Create(ctx context.Context, req DocumentCreateReq) (*DocumentCreateResp, error) { + var ( + data DocumentCreateResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Delete executes a delete document request with the required DocumentDeleteReq +func (c documentClient) Delete(ctx context.Context, req DocumentDeleteReq) (*DocumentDeleteResp, error) { + var ( + data DocumentDeleteResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// DeleteByQuery executes a delete by query request with the required DocumentDeleteByQueryReq +func (c documentClient) DeleteByQuery(ctx context.Context, req DocumentDeleteByQueryReq) (*DocumentDeleteByQueryResp, error) { + var ( + data DocumentDeleteByQueryResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// DeleteByQueryRethrottle executes a delete by query rethrottle request with the optional DocumentDeleteByQueryRethrottleReq +func (c documentClient) DeleteByQueryRethrottle( + ctx context.Context, + req DocumentDeleteByQueryRethrottleReq, +) (*DocumentDeleteByQueryRethrottleResp, error) { + var ( + data DocumentDeleteByQueryRethrottleResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Exists executes a exists document request with the required DocumentExistsReq +func (c documentClient) Exists(ctx context.Context, req DocumentExistsReq) (*opensearch.Response, error) { + return c.apiClient.do(ctx, req, nil) +} + +// ExistsSource executes a exists source request with the required DocumentExistsSourceReq +func (c documentClient) ExistsSource(ctx context.Context, req DocumentExistsSourceReq) (*opensearch.Response, error) { + return c.apiClient.do(ctx, req, nil) +} + +// Explain executes an explain document request with the required DocumentExplainReq +func (c documentClient) Explain(ctx context.Context, req DocumentExplainReq) (*DocumentExplainResp, error) { + var ( + data DocumentExplainResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Get executes a //_doc/ request with the required DocumentGetReq +func (c documentClient) Get(ctx context.Context, req DocumentGetReq) (*DocumentGetResp, error) { + var ( + data DocumentGetResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Source executes a //_source/ request with the required DocumentSourceReq +func (c documentClient) Source(ctx context.Context, req DocumentSourceReq) (*DocumentSourceResp, error) { + var ( + data DocumentSourceResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data.Source); err != nil { + return &data, err + } + + return &data, nil +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index-params.go new file mode 100644 index 000000000..97fb6313d --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index-params.go @@ -0,0 +1,113 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// IndexParams represents possible parameters for the IndexReq +type IndexParams struct { + IfPrimaryTerm *int + IfSeqNo *int + OpType string + Pipeline string + Refresh string + RequireAlias *bool + Routing string + Timeout time.Duration + Version *int + VersionType string + WaitForActiveShards string + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IndexParams) get() map[string]string { + params := make(map[string]string) + + if r.IfPrimaryTerm != nil { + params["if_primary_term"] = strconv.FormatInt(int64(*r.IfPrimaryTerm), 10) + } + + if r.IfSeqNo != nil { + params["if_seq_no"] = strconv.FormatInt(int64(*r.IfSeqNo), 10) + } + + if r.OpType != "" { + params["op_type"] = r.OpType + } + + if r.Pipeline != "" { + params["pipeline"] = r.Pipeline + } + + if r.Refresh != "" { + params["refresh"] = r.Refresh + } + + if r.RequireAlias != nil { + params["require_alias"] = strconv.FormatBool(*r.RequireAlias) + } + + if r.Routing != "" { + params["routing"] = r.Routing + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Version != nil { + params["version"] = strconv.FormatInt(int64(*r.Version), 10) + } + + if r.VersionType != "" { + params["version_type"] = r.VersionType + } + + if r.WaitForActiveShards != "" { + params["wait_for_active_shards"] = r.WaitForActiveShards + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index.go new file mode 100644 index 000000000..c1a2439db --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index.go @@ -0,0 +1,81 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" + "fmt" + "io" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// Index executes a /_doc request with the given IndexReq +func (c Client) Index(ctx context.Context, req IndexReq) (*IndexResp, error) { + var ( + data IndexResp + err error + ) + if data.response, err = c.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// IndexReq represents possible options for the /_doc request +type IndexReq struct { + Index string + DocumentID string + Body io.Reader + Header http.Header + Params IndexParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IndexReq) GetRequest() (*http.Request, error) { + var method, path string + + if r.DocumentID != "" { + method = "PUT" + path = fmt.Sprintf("/%s/_doc/%s", r.Index, r.DocumentID) + } else { + method = "POST" + path = fmt.Sprintf("/%s/_doc", r.Index) + } + + return opensearch.BuildRequest( + method, + path, + r.Body, + r.Params.get(), + r.Header, + ) +} + +// IndexResp represents the returned struct of the /_doc response +type IndexResp struct { + Index string `json:"_index"` + ID string `json:"_id"` + Version int `json:"_version"` + Result string `json:"result"` + Shards struct { + Total int `json:"total"` + Successful int `json:"successful"` + Failed int `json:"failed"` + } `json:"_shards"` + SeqNo int `json:"_seq_no"` + PrimaryTerm int `json:"_primary_term"` + Type string `json:"_type"` // Deprecated field + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IndexResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-create-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-create-params.go new file mode 100644 index 000000000..9eb9f4c99 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-create-params.go @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// IndexTemplateCreateParams represents possible parameters for the IndexTemplateCreateReq +type IndexTemplateCreateParams struct { + Cause string + Create *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IndexTemplateCreateParams) get() map[string]string { + params := make(map[string]string) + + if r.Cause != "" { + params["cause"] = r.Cause + } + + if r.Create != nil { + params["create"] = strconv.FormatBool(*r.Create) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-create.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-create.go new file mode 100644 index 000000000..6cb07e609 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-create.go @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "io" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IndexTemplateCreateReq represents possible options for the index create request +type IndexTemplateCreateReq struct { + IndexTemplate string + + Body io.Reader + + Header http.Header + Params IndexTemplateCreateParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IndexTemplateCreateReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "PUT", + fmt.Sprintf("/_index_template/%s", r.IndexTemplate), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// IndexTemplateCreateResp represents the returned struct of the index create response +type IndexTemplateCreateResp struct { + Acknowledged bool `json:"acknowledged"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IndexTemplateCreateResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-delete-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-delete-params.go new file mode 100644 index 000000000..d337ed6fa --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-delete-params.go @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "time" +) + +// IndexTemplateDeleteParams represents possible parameters for the IndexTemplateDeleteReq +type IndexTemplateDeleteParams struct { + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IndexTemplateDeleteParams) get() map[string]string { + params := make(map[string]string) + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-delete.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-delete.go new file mode 100644 index 000000000..10aa26c99 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-delete.go @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IndexTemplateDeleteReq represents possible options for the index create request +type IndexTemplateDeleteReq struct { + IndexTemplate string + + Header http.Header + Params IndexTemplateDeleteParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IndexTemplateDeleteReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "DELETE", + fmt.Sprintf("/_index_template/%s", r.IndexTemplate), + nil, + r.Params.get(), + r.Header, + ) +} + +// IndexTemplateDeleteResp represents the returned struct of the index create response +type IndexTemplateDeleteResp struct { + Acknowledged bool `json:"acknowledged"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IndexTemplateDeleteResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-exists-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-exists-params.go new file mode 100644 index 000000000..95a3c7179 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-exists-params.go @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// IndexTemplateExistsParams represents possible parameters for the IndexTemplateExistsReq +type IndexTemplateExistsParams struct { + FlatSettings *bool + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IndexTemplateExistsParams) get() map[string]string { + params := make(map[string]string) + + if r.FlatSettings != nil { + params["flat_settings"] = strconv.FormatBool(*r.FlatSettings) + } + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-exists.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-exists.go new file mode 100644 index 000000000..90e9e96fc --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-exists.go @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IndexTemplateExistsReq represents possible options for the index create request +type IndexTemplateExistsReq struct { + IndexTemplate string + + Header http.Header + Params IndexTemplateExistsParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IndexTemplateExistsReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "HEAD", + fmt.Sprintf("/_index_template/%s", r.IndexTemplate), + nil, + r.Params.get(), + r.Header, + ) +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-get-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-get-params.go new file mode 100644 index 000000000..bea907b77 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-get-params.go @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// IndexTemplateGetParams represents possible parameters for the IndexTemplateGetReq +type IndexTemplateGetParams struct { + FlatSettings *bool + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IndexTemplateGetParams) get() map[string]string { + params := make(map[string]string) + + if r.FlatSettings != nil { + params["flat_settings"] = strconv.FormatBool(*r.FlatSettings) + } + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-get.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-get.go new file mode 100644 index 000000000..50c7dd3c1 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-get.go @@ -0,0 +1,63 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "encoding/json" + "fmt" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IndexTemplateGetReq represents possible options for the index create request +type IndexTemplateGetReq struct { + IndexTemplates []string + + Header http.Header + Params IndexTemplateGetParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IndexTemplateGetReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "GET", + fmt.Sprintf("/_index_template/%s", strings.Join(r.IndexTemplates, ",")), + nil, + r.Params.get(), + r.Header, + ) +} + +// IndexTemplateGetResp represents the returned struct of the index create response +type IndexTemplateGetResp struct { + IndexTemplates []IndexTemplateGetDetails `json:"index_templates"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IndexTemplateGetResp) Inspect() Inspect { + return Inspect{Response: r.response} +} + +// IndexTemplateGetDetails is a sub type of IndexTemplateGetResp containing information about an index template +type IndexTemplateGetDetails struct { + Name string `json:"name"` + IndexTemplate struct { + IndexPatterns []string `json:"index_patterns"` + Template struct { + Mappings json.RawMessage `json:"mappings"` + Settings json.RawMessage `json:"settings"` + Aliases json.RawMessage `json:"aliases"` + } `json:"template"` + ComposedOf []string `json:"composed_of"` + Priority int `json:"priority"` + Version int `json:"version"` + DataStream json.RawMessage `json:"data_stream"` + } `json:"index_template"` +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-simulate-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-simulate-params.go new file mode 100644 index 000000000..488c78ccb --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-simulate-params.go @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// IndexTemplateSimulateParams represents possible parameters for the IndexTemplateSimulateReq +type IndexTemplateSimulateParams struct { + Cause string + Create *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IndexTemplateSimulateParams) get() map[string]string { + params := make(map[string]string) + + if r.Cause != "" { + params["cause"] = r.Cause + } + + if r.Create != nil { + params["create"] = strconv.FormatBool(*r.Create) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-simulate.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-simulate.go new file mode 100644 index 000000000..207f493e1 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-simulate.go @@ -0,0 +1,56 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "encoding/json" + "fmt" + "io" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IndexTemplateSimulateReq represents possible options for the index create request +type IndexTemplateSimulateReq struct { + IndexTemplate string + + Body io.Reader + + Header http.Header + Params IndexTemplateSimulateParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IndexTemplateSimulateReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "POST", + fmt.Sprintf("/_index_template/_simulate/%s", r.IndexTemplate), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// IndexTemplateSimulateResp represents the returned struct of the index create response +type IndexTemplateSimulateResp struct { + Template struct { + Mappings json.RawMessage `json:"mappings"` + Settings json.RawMessage `json:"settings"` + Aliases json.RawMessage `json:"aliases"` + } `json:"template"` + Overlapping []struct { + Name string `json:"name"` + IndexPatterns []string `json:"index_patterns"` + } `json:"overlapping"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IndexTemplateSimulateResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-simulate_index-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-simulate_index-params.go new file mode 100644 index 000000000..c437a908e --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-simulate_index-params.go @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// IndexTemplateSimulateIndexParams represents possible parameters for the IndexTemplateSimulateIndexReq +type IndexTemplateSimulateIndexParams struct { + Cause string + Create *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IndexTemplateSimulateIndexParams) get() map[string]string { + params := make(map[string]string) + + if r.Cause != "" { + params["cause"] = r.Cause + } + + if r.Create != nil { + params["create"] = strconv.FormatBool(*r.Create) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-simulate_index.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-simulate_index.go new file mode 100644 index 000000000..a7624fb1e --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template-simulate_index.go @@ -0,0 +1,56 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "encoding/json" + "fmt" + "io" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IndexTemplateSimulateIndexReq represents possible options for the index create request +type IndexTemplateSimulateIndexReq struct { + Index string + + Body io.Reader + + Header http.Header + Params IndexTemplateSimulateIndexParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IndexTemplateSimulateIndexReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "POST", + fmt.Sprintf("/_index_template/_simulate_index/%s", r.Index), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// IndexTemplateSimulateIndexResp represents the returned struct of the index create response +type IndexTemplateSimulateIndexResp struct { + Template struct { + Mappings json.RawMessage `json:"mappings"` + Settings json.RawMessage `json:"settings"` + Aliases json.RawMessage `json:"aliases"` + } `json:"template"` + Overlapping []struct { + Name string `json:"name"` + IndexPatterns []string `json:"index_patterns"` + } `json:"overlapping"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IndexTemplateSimulateIndexResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template.go new file mode 100644 index 000000000..67c603f0e --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_index_template.go @@ -0,0 +1,94 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" + + "github.com/opensearch-project/opensearch-go/v3" +) + +type indexTemplateClient struct { + apiClient *Client +} + +// Create executes a creade indexTemplate request with the required IndexTemplateCreateReq +func (c indexTemplateClient) Create(ctx context.Context, req IndexTemplateCreateReq) (*IndexTemplateCreateResp, error) { + var ( + data IndexTemplateCreateResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Delete executes a delete indexTemplate request with the required IndexTemplateDeleteReq +func (c indexTemplateClient) Delete(ctx context.Context, req IndexTemplateDeleteReq) (*IndexTemplateDeleteResp, error) { + var ( + data IndexTemplateDeleteResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Get executes a get indexTemplate request with the optional IndexTemplateGetReq +func (c indexTemplateClient) Get(ctx context.Context, req *IndexTemplateGetReq) (*IndexTemplateGetResp, error) { + if req == nil { + req = &IndexTemplateGetReq{} + } + + var ( + data IndexTemplateGetResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Exists executes a exists indexTemplate request with the required IndexTemplatExistsReq +func (c indexTemplateClient) Exists(ctx context.Context, req IndexTemplateExistsReq) (*opensearch.Response, error) { + return c.apiClient.do(ctx, req, nil) +} + +// Simulate executes a _simulate indexTemplate request with the required IndexTemplateSimulateReq +func (c indexTemplateClient) Simulate(ctx context.Context, req IndexTemplateSimulateReq) (*IndexTemplateSimulateResp, error) { + var ( + data IndexTemplateSimulateResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// SimulateIndex executes a _simulate_index indexTemplate request with the required IndexTemplateSimulateIndexReq +func (c indexTemplateClient) SimulateIndex( + ctx context.Context, + req IndexTemplateSimulateIndexReq, +) (*IndexTemplateSimulateIndexResp, error) { + var ( + data IndexTemplateSimulateIndexResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-alias-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-alias-params.go new file mode 100644 index 000000000..eafa53938 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-alias-params.go @@ -0,0 +1,206 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// AliasDeleteParams represents possible parameters for the AliasDeleteReq +type AliasDeleteParams struct { + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r AliasDeleteParams) get() map[string]string { + params := make(map[string]string) + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} + +// AliasGetParams represents possible parameters for the AliasGetReq +type AliasGetParams struct { + AllowNoIndices *bool + ExpandWildcards string + IgnoreUnavailable *bool + Local *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r AliasGetParams) get() map[string]string { + params := make(map[string]string) + + if r.AllowNoIndices != nil { + params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} + +// AliasPutParams represents possible parameters for the AliasPutReq +type AliasPutParams struct { + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r AliasPutParams) get() map[string]string { + params := make(map[string]string) + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} + +// AliasExistsParams represents possible parameters for the AliasExistsReq +type AliasExistsParams struct { + AllowNoIndices *bool + ExpandWildcards string + IgnoreUnavailable *bool + Local *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r AliasExistsParams) get() map[string]string { + params := make(map[string]string) + + if r.AllowNoIndices != nil { + params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-alias.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-alias.go new file mode 100644 index 000000000..2aaadeaff --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-alias.go @@ -0,0 +1,214 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" + "encoding/json" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +type aliasClient struct { + apiClient *Client +} + +// Delete executes a delete alias request with the required AliasDeleteReq +func (c aliasClient) Delete(ctx context.Context, req AliasDeleteReq) (*AliasDeleteResp, error) { + var ( + data AliasDeleteResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Get executes a get alias request with the required AliasGetReq +func (c aliasClient) Get(ctx context.Context, req AliasGetReq) (*AliasGetResp, error) { + var ( + data AliasGetResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data.Indices); err != nil { + return &data, err + } + + return &data, nil +} + +// Put executes a put alias request with the required AliasPutReq +func (c aliasClient) Put(ctx context.Context, req AliasPutReq) (*AliasPutResp, error) { + var ( + data AliasPutResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Exists executes an exists alias request with the required AliasExistsReq +func (c aliasClient) Exists(ctx context.Context, req AliasExistsReq) (*opensearch.Response, error) { + return c.apiClient.do(ctx, req, nil) +} + +// AliasDeleteReq represents possible options for the alias delete request +type AliasDeleteReq struct { + Indices []string + Alias []string + + Header http.Header + Params AliasDeleteParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r AliasDeleteReq) GetRequest() (*http.Request, error) { + aliases := strings.Join(r.Alias, ",") + indices := strings.Join(r.Indices, ",") + + var path strings.Builder + path.Grow(9 + len(indices) + len(aliases)) + path.WriteString("/") + path.WriteString(indices) + path.WriteString("/_alias/") + path.WriteString(aliases) + return opensearch.BuildRequest( + "DELETE", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// AliasDeleteResp represents the returned struct of the alias delete response +type AliasDeleteResp struct { + Acknowledged bool `json:"acknowledged"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r AliasDeleteResp) Inspect() Inspect { + return Inspect{Response: r.response} +} + +// AliasGetReq represents possible options for the alias get request +type AliasGetReq struct { + Indices []string + Alias []string + + Header http.Header + Params AliasGetParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r AliasGetReq) GetRequest() (*http.Request, error) { + aliases := strings.Join(r.Alias, ",") + indices := strings.Join(r.Indices, ",") + + var path strings.Builder + path.Grow(9 + len(indices) + len(aliases)) + path.WriteString("/") + path.WriteString(indices) + path.WriteString("/_alias/") + path.WriteString(aliases) + return opensearch.BuildRequest( + "GET", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// AliasGetResp represents the returned struct of the alias get response +type AliasGetResp struct { + Indices map[string]struct { + Aliases map[string]json.RawMessage `json:"aliases"` + } + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r AliasGetResp) Inspect() Inspect { + return Inspect{Response: r.response} +} + +// AliasPutReq represents possible options for the alias put request +type AliasPutReq struct { + Indices []string + Alias string + + Header http.Header + Params AliasPutParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r AliasPutReq) GetRequest() (*http.Request, error) { + indices := strings.Join(r.Indices, ",") + + var path strings.Builder + path.Grow(9 + len(indices) + len(r.Alias)) + path.WriteString("/") + path.WriteString(indices) + path.WriteString("/_alias/") + path.WriteString(r.Alias) + return opensearch.BuildRequest( + "PUT", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// AliasPutResp represents the returned struct of the alias put response +type AliasPutResp struct { + Acknowledged bool `json:"acknowledged"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r AliasPutResp) Inspect() Inspect { + return Inspect{Response: r.response} +} + +// AliasExistsReq represents possible options for the alias exists request +type AliasExistsReq struct { + Indices []string + Alias []string + + Header http.Header + Params AliasExistsParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r AliasExistsReq) GetRequest() (*http.Request, error) { + aliases := strings.Join(r.Alias, ",") + indices := strings.Join(r.Indices, ",") + + var path strings.Builder + path.Grow(9 + len(indices) + len(r.Alias)) + path.WriteString("/") + path.WriteString(indices) + path.WriteString("/_alias/") + path.WriteString(aliases) + return opensearch.BuildRequest( + "HEAD", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-analyze-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-analyze-params.go new file mode 100644 index 000000000..f1052ba01 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-analyze-params.go @@ -0,0 +1,52 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +// IndicesAnalyzeParams represents possible parameters for the IndicesAnalyzeReq +type IndicesAnalyzeParams struct { + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IndicesAnalyzeParams) get() map[string]string { + params := make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-analyze.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-analyze.go new file mode 100644 index 000000000..31de02f9b --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-analyze.go @@ -0,0 +1,128 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "bytes" + "encoding/json" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IndicesAnalyzeReq represents possible options for the /_analyze request +type IndicesAnalyzeReq struct { + Index string + Body IndicesAnalyzeBody + + Header http.Header + Params IndicesAnalyzeParams +} + +// IndicesAnalyzeBody represents the request body for the indices analyze request +type IndicesAnalyzeBody struct { + Analyzer string `json:"analyzer,omitempty"` + Attributes []string `json:"attributes,omitempty"` + CharFilter []string `json:"char_filter,omitempty"` + Explain bool `json:"explain,omitempty"` + Field string `json:"field,omitempty"` + Filter []string `json:"filter,omitempty"` + Normalizer string `json:"normalizer,omitempty"` + Text []string `json:"text"` + Tokenizer string `json:"tokenizer,omitempty"` +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IndicesAnalyzeReq) GetRequest() (*http.Request, error) { + body, err := json.Marshal(r.Body) + if err != nil { + return nil, err + } + + var path strings.Builder + path.Grow(10 + len(r.Index)) + if len(r.Index) != 0 { + path.WriteString("/") + path.WriteString(r.Index) + } + path.WriteString("/_analyze") + return opensearch.BuildRequest( + "GET", + path.String(), + bytes.NewReader(body), + r.Params.get(), + r.Header, + ) +} + +// IndicesAnalyzeResp represents the returned struct of the index create response +type IndicesAnalyzeResp struct { + Tokens []IndicesAnalyzeToken `json:"tokens"` + Detail struct { + CustomAnalyzer bool `json:"custom_analyzer"` + Charfilters []IndicesAnalyzeCharfilter `json:"charfilters"` + Tokenizer IndicesAnalyzeTokenizer `json:"tokenizer"` + Tokenfilters []IndicesAnalyzeTokenfilters `json:"tokenfilters"` + Analyzer IndicesAnalyzeInfo `json:"analyzer"` + } `json:"detail"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IndicesAnalyzeResp) Inspect() Inspect { + return Inspect{Response: r.response} +} + +// IndicesAnalyzeToken is a sut type of IndicesAnalyzeResp containing information about analyzer token +type IndicesAnalyzeToken struct { + Token string `json:"token"` + StartOffset int `json:"start_offset"` + EndOffset int `json:"end_offset"` + Type string `json:"type"` + Position int `json:"position"` +} + +// IndicesAnalyzeTokenizer is a sub type of IndicesAnalyzerResp containing information about the tokenizer name and tokens +type IndicesAnalyzeTokenizer struct { + Name string `json:"name"` + Tokens []IndicesAnalyzeToken `json:"tokens"` +} + +// IndicesAnalyzeTokenfilters is a sub type of IndicesAnalyzerResp containing information about the token filers name and tokens +type IndicesAnalyzeTokenfilters struct { + Name string `json:"name"` + Tokens []struct { + Token string `json:"token"` + StartOffset int `json:"start_offset"` + EndOffset int `json:"end_offset"` + Type string `json:"type"` + Position int `json:"position"` + Keyword bool `json:"keyword"` + } `json:"tokens"` +} + +// IndicesAnalyzeCharfilter is a sub type of IndicesAnalyzerResp containing information about the char filter name and filtered text +type IndicesAnalyzeCharfilter struct { + Name string `json:"name"` + FilteredText []string `json:"filtered_text"` +} + +// IndicesAnalyzeInfo is a sub type of IndicesAnalyzerResp containing information about the analyzer name and tokens +type IndicesAnalyzeInfo struct { + Name string `json:"name"` + Tokens []struct { + Token string `json:"token"` + StartOffset int `json:"start_offset"` + EndOffset int `json:"end_offset"` + Type string `json:"type"` + Position int `json:"position"` + Bytes string `json:"bytes"` + PositionLength int `json:"positionLength"` + TermFrequency int `json:"termFrequency"` + } `json:"tokens"` +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-block-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-block-params.go new file mode 100644 index 000000000..c1577e887 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-block-params.go @@ -0,0 +1,88 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// IndicesBlockParams represents possible parameters for the IndicesBlockReq +type IndicesBlockParams struct { + AllowNoIndices *bool + ExpandWildcards string + IgnoreUnavailable *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IndicesBlockParams) get() map[string]string { + params := make(map[string]string) + + if r.AllowNoIndices != nil { + params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-block.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-block.go new file mode 100644 index 000000000..3d9513a14 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-block.go @@ -0,0 +1,58 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IndicesBlockReq represents possible options for the index create request +type IndicesBlockReq struct { + Indices []string + Block string + + Header http.Header + Params IndicesBlockParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IndicesBlockReq) GetRequest() (*http.Request, error) { + indices := strings.Join(r.Indices, ",") + + var path strings.Builder + path.Grow(9 + len(indices) + len(r.Block)) + path.WriteString("/") + path.WriteString(indices) + path.WriteString("/_block/") + path.WriteString(r.Block) + return opensearch.BuildRequest( + "PUT", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// IndicesBlockResp represents the returned struct of the index create response +type IndicesBlockResp struct { + Acknowledged bool `json:"acknowledged"` + ShardsAcknowledged bool `json:"shards_acknowledged"` + Indices []struct { + Name string `json:"name"` + Blocked bool `json:"blocked"` + } `json:"indices"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IndicesBlockResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-cache-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-cache-params.go new file mode 100644 index 000000000..5a9821148 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-cache-params.go @@ -0,0 +1,93 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" +) + +// IndicesClearCacheParams represents possible parameters for the IndicesClearCacheReq +type IndicesClearCacheParams struct { + AllowNoIndices *bool + ExpandWildcards string + Fielddata *bool + Fields []string + IgnoreUnavailable *bool + Query *bool + Request *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IndicesClearCacheParams) get() map[string]string { + params := make(map[string]string) + + if r.AllowNoIndices != nil { + params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if r.Fielddata != nil { + params["fielddata"] = strconv.FormatBool(*r.Fielddata) + } + + if len(r.Fields) > 0 { + params["fields"] = strings.Join(r.Fields, ",") + } + + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + + if r.Query != nil { + params["query"] = strconv.FormatBool(*r.Query) + } + + if r.Request != nil { + params["request"] = strconv.FormatBool(*r.Request) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-cache.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-cache.go new file mode 100644 index 000000000..e3e2bfab7 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-cache.go @@ -0,0 +1,58 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IndicesClearCacheReq represents possible options for the index clear cache request +type IndicesClearCacheReq struct { + Indices []string + + Header http.Header + Params IndicesClearCacheParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IndicesClearCacheReq) GetRequest() (*http.Request, error) { + indices := strings.Join(r.Indices, ",") + + var path strings.Builder + path.Grow(len("//_cache/clear") + len(indices)) + if len(indices) != 0 { + path.WriteString("/") + path.WriteString(indices) + } + path.WriteString("/_cache/clear") + + return opensearch.BuildRequest( + "POST", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// IndicesClearCacheResp represents the returned struct of the index clear cache response +type IndicesClearCacheResp struct { + Shards struct { + Total int `json:"total"` + Successful int `json:"successful"` + Failed int `json:"failed"` + } `json:"_shards"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IndicesClearCacheResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-clone-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-clone-params.go new file mode 100644 index 000000000..414ca22c0 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-clone-params.go @@ -0,0 +1,73 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "time" +) + +// IndicesCloneParams represents possible parameters for the IndicesCloneReq +type IndicesCloneParams struct { + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + WaitForActiveShards string + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IndicesCloneParams) get() map[string]string { + params := make(map[string]string) + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-clone.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-clone.go new file mode 100644 index 000000000..7160ba844 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-clone.go @@ -0,0 +1,50 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "io" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IndicesCloneReq represents possible options for the index clone request +type IndicesCloneReq struct { + Index string + Target string + + Body io.Reader + + Header http.Header + Params IndicesCloneParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IndicesCloneReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "POST", + fmt.Sprintf("/%s/_clone/%s", r.Index, r.Target), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// IndicesCloneResp represents the returned struct of the index clone response +type IndicesCloneResp struct { + Acknowledged bool `json:"acknowledged"` + ShardsAcknowledged bool `json:"shards_acknowledged"` + Index string `json:"index"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IndicesCloneResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-close-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-close-params.go new file mode 100644 index 000000000..2eb19e7d6 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-close-params.go @@ -0,0 +1,93 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// IndicesCloseParams represents possible parameters for the IndicesCloseReq +type IndicesCloseParams struct { + AllowNoIndices *bool + ExpandWildcards string + IgnoreUnavailable *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + WaitForActiveShards string + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IndicesCloseParams) get() map[string]string { + params := make(map[string]string) + + if r.AllowNoIndices != nil { + params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.WaitForActiveShards != "" { + params["wait_for_active_shards"] = r.WaitForActiveShards + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-close.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-close.go new file mode 100644 index 000000000..99f00e405 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-close.go @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IndicesCloseReq represents possible options for the index close request +type IndicesCloseReq struct { + Index string + + Header http.Header + Params IndicesCloseParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IndicesCloseReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "POST", + fmt.Sprintf("/%s/_close", r.Index), + nil, + r.Params.get(), + r.Header, + ) +} + +// IndicesCloseResp represents the returned struct of the index close response +type IndicesCloseResp struct { + Acknowledged bool `json:"acknowledged"` + ShardsAcknowledged bool `json:"shards_acknowledged"` + Indices map[string]struct { + Closed bool `json:"closed"` + } `json:"indices"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IndicesCloseResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-count-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-count-params.go new file mode 100644 index 000000000..204c16eeb --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-count-params.go @@ -0,0 +1,128 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" +) + +// IndicesCountParams represents possible parameters for the IndicesCountReq +type IndicesCountParams struct { + AllowNoIndices *bool + Analyzer string + AnalyzeWildcard *bool + DefaultOperator string + Df string + ExpandWildcards string + IgnoreThrottled *bool + IgnoreUnavailable *bool + Lenient *bool + MinScore *int + Preference string + Query string + Routing []string + TerminateAfter *int + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IndicesCountParams) get() map[string]string { + params := make(map[string]string) + + if r.AllowNoIndices != nil { + params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) + } + + if r.Analyzer != "" { + params["analyzer"] = r.Analyzer + } + + if r.AnalyzeWildcard != nil { + params["analyze_wildcard"] = strconv.FormatBool(*r.AnalyzeWildcard) + } + + if r.DefaultOperator != "" { + params["default_operator"] = r.DefaultOperator + } + + if r.Df != "" { + params["df"] = r.Df + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if r.IgnoreThrottled != nil { + params["ignore_throttled"] = strconv.FormatBool(*r.IgnoreThrottled) + } + + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + + if r.Lenient != nil { + params["lenient"] = strconv.FormatBool(*r.Lenient) + } + + if r.MinScore != nil { + params["min_score"] = strconv.FormatInt(int64(*r.MinScore), 10) + } + + if r.Preference != "" { + params["preference"] = r.Preference + } + + if r.Query != "" { + params["q"] = r.Query + } + + if len(r.Routing) > 0 { + params["routing"] = strings.Join(r.Routing, ",") + } + + if r.TerminateAfter != nil { + params["terminate_after"] = strconv.FormatInt(int64(*r.TerminateAfter), 10) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-count.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-count.go new file mode 100644 index 000000000..389ab779a --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-count.go @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "io" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IndicesCountReq represents possible options for the index shrink request +type IndicesCountReq struct { + Indices []string + + Body io.Reader + + Header http.Header + Params IndicesCountParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IndicesCountReq) GetRequest() (*http.Request, error) { + indices := strings.Join(r.Indices, ",") + + var path strings.Builder + path.Grow(8 + len(indices)) + if len(indices) > 0 { + path.WriteString("/") + path.WriteString(indices) + } + path.WriteString("/_count") + return opensearch.BuildRequest( + "POST", + path.String(), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// IndicesCountResp represents the returned struct of the index shrink response +type IndicesCountResp struct { + Shards struct { + Total int `json:"total"` + Successful int `json:"successful"` + Skipped int `json:"skipped"` + Failed int `json:"failed"` + } `json:"_shards"` + Count int `json:"count"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IndicesCountResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-create-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-create-params.go new file mode 100644 index 000000000..c21781a5d --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-create-params.go @@ -0,0 +1,76 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "time" +) + +// IndicesCreateParams represents possible parameters for the IndicesCreateReq +type IndicesCreateParams struct { + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + WaitForActiveShards string + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IndicesCreateParams) get() map[string]string { + params := make(map[string]string) + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.WaitForActiveShards != "" { + params["wait_for_active_shards"] = r.WaitForActiveShards + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-create.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-create.go new file mode 100644 index 000000000..76ba7362c --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-create.go @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "io" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IndicesCreateReq represents possible options for the index create request +type IndicesCreateReq struct { + Index string + Body io.Reader + Header http.Header + Params IndicesCreateParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IndicesCreateReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "PUT", + fmt.Sprintf("%s%s", "/", r.Index), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// IndicesCreateResp represents the returned struct of the index create response +type IndicesCreateResp struct { + Acknowledged bool `json:"acknowledged"` + ShardsAcknowledged bool `json:"shards_acknowledged"` + Index string `json:"index"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IndicesCreateResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-delete-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-delete-params.go new file mode 100644 index 000000000..d862ba791 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-delete-params.go @@ -0,0 +1,87 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// IndicesDeleteParams represents possible parameters for the IndicesDeleteReq +type IndicesDeleteParams struct { + AllowNoIndices *bool + ExpandWildcards string + IgnoreUnavailable *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IndicesDeleteParams) get() map[string]string { + params := make(map[string]string) + if r.AllowNoIndices != nil { + params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-delete.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-delete.go new file mode 100644 index 000000000..ac46f0af4 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-delete.go @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IndicesDeleteReq represents possible options for the delete indices request +type IndicesDeleteReq struct { + Indices []string + Header http.Header + Params IndicesDeleteParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IndicesDeleteReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "DELETE", + fmt.Sprintf("%s%s", "/", strings.Join(r.Indices, ",")), + nil, + r.Params.get(), + r.Header, + ) +} + +// IndicesDeleteResp represents the returned struct of the delete indices response +type IndicesDeleteResp struct { + Acknowledged bool `json:"acknowledged"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IndicesDeleteResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-exists-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-exists-params.go new file mode 100644 index 000000000..9a56e5017 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-exists-params.go @@ -0,0 +1,85 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import "strconv" + +// IndicesExistsParams represents possible parameters for the IndicesExistsReq +type IndicesExistsParams struct { + AllowNoIndices *bool + ExpandWildcards string + FlatSettings *bool + IgnoreUnavailable *bool + IncludeDefaults *bool + Local *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IndicesExistsParams) get() map[string]string { + params := make(map[string]string) + + if r.AllowNoIndices != nil { + params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if r.FlatSettings != nil { + params["flat_settings"] = strconv.FormatBool(*r.FlatSettings) + } + + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + + if r.IncludeDefaults != nil { + params["include_defaults"] = strconv.FormatBool(*r.IncludeDefaults) + } + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-exists.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-exists.go new file mode 100644 index 000000000..6b0f2ec60 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-exists.go @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IndicesExistsReq represents possible options for the index exists request +type IndicesExistsReq struct { + Indices []string + Header http.Header + Params IndicesExistsParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IndicesExistsReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "HEAD", + fmt.Sprintf("%s%s", "/", strings.Join(r.Indices, ",")), + nil, + r.Params.get(), + r.Header, + ) +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-field_caps-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-field_caps-params.go new file mode 100644 index 000000000..cb0d5e26b --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-field_caps-params.go @@ -0,0 +1,83 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" +) + +// IndicesFieldCapsParams represents possible parameters for the IndicesFieldCapsReq +type IndicesFieldCapsParams struct { + AllowNoIndices *bool + ExpandWildcards string + Fields []string + IgnoreUnavailable *bool + IncludeUnmapped *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IndicesFieldCapsParams) get() map[string]string { + params := make(map[string]string) + + if r.AllowNoIndices != nil { + params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if len(r.Fields) > 0 { + params["fields"] = strings.Join(r.Fields, ",") + } + + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + + if r.IncludeUnmapped != nil { + params["include_unmapped"] = strconv.FormatBool(*r.IncludeUnmapped) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-field_caps.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-field_caps.go new file mode 100644 index 000000000..a376c28b3 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-field_caps.go @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "io" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IndicesFieldCapsReq represents possible options for the index shrink request +type IndicesFieldCapsReq struct { + Indices []string + + Body io.Reader + + Header http.Header + Params IndicesFieldCapsParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IndicesFieldCapsReq) GetRequest() (*http.Request, error) { + indices := strings.Join(r.Indices, ",") + + var path strings.Builder + path.Grow(10 + len(indices)) + if len(indices) > 0 { + path.WriteString("/") + path.WriteString(indices) + } + path.WriteString("/_field_caps") + return opensearch.BuildRequest( + "POST", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// IndicesFieldCapsResp represents the returned struct of the index shrink response +type IndicesFieldCapsResp struct { + Indices []string `json:"indices"` + Fields map[string]map[string]struct { + Type string `json:"type"` + Searchable bool `json:"searchable"` + Aggregatable bool `json:"aggregatable"` + Indices []string `json:"indices"` + } `json:"fields"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IndicesFieldCapsResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-flush-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-flush-params.go new file mode 100644 index 000000000..7e70370d2 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-flush-params.go @@ -0,0 +1,82 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" +) + +// IndicesFlushParams represents possible parameters for the IndicesFlushReq +type IndicesFlushParams struct { + AllowNoIndices *bool + ExpandWildcards string + Force *bool + IgnoreUnavailable *bool + WaitIfOngoing *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IndicesFlushParams) get() map[string]string { + params := make(map[string]string) + + if r.AllowNoIndices != nil { + params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if r.Force != nil { + params["force"] = strconv.FormatBool(*r.Force) + } + + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + + if r.WaitIfOngoing != nil { + params["wait_if_ongoing"] = strconv.FormatBool(*r.WaitIfOngoing) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-flush.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-flush.go new file mode 100644 index 000000000..9ab38d3dc --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-flush.go @@ -0,0 +1,57 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IndicesFlushReq represents possible options for the flush indices request +type IndicesFlushReq struct { + Indices []string + + Header http.Header + Params IndicesFlushParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IndicesFlushReq) GetRequest() (*http.Request, error) { + indices := strings.Join(r.Indices, ",") + + var path strings.Builder + path.Grow(len("//_flush") + len(indices)) + if len(indices) > 0 { + path.WriteString("/") + path.WriteString(indices) + } + path.WriteString("/_flush") + return opensearch.BuildRequest( + "POST", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// IndicesFlushResp represents the returned struct of the flush indices response +type IndicesFlushResp struct { + Shards struct { + Total int `json:"total"` + Successful int `json:"successful"` + Failed int `json:"failed"` + } `json:"_shards"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IndicesFlushResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-forcemerge-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-forcemerge-params.go new file mode 100644 index 000000000..4602fed6b --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-forcemerge-params.go @@ -0,0 +1,87 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" +) + +// IndicesForcemergeParams represents possible parameters for the IndicesForcemergeReq +type IndicesForcemergeParams struct { + AllowNoIndices *bool + ExpandWildcards string + Flush *bool + IgnoreUnavailable *bool + MaxNumSegments *int + OnlyExpungeDeletes *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IndicesForcemergeParams) get() map[string]string { + params := make(map[string]string) + + if r.AllowNoIndices != nil { + params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if r.Flush != nil { + params["flush"] = strconv.FormatBool(*r.Flush) + } + + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + + if r.MaxNumSegments != nil { + params["max_num_segments"] = strconv.FormatInt(int64(*r.MaxNumSegments), 10) + } + + if r.OnlyExpungeDeletes != nil { + params["only_expunge_deletes"] = strconv.FormatBool(*r.OnlyExpungeDeletes) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-forcemerge.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-forcemerge.go new file mode 100644 index 000000000..4ca388b9e --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-forcemerge.go @@ -0,0 +1,57 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IndicesForcemergeReq represents possible options for the /_forcemerge request +type IndicesForcemergeReq struct { + Indices []string + + Header http.Header + Params IndicesForcemergeParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IndicesForcemergeReq) GetRequest() (*http.Request, error) { + indices := strings.Join(r.Indices, ",") + + var path strings.Builder + path.Grow(len("//_forcemerge") + len(indices)) + if len(indices) > 0 { + path.WriteString("/") + path.WriteString(indices) + } + path.WriteString("/_forcemerge") + return opensearch.BuildRequest( + "POST", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// IndicesForcemergeResp represents the returned struct of the flush indices response +type IndicesForcemergeResp struct { + Shards struct { + Total int `json:"total"` + Successful int `json:"successful"` + Failed int `json:"failed"` + } `json:"_shards"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IndicesForcemergeResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-get-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-get-params.go new file mode 100644 index 000000000..0046c6a33 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-get-params.go @@ -0,0 +1,98 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// IndicesGetParams represents possible parameters for the IndicesGetReq +type IndicesGetParams struct { + AllowNoIndices *bool + ExpandWildcards string + FlatSettings *bool + IgnoreUnavailable *bool + IncludeDefaults *bool + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IndicesGetParams) get() map[string]string { + params := make(map[string]string) + + if r.AllowNoIndices != nil { + params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if r.FlatSettings != nil { + params["flat_settings"] = strconv.FormatBool(*r.FlatSettings) + } + + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + + if r.IncludeDefaults != nil { + params["include_defaults"] = strconv.FormatBool(*r.IncludeDefaults) + } + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-get.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-get.go new file mode 100644 index 000000000..4a6ecdbc4 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-get.go @@ -0,0 +1,50 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "encoding/json" + "fmt" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IndicesGetReq represents possible options for the get indices request +type IndicesGetReq struct { + Indices []string + + Header http.Header + Params IndicesGetParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IndicesGetReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "GET", + fmt.Sprintf("/%s", strings.Join(r.Indices, ",")), + nil, + r.Params.get(), + r.Header, + ) +} + +// IndicesGetResp represents the returned struct of the get indices response +type IndicesGetResp struct { + Indices map[string]struct { + Aliases map[string]struct{} `json:"aliases"` + Mappings json.RawMessage `json:"mappings"` + Settings json.RawMessage `json:"settings"` + } + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IndicesGetResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-mapping-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-mapping-params.go new file mode 100644 index 000000000..87467dc6a --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-mapping-params.go @@ -0,0 +1,149 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// MappingGetParams represents possible parameters for the MappingGetReq +type MappingGetParams struct { + AllowNoIndices *bool + ExpandWildcards string + IgnoreUnavailable *bool + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r MappingGetParams) get() map[string]string { + params := make(map[string]string) + + if r.AllowNoIndices != nil { + params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} + +// MappingPutParams represents possible parameters for the MappingPutReq +type MappingPutParams struct { + AllowNoIndices *bool + ExpandWildcards string + IgnoreUnavailable *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + WriteIndexOnly *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r MappingPutParams) get() map[string]string { + params := make(map[string]string) + + if r.AllowNoIndices != nil { + params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.WriteIndexOnly != nil { + params["write_index_only"] = strconv.FormatBool(*r.WriteIndexOnly) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-mapping.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-mapping.go new file mode 100644 index 000000000..7e689fe23 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-mapping.go @@ -0,0 +1,192 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" + "encoding/json" + "io" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +type mappingClient struct { + apiClient *Client +} + +// Get executes a get mapping request with the required MappingGetReq +func (c mappingClient) Get(ctx context.Context, req *MappingGetReq) (*MappingGetResp, error) { + if req == nil { + req = &MappingGetReq{} + } + + var ( + data MappingGetResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data.Indices); err != nil { + return &data, err + } + + return &data, nil +} + +// Put executes a put mapping request with the required MappingPutReq +func (c mappingClient) Put(ctx context.Context, req MappingPutReq) (*MappingPutResp, error) { + var ( + data MappingPutResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Field executes a field mapping request with the optional MappingFieldReq +func (c mappingClient) Field(ctx context.Context, req *MappingFieldReq) (*MappingFieldResp, error) { + if req == nil { + req = &MappingFieldReq{} + } + + var ( + data MappingFieldResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// MappingGetReq represents possible options for the mapping get request +type MappingGetReq struct { + Indices []string + + Header http.Header + Params MappingGetParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r MappingGetReq) GetRequest() (*http.Request, error) { + indices := strings.Join(r.Indices, ",") + + var path strings.Builder + path.Grow(10 + len(indices)) + if len(indices) > 0 { + path.WriteString("/") + path.WriteString(indices) + } + path.WriteString("/_mapping") + return opensearch.BuildRequest( + "GET", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// MappingGetResp represents the returned struct of the mapping get response +type MappingGetResp struct { + Indices map[string]struct { + Mappings json.RawMessage `json:"mappings"` + } + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r MappingGetResp) Inspect() Inspect { + return Inspect{Response: r.response} +} + +// MappingPutReq represents possible options for the mapping put request +type MappingPutReq struct { + Indices []string + + Body io.Reader + + Header http.Header + Params MappingPutParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r MappingPutReq) GetRequest() (*http.Request, error) { + indices := strings.Join(r.Indices, ",") + + var path strings.Builder + path.Grow(10 + len(indices)) + path.WriteString("/") + path.WriteString(indices) + path.WriteString("/_mapping") + return opensearch.BuildRequest( + "PUT", + path.String(), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// MappingPutResp represents the returned struct of the mapping put response +type MappingPutResp struct { + Acknowledged bool `json:"acknowledged"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r MappingPutResp) Inspect() Inspect { + return Inspect{Response: r.response} +} + +// MappingFieldReq represents possible options for the mapping field request +type MappingFieldReq struct { + Indices []string + Fields []string + + Header http.Header + Params MappingPutParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r MappingFieldReq) GetRequest() (*http.Request, error) { + indices := strings.Join(r.Indices, ",") + fields := strings.Join(r.Fields, ",") + + var path strings.Builder + path.Grow(17 + len(indices) + len(fields)) + if len(indices) > 0 { + path.WriteString("/") + path.WriteString(indices) + } + path.WriteString("/_mapping/field/") + path.WriteString(fields) + return opensearch.BuildRequest( + "GET", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// MappingFieldResp represents the returned struct of the mapping field response +type MappingFieldResp struct { + Indices map[string]struct { + Mappings json.RawMessage `json:"mappings"` + } + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r MappingFieldResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-open-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-open-params.go new file mode 100644 index 000000000..4f5105755 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-open-params.go @@ -0,0 +1,93 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// IndicesOpenParams represents possible parameters for the IndicesOpenReq +type IndicesOpenParams struct { + AllowNoIndices *bool + ExpandWildcards string + IgnoreUnavailable *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + WaitForActiveShards string + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IndicesOpenParams) get() map[string]string { + params := make(map[string]string) + + if r.AllowNoIndices != nil { + params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.WaitForActiveShards != "" { + params["wait_for_active_shards"] = r.WaitForActiveShards + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-open.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-open.go new file mode 100644 index 000000000..5197c073d --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-open.go @@ -0,0 +1,45 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IndicesOpenReq represents possible options for the index open request +type IndicesOpenReq struct { + Index string + + Header http.Header + Params IndicesOpenParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IndicesOpenReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "POST", + fmt.Sprintf("/%s/_open", r.Index), + nil, + r.Params.get(), + r.Header, + ) +} + +// IndicesOpenResp represents the returned struct of the index open response +type IndicesOpenResp struct { + Acknowledged bool `json:"acknowledged"` + ShardsAcknowledged bool `json:"shards_acknowledged"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IndicesOpenResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-recovery-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-recovery-params.go new file mode 100644 index 000000000..d7e4b7f78 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-recovery-params.go @@ -0,0 +1,67 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" +) + +// IndicesRecoveryParams represents possible parameters for the IndicesShrinkReq +type IndicesRecoveryParams struct { + ActiveOnly *bool + Detailed *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IndicesRecoveryParams) get() map[string]string { + params := make(map[string]string) + + if r.ActiveOnly != nil { + params["active_only"] = strconv.FormatBool(*r.ActiveOnly) + } + + if r.Detailed != nil { + params["detailed"] = strconv.FormatBool(*r.Detailed) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-recovery.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-recovery.go new file mode 100644 index 000000000..edc216bef --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-recovery.go @@ -0,0 +1,102 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IndicesRecoveryReq represents possible options for the index shrink request +type IndicesRecoveryReq struct { + Indices []string + + Header http.Header + Params IndicesRecoveryParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IndicesRecoveryReq) GetRequest() (*http.Request, error) { + indices := strings.Join(r.Indices, ",") + + var path strings.Builder + path.Grow(11 + len(indices)) + if len(indices) > 0 { + path.WriteString("/") + path.WriteString(indices) + } + path.WriteString("/_recovery") + return opensearch.BuildRequest( + "GET", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// IndicesRecoveryResp represents the returned struct of the index shrink response +type IndicesRecoveryResp struct { + Indices map[string]struct { + Shards []struct { + ID int `json:"id"` + Type string `json:"type"` + Stage string `json:"stage"` + Primary bool `json:"primary"` + StartTimeInMillis int64 `json:"start_time_in_millis"` + StopTimeInMillis int64 `json:"stop_time_in_millis"` + TotalTimeInMillis int `json:"total_time_in_millis"` + Source IndicesRecoveryNodeInfo `json:"source"` + Target IndicesRecoveryNodeInfo `json:"target"` + Index struct { + Size struct { + TotalInBytes int `json:"total_in_bytes"` + ReusedInBytes int `json:"reused_in_bytes"` + RecoveredInBytes int `json:"recovered_in_bytes"` + Percent string `json:"percent"` + } `json:"size"` + Files struct { + Total int `json:"total"` + Reused int `json:"reused"` + Recovered int `json:"recovered"` + Percent string `json:"percent"` + } `json:"files"` + TotalTimeInMillis int `json:"total_time_in_millis"` + SourceThrottleTimeInMillis int `json:"source_throttle_time_in_millis"` + TargetThrottleTimeInMillis int `json:"target_throttle_time_in_millis"` + } `json:"index"` + Translog struct { + Recovered int `json:"recovered"` + Total int `json:"total"` + Percent string `json:"percent"` + TotalOnStart int `json:"total_on_start"` + TotalTimeInMillis int `json:"total_time_in_millis"` + } `json:"translog"` + VerifyIndex struct { + CheckIndexTimeInMillis int `json:"check_index_time_in_millis"` + TotalTimeInMillis int `json:"total_time_in_millis"` + } `json:"verify_index"` + } `json:"shards"` + } + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IndicesRecoveryResp) Inspect() Inspect { + return Inspect{Response: r.response} +} + +// IndicesRecoveryNodeInfo is a sub type of IndicesRecoveryResp represeing Node information +type IndicesRecoveryNodeInfo struct { + ID string `json:"id"` + Host string `json:"host"` + TransportAddress string `json:"transport_address"` + IP string `json:"ip"` + Name string `json:"name"` +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-refresh-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-refresh-params.go new file mode 100644 index 000000000..7cc9604f5 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-refresh-params.go @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" +) + +// IndicesRefreshParams represents possible parameters for the IndicesRefreshReq +type IndicesRefreshParams struct { + AllowNoIndices *bool + ExpandWildcards string + IgnoreUnavailable *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IndicesRefreshParams) get() map[string]string { + params := make(map[string]string) + + if r.AllowNoIndices != nil { + params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-refresh.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-refresh.go new file mode 100644 index 000000000..bd16be953 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-refresh.go @@ -0,0 +1,57 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IndicesRefreshReq represents possible options for the /_refresh request +type IndicesRefreshReq struct { + Indices []string + + Header http.Header + Params IndicesRefreshParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IndicesRefreshReq) GetRequest() (*http.Request, error) { + indices := strings.Join(r.Indices, ",") + + var path strings.Builder + path.Grow(len("//_refresh") + len(indices)) + if len(indices) > 0 { + path.WriteString("/") + path.WriteString(indices) + } + path.WriteString("/_refresh") + return opensearch.BuildRequest( + "POST", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// IndicesRefreshResp represents the returned struct of the index shrink response +type IndicesRefreshResp struct { + Shards struct { + Total int `json:"total"` + Successful int `json:"successful"` + Failed int `json:"failed"` + } `json:"_shards"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IndicesRefreshResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-resolve-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-resolve-params.go new file mode 100644 index 000000000..2b19b2b25 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-resolve-params.go @@ -0,0 +1,58 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +// IndicesResolveParams represents possible parameters for the IndicesResolveReq +type IndicesResolveParams struct { + ExpandWildcards string + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IndicesResolveParams) get() map[string]string { + params := make(map[string]string) + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-resolve.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-resolve.go new file mode 100644 index 000000000..eba983a64 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-resolve.go @@ -0,0 +1,58 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IndicesResolveReq represents possible options for the get indices request +type IndicesResolveReq struct { + Indices []string + + Header http.Header + Params IndicesResolveParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IndicesResolveReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "GET", + fmt.Sprintf("/_resolve/index/%s", strings.Join(r.Indices, ",")), + nil, + r.Params.get(), + r.Header, + ) +} + +// IndicesResolveResp represents the returned struct of the get indices response +type IndicesResolveResp struct { + Indices []struct { + Name string `json:"name"` + Attributes []string `json:"attributes"` + Aliases []string `json:"aliases"` + } `json:"indices"` + Aliases []struct { + Name string `json:"name"` + Indices []string `json:"indices"` + } `json:"aliases"` + DataStreams []struct { + Name string `json:"name"` + BackingIndices []string `json:"backing_indices"` + TimestampField string `json:"timestamp_field"` + } `json:"data_streams"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IndicesResolveResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-rollover-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-rollover-params.go new file mode 100644 index 000000000..a3fef775b --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-rollover-params.go @@ -0,0 +1,83 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// IndicesRolloverParams represents possible parameters for the IndicesRolloverReq +type IndicesRolloverParams struct { + DryRun *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + WaitForActiveShards string + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IndicesRolloverParams) get() map[string]string { + params := make(map[string]string) + + if r.DryRun != nil { + params["dry_run"] = strconv.FormatBool(*r.DryRun) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.WaitForActiveShards != "" { + params["wait_for_active_shards"] = r.WaitForActiveShards + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-rollover.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-rollover.go new file mode 100644 index 000000000..a4a496226 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-rollover.go @@ -0,0 +1,63 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "io" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IndicesRolloverReq represents possible options for the index shrink request +type IndicesRolloverReq struct { + Alias string + Index string + + Body io.Reader + + Header http.Header + Params IndicesRolloverParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IndicesRolloverReq) GetRequest() (*http.Request, error) { + var path strings.Builder + path.Grow(12 + len(r.Alias) + len(r.Index)) + path.WriteString("/") + path.WriteString(r.Alias) + path.WriteString("/_rollover") + if len(r.Index) > 0 { + path.WriteString("/") + path.WriteString(r.Index) + } + return opensearch.BuildRequest( + "POST", + path.String(), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// IndicesRolloverResp represents the returned struct of the index shrink response +type IndicesRolloverResp struct { + Acknowledged bool `json:"acknowledged"` + ShardsAcknowledged bool `json:"shards_acknowledged"` + OldIndex string `json:"old_index"` + NewIndex string `json:"new_index"` + RolledOver bool `json:"rolled_over"` + DryRun bool `json:"dry_run"` + Conditions map[string]bool `json:"conditions"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IndicesRolloverResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-segments-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-segments-params.go new file mode 100644 index 000000000..d726ec524 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-segments-params.go @@ -0,0 +1,77 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" +) + +// IndicesSegmentsParams represents possible parameters for the IndicesSegmentsReq +type IndicesSegmentsParams struct { + AllowNoIndices *bool + ExpandWildcards string + IgnoreUnavailable *bool + Verbose *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IndicesSegmentsParams) get() map[string]string { + params := make(map[string]string) + + if r.AllowNoIndices != nil { + params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + + if r.Verbose != nil { + params["verbose"] = strconv.FormatBool(*r.Verbose) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-segments.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-segments.go new file mode 100644 index 000000000..0e6a817cb --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-segments.go @@ -0,0 +1,93 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IndicesSegmentsReq represents possible options for the index shrink request +type IndicesSegmentsReq struct { + Indices []string + + Header http.Header + Params IndicesSegmentsParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IndicesSegmentsReq) GetRequest() (*http.Request, error) { + indices := strings.Join(r.Indices, ",") + + var path strings.Builder + path.Grow(11 + len(indices)) + if len(indices) > 0 { + path.WriteString("/") + path.WriteString(indices) + } + path.WriteString("/_segments") + return opensearch.BuildRequest( + "GET", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// IndicesSegmentsResp represents the returned struct of the index shrink response +type IndicesSegmentsResp struct { + Shards struct { + Total int `json:"total"` + Successful int `json:"successful"` + Failed int `json:"failed"` + } `json:"_shards"` + Indices map[string]struct { + Shards map[string][]IndicesSegmentsShards `json:"shards"` + } `json:"indices"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IndicesSegmentsResp) Inspect() Inspect { + return Inspect{Response: r.response} +} + +// IndicesSegmentsShards is a sub type of IndicesSegmentsResp containing information about a shard +type IndicesSegmentsShards struct { + Routing struct { + State string `json:"state"` + Primary bool `json:"primary"` + Node string `json:"node"` + } `json:"routing"` + NumCommittedSegments int `json:"num_committed_segments"` + NumSearchSegments int `json:"num_search_segments"` + Segments map[string]IndicesSegmentsDetails `json:"segments"` +} + +// IndicesSegmentsDetails is a sub type of IndicesSegmentsShards containing information about a segment +type IndicesSegmentsDetails struct { + Generation int `json:"generation"` + NumDocs int `json:"num_docs"` + DeletedDocs int `json:"deleted_docs"` + SizeInBytes int64 `json:"size_in_bytes"` + MemoryInBytes int `json:"memory_in_bytes"` + Committed bool `json:"committed"` + Search bool `json:"search"` + Version string `json:"version"` + Compound bool `json:"compound"` + MergeID string `json:"merge_id"` + Sort []struct { + Field string `json:"field"` + Mode string `json:"mode"` + Missing string `json:"missing"` + Reverse bool `json:"reverse"` + } `json:"sort"` + Attributes map[string]string `json:"attributes"` +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-settings-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-settings-params.go new file mode 100644 index 000000000..e7537ab81 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-settings-params.go @@ -0,0 +1,164 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// SettingsGetParams represents possible parameters for the SettingsGetReq +type SettingsGetParams struct { + AllowNoIndices *bool + ExpandWildcards string + FlatSettings *bool + IgnoreUnavailable *bool + IncludeDefaults *bool + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r SettingsGetParams) get() map[string]string { + params := make(map[string]string) + + if r.AllowNoIndices != nil { + params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if r.FlatSettings != nil { + params["flat_settings"] = strconv.FormatBool(*r.FlatSettings) + } + + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + + if r.IncludeDefaults != nil { + params["include_defaults"] = strconv.FormatBool(*r.IncludeDefaults) + } + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} + +// SettingsPutParams represents possible parameters for the SettingsPutReq +type SettingsPutParams struct { + AllowNoIndices *bool + ExpandWildcards string + FlatSettings *bool + IgnoreUnavailable *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + PreserveExisting *bool + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r SettingsPutParams) get() map[string]string { + params := make(map[string]string) + + if r.AllowNoIndices != nil { + params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if r.FlatSettings != nil { + params["flat_settings"] = strconv.FormatBool(*r.FlatSettings) + } + + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.PreserveExisting != nil { + params["preserve_existing"] = strconv.FormatBool(*r.PreserveExisting) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-settings.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-settings.go new file mode 100644 index 000000000..70ed77ee1 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-settings.go @@ -0,0 +1,136 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" + "encoding/json" + "io" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +type settingsClient struct { + apiClient *Client +} + +// Get executes a get settings request with the required SettingsGetReq +func (c settingsClient) Get(ctx context.Context, req *SettingsGetReq) (*SettingsGetResp, error) { + if req == nil { + req = &SettingsGetReq{} + } + var ( + data SettingsGetResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data.Indices); err != nil { + return &data, err + } + + return &data, nil +} + +// Put executes a put settings request with the required SettingsPutReq +func (c settingsClient) Put(ctx context.Context, req SettingsPutReq) (*SettingsPutResp, error) { + var ( + data SettingsPutResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// SettingsGetReq represents possible options for the settings get request +type SettingsGetReq struct { + Indices []string + Settings []string + + Header http.Header + Params SettingsGetParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r SettingsGetReq) GetRequest() (*http.Request, error) { + indices := strings.Join(r.Indices, ",") + settings := strings.Join(r.Settings, ",") + + var path strings.Builder + path.Grow(11 + len(indices) + len(settings)) + if len(indices) > 0 { + path.WriteString("/") + path.WriteString(indices) + } + path.WriteString("/_settings") + if len(settings) > 0 { + path.WriteString("/") + path.WriteString(settings) + } + return opensearch.BuildRequest( + "GET", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// SettingsGetResp represents the returned struct of the settings get response +type SettingsGetResp struct { + Indices map[string]struct { + Settings json.RawMessage `json:"settings"` + } + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r SettingsGetResp) Inspect() Inspect { + return Inspect{Response: r.response} +} + +// SettingsPutReq represents possible options for the settings put request +type SettingsPutReq struct { + Indices []string + + Body io.Reader + + Header http.Header + Params SettingsPutParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r SettingsPutReq) GetRequest() (*http.Request, error) { + indices := strings.Join(r.Indices, ",") + + var path strings.Builder + path.Grow(10 + len(indices)) + path.WriteString("/") + path.WriteString(indices) + path.WriteString("/_settings") + return opensearch.BuildRequest( + "PUT", + path.String(), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// SettingsPutResp represents the returned struct of the settings put response +type SettingsPutResp struct { + Acknowledged bool `json:"acknowledged"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r SettingsPutResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-shardstores-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-shardstores-params.go new file mode 100644 index 000000000..24085c4b6 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-shardstores-params.go @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" +) + +// IndicesShardStoresParams represents possible parameters for the IndicesShardStoresReq +type IndicesShardStoresParams struct { + AllowNoIndices *bool + ExpandWildcards string + IgnoreUnavailable *bool + Status []string + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IndicesShardStoresParams) get() map[string]string { + params := make(map[string]string) + + if r.AllowNoIndices != nil { + params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + + if len(r.Status) > 0 { + params["status"] = strings.Join(r.Status, ",") + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-shardstores.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-shardstores.go new file mode 100644 index 000000000..e9584b866 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-shardstores.go @@ -0,0 +1,58 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "encoding/json" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IndicesShardStoresReq represents possible options for the index shrink request +type IndicesShardStoresReq struct { + Indices []string + + Header http.Header + Params IndicesShardStoresParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IndicesShardStoresReq) GetRequest() (*http.Request, error) { + indices := strings.Join(r.Indices, ",") + + var path strings.Builder + path.Grow(15 + len(indices)) + if len(indices) > 0 { + path.WriteString("/") + path.WriteString(indices) + } + path.WriteString("/_shard_stores") + return opensearch.BuildRequest( + "GET", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// IndicesShardStoresResp represents the returned struct of the index shrink response +type IndicesShardStoresResp struct { + Indices map[string]struct { + Shards map[string]struct { + Stores []json.RawMessage `json:"stores"` + } `json:"shards"` + } `json:"indices"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IndicesShardStoresResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-shrink-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-shrink-params.go new file mode 100644 index 000000000..3d889eb34 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-shrink-params.go @@ -0,0 +1,83 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// IndicesShrinkParams represents possible parameters for the IndicesShrinkReq +type IndicesShrinkParams struct { + CopySettings *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + WaitForActiveShards string + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IndicesShrinkParams) get() map[string]string { + params := make(map[string]string) + + if r.CopySettings != nil { + params["copy_settings"] = strconv.FormatBool(*r.CopySettings) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.WaitForActiveShards != "" { + params["wait_for_active_shards"] = r.WaitForActiveShards + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-shrink.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-shrink.go new file mode 100644 index 000000000..3a11b8297 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-shrink.go @@ -0,0 +1,50 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "io" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IndicesShrinkReq represents possible options for the index shrink request +type IndicesShrinkReq struct { + Index string + Target string + + Body io.Reader + + Header http.Header + Params IndicesShrinkParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IndicesShrinkReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "POST", + fmt.Sprintf("/%s/_shrink/%s", r.Index, r.Target), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// IndicesShrinkResp represents the returned struct of the index shrink response +type IndicesShrinkResp struct { + Acknowledged bool `json:"acknowledged"` + ShardsAcknowledged bool `json:"shards_acknowledged"` + Index string `json:"index"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IndicesShrinkResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-split-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-split-params.go new file mode 100644 index 000000000..579d582d4 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-split-params.go @@ -0,0 +1,83 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// IndicesSplitParams represents possible parameters for the IndicesSplitReq +type IndicesSplitParams struct { + CopySettings *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + WaitForActiveShards string + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IndicesSplitParams) get() map[string]string { + params := make(map[string]string) + + if r.CopySettings != nil { + params["copy_settings"] = strconv.FormatBool(*r.CopySettings) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.WaitForActiveShards != "" { + params["wait_for_active_shards"] = r.WaitForActiveShards + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-split.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-split.go new file mode 100644 index 000000000..07f085ce3 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-split.go @@ -0,0 +1,50 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "io" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IndicesSplitReq represents possible options for the index split request +type IndicesSplitReq struct { + Index string + Target string + + Body io.Reader + + Header http.Header + Params IndicesSplitParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IndicesSplitReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "POST", + fmt.Sprintf("/%s/_split/%s", r.Index, r.Target), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// IndicesSplitResp represents the returned struct of the index split response +type IndicesSplitResp struct { + Acknowledged bool `json:"acknowledged"` + ShardsAcknowledged bool `json:"shards_acknowledged"` + Index string `json:"index"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IndicesSplitResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-stats-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-stats-params.go new file mode 100644 index 000000000..e48f37ed3 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-stats-params.go @@ -0,0 +1,83 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// IndicesStatsParams represents possible parameters for the IndicesStatsReq +type IndicesStatsParams struct { + CopySettings *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + WaitForActiveShards string + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IndicesStatsParams) get() map[string]string { + params := make(map[string]string) + + if r.CopySettings != nil { + params["copy_settings"] = strconv.FormatBool(*r.CopySettings) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.WaitForActiveShards != "" { + params["wait_for_active_shards"] = r.WaitForActiveShards + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-stats.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-stats.go new file mode 100644 index 000000000..80e08772c --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-stats.go @@ -0,0 +1,314 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "encoding/json" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IndicesStatsReq represents possible options for the index shrink request +type IndicesStatsReq struct { + Indices []string + Metrics []string + + Header http.Header + Params IndicesStatsParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IndicesStatsReq) GetRequest() (*http.Request, error) { + indices := strings.Join(r.Indices, ",") + metrics := strings.Join(r.Metrics, ",") + + var path strings.Builder + path.Grow(9 + len(indices) + len(metrics)) + if len(indices) > 0 { + path.WriteString("/") + path.WriteString(indices) + } + path.WriteString("/_stats") + if len(metrics) > 0 { + path.WriteString("/") + path.WriteString(metrics) + } + return opensearch.BuildRequest( + "GET", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// IndicesStatsResp represents the returned struct of the index shrink response +type IndicesStatsResp struct { + Shards IndicesStatsShards `json:"_shards"` + All IndicesStatsAll `json:"_all"` + Indices IndicesStatsIndices `json:"indices"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IndicesStatsResp) Inspect() Inspect { + return Inspect{Response: r.response} +} + +// IndicesStatsShards is a sub type of IndicesStatsResp containing information about how many shards got requested +type IndicesStatsShards struct { + Total int `json:"total"` + Successful int `json:"successful"` + Failed int `json:"failed"` +} + +// IndicesStatsDocs is a sub type of IndicesStatsInfo containing stats about the index documents +type IndicesStatsDocs struct { + Count int `json:"count"` + Deleted int `json:"deleted"` +} + +// IndicesStatsStore is a sub type of IndicesStatsInfo containing stats about index storage +type IndicesStatsStore struct { + SizeInBytes int64 `json:"size_in_bytes"` + ReservedInBytes int `json:"reserved_in_bytes"` +} + +// IndicesStatsIndexing is a sub type of IndicesStatsInfo containing stats about document indexing +type IndicesStatsIndexing struct { + IndexTotal int `json:"index_total"` + IndexTimeInMillis int `json:"index_time_in_millis"` + IndexCurrent int `json:"index_current"` + IndexFailed int `json:"index_failed"` + DeleteTotal int `json:"delete_total"` + DeleteTimeInMillis int `json:"delete_time_in_millis"` + DeleteCurrent int `json:"delete_current"` + NoopUpdateTotal int `json:"noop_update_total"` + IsThrottled bool `json:"is_throttled"` + ThrottleTimeInMillis int `json:"throttle_time_in_millis"` + DocStatus map[string]int `json:"doc_status"` +} + +// IndicesStatsGet is a sub type of IndicesStatsInfo containing stats about index get +type IndicesStatsGet struct { + Total int `json:"total"` + TimeInMillis int `json:"time_in_millis"` + ExistsTotal int `json:"exists_total"` + ExistsTimeInMillis int `json:"exists_time_in_millis"` + MissingTotal int `json:"missing_total"` + MissingTimeInMillis int `json:"missing_time_in_millis"` + Current int `json:"current"` +} + +// IndicesStatsSearch is a sub type of IndicesStatsInfo containing stats about index search +type IndicesStatsSearch struct { + OpenContexts int `json:"open_contexts"` + QueryTotal int `json:"query_total"` + QueryTimeInMillis int `json:"query_time_in_millis"` + QueryCurrent int `json:"query_current"` + ConcurrentQueryTotal int `json:"concurrent_query_total"` + ConcurrentQueryTimeInMillis int `json:"concurrent_query_time_in_millis"` + ConcurrentQueryCurrent int `json:"concurrent_query_current"` + ConcurrentAVGSliceCount float32 `json:"concurrent_avg_slice_count"` + FetchTotal int `json:"fetch_total"` + FetchTimeInMillis int `json:"fetch_time_in_millis"` + FetchCurrent int `json:"fetch_current"` + ScrollTotal int `json:"scroll_total"` + ScrollTimeInMillis int `json:"scroll_time_in_millis"` + ScrollCurrent int `json:"scroll_current"` + PointInTimeTotal int `json:"point_in_time_total"` + PointInTimeTimeInMillis int `json:"point_in_time_time_in_millis"` + PointInTimeCurrent int `json:"point_in_time_current"` + SuggestTotal int `json:"suggest_total"` + SuggestTimeInMillis int `json:"suggest_time_in_millis"` + SuggestCurrent int `json:"suggest_current"` +} + +// IndicesStatsMerges is a sub type of IndicesStatsInfo containing stats about index merges +type IndicesStatsMerges struct { + Current int `json:"current"` + CurrentDocs int `json:"current_docs"` + CurrentSizeInBytes int `json:"current_size_in_bytes"` + Total int `json:"total"` + TotalTimeInMillis int `json:"total_time_in_millis"` + TotalDocs int `json:"total_docs"` + TotalSizeInBytes int64 `json:"total_size_in_bytes"` + TotalStoppedTimeInMillis int `json:"total_stopped_time_in_millis"` + TotalThrottledTimeInMillis int `json:"total_throttled_time_in_millis"` + TotalAutoThrottleInBytes int `json:"total_auto_throttle_in_bytes"` + UnreferencedFileCleanupsPerformed int `json:"unreferenced_file_cleanups_performed"` +} + +// IndicesStatsRefresh is a sub type of IndicesStatsInfo containing stats about index refresh +type IndicesStatsRefresh struct { + Total int `json:"total"` + TotalTimeInMillis int `json:"total_time_in_millis"` + ExternalTotal int `json:"external_total"` + ExternalTotalTimeInMillis int `json:"external_total_time_in_millis"` + Listeners int `json:"listeners"` +} + +// IndicesStatsFlush is a sub type of IndicesStatsInfo containing stats about index flush +type IndicesStatsFlush struct { + Total int `json:"total"` + Periodic int `json:"periodic"` + TotalTimeInMillis int `json:"total_time_in_millis"` +} + +// IndicesStatsWarmer is a sub type of IndicesStatsInfo containing stats about index warmer +type IndicesStatsWarmer struct { + Current int `json:"current"` + Total int `json:"total"` + TotalTimeInMillis int `json:"total_time_in_millis"` +} + +// IndicesStatsQueryCache is a sub type of IndicesStatsInfo containing stats about index query cache +type IndicesStatsQueryCache struct { + MemorySizeInBytes int `json:"memory_size_in_bytes"` + TotalCount int `json:"total_count"` + HitCount int `json:"hit_count"` + MissCount int `json:"miss_count"` + CacheSize int `json:"cache_size"` + CacheCount int `json:"cache_count"` + Evictions int `json:"evictions"` +} + +// IndicesStatsFielddata is a sub type of IndicesStatsInfo containing stats about index fielddata +type IndicesStatsFielddata struct { + MemorySizeInBytes int `json:"memory_size_in_bytes"` + Evictions int `json:"evictions"` +} + +// IndicesStatsCompletion is a sub type of IndicesStatsInfo containing stats about index completion +type IndicesStatsCompletion struct { + SizeInBytes int `json:"size_in_bytes"` +} + +// IndicesStatsSegments is a sub type of IndicesStatsInfo containing stats about index segments +type IndicesStatsSegments struct { + Count int `json:"count"` + MemoryInBytes int `json:"memory_in_bytes"` + TermsMemoryInBytes int `json:"terms_memory_in_bytes"` + StoredFieldsMemoryInBytes int `json:"stored_fields_memory_in_bytes"` + TermVectorsMemoryInBytes int `json:"term_vectors_memory_in_bytes"` + NormsMemoryInBytes int `json:"norms_memory_in_bytes"` + PointsMemoryInBytes int `json:"points_memory_in_bytes"` + DocValuesMemoryInBytes int `json:"doc_values_memory_in_bytes"` + IndexWriterMemoryInBytes int `json:"index_writer_memory_in_bytes"` + VersionMapMemoryInBytes int `json:"version_map_memory_in_bytes"` + FixedBitSetMemoryInBytes int `json:"fixed_bit_set_memory_in_bytes"` + MaxUnsafeAutoIDTimestamp int64 `json:"max_unsafe_auto_id_timestamp"` + RemoteStore struct { + Upload struct { + TotalUploadSize struct { + StartedBytes int `json:"started_bytes"` + SucceededBytes int `json:"succeeded_bytes"` + FailedBytes int `json:"failed_bytes"` + } `json:"total_upload_size"` + RefreshSizeLag struct { + TotalBytes int `json:"total_bytes"` + MaxBytes int `json:"max_bytes"` + } `json:"refresh_size_lag"` + MaxRefreshTimeLagInMillis int `json:"max_refresh_time_lag_in_millis"` + TotalTimeSpentInMillis int `json:"total_time_spent_in_millis"` + Pressure struct { + TotalRejections int `json:"total_rejections"` + } `json:"pressure"` + } `json:"upload"` + Download struct { + TotalDownloadSize struct { + StartedBytes int `json:"started_bytes"` + SucceededBytes int `json:"succeeded_bytes"` + FailedBytes int `json:"failed_bytes"` + } `json:"total_download_size"` + TotalTimeSpentInMillis int `json:"total_time_spent_in_millis"` + } `json:"download"` + } `json:"remote_store"` + SegmentReplication struct { + // Type is json.RawMessage due to difference in opensearch versions from string to int + MaxBytesBehind json.RawMessage `json:"max_bytes_behind"` + TotalBytesBehind json.RawMessage `json:"total_bytes_behind"` + MaxReplicationLag json.RawMessage `json:"max_replication_lag"` + } `json:"segment_replication"` + FileSizes json.RawMessage `json:"file_sizes"` +} + +// IndicesStatsTranslog is a sub type of IndicesStatsInfo containing stats about index translog +type IndicesStatsTranslog struct { + Operations int `json:"operations"` + SizeInBytes int `json:"size_in_bytes"` + UncommittedOperations int `json:"uncommitted_operations"` + UncommittedSizeInBytes int `json:"uncommitted_size_in_bytes"` + EarliestLastModifiedAge int `json:"earliest_last_modified_age"` + RemoteStore struct { + Upload struct { + TotalUploads struct { + Started int `json:"started"` + Failed int `json:"failed"` + Succeeded int `json:"succeeded"` + } `json:"total_uploads"` + TotalUploadSize struct { + StartedBytes int `json:"started_bytes"` + FailedBytes int `json:"failed_bytes"` + SucceededBytes int `json:"succeeded_bytes"` + } `json:"total_upload_size"` + } `json:"upload"` + } `json:"remote_store"` +} + +// IndicesStatsRequestCache is a sub type of IndicesStatsInfo containing stats about index request cache +type IndicesStatsRequestCache struct { + MemorySizeInBytes int `json:"memory_size_in_bytes"` + Evictions int `json:"evictions"` + HitCount int `json:"hit_count"` + MissCount int `json:"miss_count"` +} + +// IndicesStatsRecovery is a sub type of IndicesStatsInfo containing stats about index recovery +type IndicesStatsRecovery struct { + CurrentAsSource int `json:"current_as_source"` + CurrentAsTarget int `json:"current_as_target"` + ThrottleTimeInMillis int `json:"throttle_time_in_millis"` +} + +// IndicesStatsInfo is a sub type of IndicesStatsAll, IndicesStatsDetails aggregating all document stats +type IndicesStatsInfo struct { + Docs IndicesStatsDocs `json:"docs"` + Store IndicesStatsStore `json:"store"` + Indexing IndicesStatsIndexing `json:"indexing"` + Get IndicesStatsGet `json:"get"` + Search IndicesStatsSearch `json:"search"` + Merges IndicesStatsMerges `json:"merges"` + Refresh IndicesStatsRefresh `json:"refresh"` + Flush IndicesStatsFlush `json:"flush"` + Warmer IndicesStatsWarmer `json:"warmer"` + QueryCache IndicesStatsQueryCache `json:"query_cache"` + Fielddata IndicesStatsFielddata `json:"fielddata"` + Completion IndicesStatsCompletion `json:"completion"` + Segments IndicesStatsSegments `json:"segments"` + Translog IndicesStatsTranslog `json:"translog"` + RequestCache IndicesStatsRequestCache `json:"request_cache"` + Recovery IndicesStatsRecovery `json:"recovery"` +} + +// IndicesStatsAll is a sub type of IndicesStatsResp containing information about docs stats from all indices +type IndicesStatsAll struct { + Primaries IndicesStatsInfo `json:"primaries"` + Total IndicesStatsInfo `json:"total"` +} + +// IndicesStatsDetails is a sub type of IndicesStatsIndices containing the information about the index uuid and index stats +type IndicesStatsDetails struct { + UUID string `json:"uuid"` + Primaries IndicesStatsInfo `json:"primaries"` + Total IndicesStatsInfo `json:"total"` +} + +// IndicesStatsIndices is a sub type of IndicesStatsResp containing information about docs stats from specific indices +type IndicesStatsIndices map[string]IndicesStatsDetails diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-validate-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-validate-params.go new file mode 100644 index 000000000..45115867a --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-validate-params.go @@ -0,0 +1,117 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" +) + +// IndicesValidateQueryParams represents possible parameters for the IndicesValidateQueryReq +type IndicesValidateQueryParams struct { + AllowNoIndices *bool + AllShards *bool + Analyzer string + AnalyzeWildcard *bool + DefaultOperator string + Df string + ExpandWildcards string + Explain *bool + IgnoreUnavailable *bool + Lenient *bool + Query string + Rewrite *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IndicesValidateQueryParams) get() map[string]string { + params := make(map[string]string) + + if r.AllowNoIndices != nil { + params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) + } + + if r.AllShards != nil { + params["all_shards"] = strconv.FormatBool(*r.AllShards) + } + + if r.Analyzer != "" { + params["analyzer"] = r.Analyzer + } + + if r.AnalyzeWildcard != nil { + params["analyze_wildcard"] = strconv.FormatBool(*r.AnalyzeWildcard) + } + + if r.DefaultOperator != "" { + params["default_operator"] = r.DefaultOperator + } + + if r.Df != "" { + params["df"] = r.Df + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if r.Explain != nil { + params["explain"] = strconv.FormatBool(*r.Explain) + } + + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + + if r.Lenient != nil { + params["lenient"] = strconv.FormatBool(*r.Lenient) + } + + if r.Query != "" { + params["q"] = r.Query + } + + if r.Rewrite != nil { + params["rewrite"] = strconv.FormatBool(*r.Rewrite) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-validate.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-validate.go new file mode 100644 index 000000000..7e1a3faab --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices-validate.go @@ -0,0 +1,69 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "io" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IndicesValidateQueryReq represents possible options for the index shrink request +type IndicesValidateQueryReq struct { + Indices []string + + Body io.Reader + + Header http.Header + Params IndicesValidateQueryParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IndicesValidateQueryReq) GetRequest() (*http.Request, error) { + indices := strings.Join(r.Indices, ",") + + var path strings.Builder + path.Grow(17 + len(indices)) + if len(indices) > 0 { + path.WriteString("/") + path.WriteString(indices) + } + path.WriteString("/_validate/query") + return opensearch.BuildRequest( + "POST", + path.String(), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// IndicesValidateQueryResp represents the returned struct of the index shrink response +type IndicesValidateQueryResp struct { + Shards struct { + Total int `json:"total"` + Successful int `json:"successful"` + Failed int `json:"failed"` + } `json:"_shards"` + Valid bool `json:"valid"` + Error *string `json:"error"` + Explanations []struct { + Index string `json:"index"` + Shard int `json:"shard"` + Valid bool `json:"valid"` + Explanation *string `json:"explanation"` + Error *string `json:"error"` + } `json:"explanations"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IndicesValidateQueryResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices.go new file mode 100644 index 000000000..0e8f8a916 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_indices.go @@ -0,0 +1,360 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" + + "github.com/opensearch-project/opensearch-go/v3" +) + +type indicesClient struct { + apiClient *Client + Alias aliasClient + Mapping mappingClient + Settings settingsClient +} + +// Delete executes a delete indices request with the required IndicesDeleteReq +func (c indicesClient) Delete(ctx context.Context, req IndicesDeleteReq) (*IndicesDeleteResp, error) { + var ( + data IndicesDeleteResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Create executes a creade indices request with the required IndicesCreateReq +func (c indicesClient) Create(ctx context.Context, req IndicesCreateReq) (*IndicesCreateResp, error) { + var ( + data IndicesCreateResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Exists executes a exists indices request with the required IndicesExistsReq +func (c indicesClient) Exists(ctx context.Context, req IndicesExistsReq) (*opensearch.Response, error) { + return c.apiClient.do(ctx, req, nil) +} + +// Block executes a //_block request with the required IndicesBlockReq +func (c indicesClient) Block(ctx context.Context, req IndicesBlockReq) (*IndicesBlockResp, error) { + var ( + data IndicesBlockResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Analyze executes a //_analyze request with the required IndicesAnalyzeReq +func (c indicesClient) Analyze(ctx context.Context, req IndicesAnalyzeReq) (*IndicesAnalyzeResp, error) { + var ( + data IndicesAnalyzeResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// ClearCache executes a //_cache/clear request with the optional IndicesClearCacheReq +func (c indicesClient) ClearCache(ctx context.Context, req *IndicesClearCacheReq) (*IndicesClearCacheResp, error) { + if req == nil { + req = &IndicesClearCacheReq{} + } + + var ( + data IndicesClearCacheResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Clone executes a //_clone/ request with the required IndicesCloneReq +func (c indicesClient) Clone(ctx context.Context, req IndicesCloneReq) (*IndicesCloneResp, error) { + var ( + data IndicesCloneResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Close executes a //_close request with the required IndicesCloseReq +func (c indicesClient) Close(ctx context.Context, req IndicesCloseReq) (*IndicesCloseResp, error) { + var ( + data IndicesCloseResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Get executes a / request with the required IndicesGetReq +func (c indicesClient) Get(ctx context.Context, req IndicesGetReq) (*IndicesGetResp, error) { + var ( + data IndicesGetResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data.Indices); err != nil { + return &data, err + } + + return &data, nil +} + +// Open executes a //_open request with the required IndicesOpenReq +func (c indicesClient) Open(ctx context.Context, req IndicesOpenReq) (*IndicesOpenResp, error) { + var ( + data IndicesOpenResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Shrink executes a //_shrink/ request with the required IndicesShrinkReq +func (c indicesClient) Shrink(ctx context.Context, req IndicesShrinkReq) (*IndicesShrinkResp, error) { + var ( + data IndicesShrinkResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Split executes a //_split/ request with the required IndicesSplitReq +func (c indicesClient) Split(ctx context.Context, req IndicesSplitReq) (*IndicesSplitResp, error) { + var ( + data IndicesSplitResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Flush executes a //_flush request with the optional IndicesFlushReq +func (c indicesClient) Flush(ctx context.Context, req *IndicesFlushReq) (*IndicesFlushResp, error) { + if req == nil { + req = &IndicesFlushReq{} + } + + var ( + data IndicesFlushResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Forcemerge executes a //_forcemerge request with the optional IndicesForcemergeReq +func (c indicesClient) Forcemerge(ctx context.Context, req *IndicesForcemergeReq) (*IndicesForcemergeResp, error) { + if req == nil { + req = &IndicesForcemergeReq{} + } + + var ( + data IndicesForcemergeResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Recovery executes a //_recovery request with the optional IndicesRecoveryReq +func (c indicesClient) Recovery(ctx context.Context, req *IndicesRecoveryReq) (*IndicesRecoveryResp, error) { + if req == nil { + req = &IndicesRecoveryReq{} + } + + var ( + data IndicesRecoveryResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Refresh executes a //_refresh request with the optional IndicesRefreshReq +func (c indicesClient) Refresh(ctx context.Context, req *IndicesRefreshReq) (*IndicesRefreshResp, error) { + if req == nil { + req = &IndicesRefreshReq{} + } + + var ( + data IndicesRefreshResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Rollover executes a //_rollover request with the required IndicesRolloverReq +func (c indicesClient) Rollover(ctx context.Context, req IndicesRolloverReq) (*IndicesRolloverResp, error) { + var ( + data IndicesRolloverResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Segments executes a //_segments request with the optional IndicesSegmentsReq +func (c indicesClient) Segments(ctx context.Context, req *IndicesSegmentsReq) (*IndicesSegmentsResp, error) { + if req == nil { + req = &IndicesSegmentsReq{} + } + + var ( + data IndicesSegmentsResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// ShardStores executes a //_shard_stores request with the optional IndicesShardStoresReq +func (c indicesClient) ShardStores(ctx context.Context, req *IndicesShardStoresReq) (*IndicesShardStoresResp, error) { + if req == nil { + req = &IndicesShardStoresReq{} + } + + var ( + data IndicesShardStoresResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Stats executes a //_stats request with the optional IndicesStatsReq +func (c indicesClient) Stats(ctx context.Context, req *IndicesStatsReq) (*IndicesStatsResp, error) { + if req == nil { + req = &IndicesStatsReq{} + } + + var ( + data IndicesStatsResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// ValidateQuery executes a //_validate/query request with the required IndicesValidateQueryReq +func (c indicesClient) ValidateQuery(ctx context.Context, req IndicesValidateQueryReq) (*IndicesValidateQueryResp, error) { + var ( + data IndicesValidateQueryResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Count executes a //_count request with the required IndicesCountReq +func (c indicesClient) Count(ctx context.Context, req *IndicesCountReq) (*IndicesCountResp, error) { + if req == nil { + req = &IndicesCountReq{} + } + + var ( + data IndicesCountResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// FieldCaps executes a //_field_caps request with the required IndicesFieldCapsReq +func (c indicesClient) FieldCaps(ctx context.Context, req IndicesFieldCapsReq) (*IndicesFieldCapsResp, error) { + var ( + data IndicesFieldCapsResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Resolve executes a /_resolve/index/ request with the required IndicesResolveReq +func (c indicesClient) Resolve(ctx context.Context, req IndicesResolveReq) (*IndicesResolveResp, error) { + var ( + data IndicesResolveResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_info-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_info-params.go new file mode 100644 index 000000000..33f4efb50 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_info-params.go @@ -0,0 +1,52 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +// InfoParams represents possible parameters for the InfoReq +type InfoParams struct { + Pretty bool + Human bool + ErrorTrace bool +} + +func (r InfoParams) get() map[string]string { + params := make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_info.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_info.go new file mode 100644 index 000000000..45277b229 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_info.go @@ -0,0 +1,73 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// Info executes a / request with the optional InfoReq +func (c Client) Info(ctx context.Context, req *InfoReq) (*InfoResp, error) { + if req == nil { + req = &InfoReq{} + } + + var ( + data InfoResp + err error + ) + if data.response, err = c.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// InfoReq represents possible options for the / request +type InfoReq struct { + Header http.Header + Params InfoParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r InfoReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "GET", + "/", + nil, + r.Params.get(), + r.Header, + ) +} + +// InfoResp represents the returned struct of the / response +type InfoResp struct { + Name string `json:"name"` + ClusterName string `json:"cluster_name"` + ClusterUUID string `json:"cluster_uuid"` + Version struct { + Distribution string `json:"distribution"` + Number string `json:"number"` + BuildType string `json:"build_type"` + BuildHash string `json:"build_hash"` + BuildDate string `json:"build_date"` + BuildSnapshot bool `json:"build_snapshot"` + LuceneVersion string `json:"lucene_version"` + MinimumWireCompatibilityVersion string `json:"minimum_wire_compatibility_version"` + MinimumIndexCompatibilityVersion string `json:"minimum_index_compatibility_version"` + } `json:"version"` + Tagline string `json:"tagline"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r InfoResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-create-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-create-params.go new file mode 100644 index 000000000..88ebc03ed --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-create-params.go @@ -0,0 +1,70 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import "time" + +// IngestCreateParams represents possible parameters for the IngestCreateReq +type IngestCreateParams struct { + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IngestCreateParams) get() map[string]string { + params := make(map[string]string) + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-create.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-create.go new file mode 100644 index 000000000..fce4645a5 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-create.go @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "io" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IngestCreateReq represents possible options for the index create request +type IngestCreateReq struct { + PipelineID string + + Body io.Reader + + Header http.Header + Params IngestCreateParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IngestCreateReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "PUT", + fmt.Sprintf("/_ingest/pipeline/%s", r.PipelineID), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// IngestCreateResp represents the returned struct of the index create response +type IngestCreateResp struct { + Acknowledged bool `json:"acknowledged"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IngestCreateResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-delete-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-delete-params.go new file mode 100644 index 000000000..d9144629e --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-delete-params.go @@ -0,0 +1,70 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import "time" + +// IngestDeleteParams represents possible parameters for the IngestDeleteReq +type IngestDeleteParams struct { + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IngestDeleteParams) get() map[string]string { + params := make(map[string]string) + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-delete.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-delete.go new file mode 100644 index 000000000..f09622d50 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-delete.go @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IngestDeleteReq represents possible options for the index create request +type IngestDeleteReq struct { + PipelineID string + + Header http.Header + Params IngestDeleteParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IngestDeleteReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "DELETE", + fmt.Sprintf("/_ingest/pipeline/%s", r.PipelineID), + nil, + r.Params.get(), + r.Header, + ) +} + +// IngestDeleteResp represents the returned struct of the index create response +type IngestDeleteResp struct { + Acknowledged bool `json:"acknowledged"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IngestDeleteResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-get-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-get-params.go new file mode 100644 index 000000000..afe8f1c86 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-get-params.go @@ -0,0 +1,73 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// IngestGetParams represents possible parameters for the IngestGetReq +type IngestGetParams struct { + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Summary *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IngestGetParams) get() map[string]string { + params := make(map[string]string) + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Summary != nil { + params["summary"] = strconv.FormatBool(*r.Summary) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-get.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-get.go new file mode 100644 index 000000000..a5ad90c82 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-get.go @@ -0,0 +1,49 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "encoding/json" + "fmt" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IngestGetReq represents possible options for the index create request +type IngestGetReq struct { + PipelineIDs []string + + Header http.Header + Params IngestGetParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IngestGetReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "GET", + fmt.Sprintf("/_ingest/pipeline/%s", strings.Join(r.PipelineIDs, ",")), + nil, + r.Params.get(), + r.Header, + ) +} + +// IngestGetResp represents the returned struct of the index create response +type IngestGetResp struct { + Pipelines map[string]struct { + Description string `json:"description"` + Processors []map[string]json.RawMessage `json:"processors"` + } + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IngestGetResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-grok-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-grok-params.go new file mode 100644 index 000000000..b75987c77 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-grok-params.go @@ -0,0 +1,52 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +// IngestGrokParams represents possible parameters for the IngestGrokReq +type IngestGrokParams struct { + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IngestGrokParams) get() map[string]string { + params := make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-grok.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-grok.go new file mode 100644 index 000000000..7870503bd --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-grok.go @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IngestGrokReq represents possible options for the index create request +type IngestGrokReq struct { + Header http.Header + Params IngestGrokParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IngestGrokReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "GET", + "/_ingest/processor/grok", + nil, + r.Params.get(), + r.Header, + ) +} + +// IngestGrokResp represents the returned struct of the index create response +type IngestGrokResp struct { + Patterns map[string]string `json:"patterns"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IngestGrokResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-simulate-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-simulate-params.go new file mode 100644 index 000000000..47e36e324 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-simulate-params.go @@ -0,0 +1,60 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import "strconv" + +// IngestSimulateParams represents possible parameters for the IngestSimulateReq +type IngestSimulateParams struct { + Verbose *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r IngestSimulateParams) get() map[string]string { + params := make(map[string]string) + + if r.Verbose != nil { + params["verbose"] = strconv.FormatBool(*r.Verbose) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-simulate.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-simulate.go new file mode 100644 index 000000000..b75f977ec --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest-simulate.go @@ -0,0 +1,56 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "encoding/json" + "io" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// IngestSimulateReq represents possible options for the index create request +type IngestSimulateReq struct { + PipelineID string + + Body io.Reader + + Header http.Header + Params IngestSimulateParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r IngestSimulateReq) GetRequest() (*http.Request, error) { + var path strings.Builder + path.Grow(len("/_ingest/pipeline//_simulate") + len(r.PipelineID)) + path.WriteString("/_ingest/pipeline/") + if len(r.PipelineID) > 0 { + path.WriteString(r.PipelineID) + path.WriteString("/") + } + path.WriteString("_simulate") + return opensearch.BuildRequest( + "POST", + path.String(), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// IngestSimulateResp represents the returned struct of the index create response +type IngestSimulateResp struct { + Docs []json.RawMessage `json:"docs"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r IngestSimulateResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest.go new file mode 100644 index 000000000..4734a42ab --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ingest.go @@ -0,0 +1,88 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" +) + +type ingestClient struct { + apiClient *Client +} + +// Create executes a creade ingest request with the required IngestCreateReq +func (c ingestClient) Create(ctx context.Context, req IngestCreateReq) (*IngestCreateResp, error) { + var ( + data IngestCreateResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Delete executes a delete ingest request with the required IngestDeleteReq +func (c ingestClient) Delete(ctx context.Context, req IngestDeleteReq) (*IngestDeleteResp, error) { + var ( + data IngestDeleteResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Get executes a get ingest request with the optional IngestGetReq +func (c ingestClient) Get(ctx context.Context, req *IngestGetReq) (*IngestGetResp, error) { + if req == nil { + req = &IngestGetReq{} + } + + var ( + data IngestGetResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data.Pipelines); err != nil { + return &data, err + } + + return &data, nil +} + +// Simulate executes a stats ingest request with the optional IngestSimulateReq +func (c ingestClient) Simulate(ctx context.Context, req IngestSimulateReq) (*IngestSimulateResp, error) { + var ( + data IngestSimulateResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Grok executes a get ingest request with the optional IngestGrokReq +func (c ingestClient) Grok(ctx context.Context, req *IngestGrokReq) (*IngestGrokResp, error) { + if req == nil { + req = &IngestGrokReq{} + } + + var ( + data IngestGrokResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_mget-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_mget-params.go new file mode 100644 index 000000000..f047e18f9 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_mget-params.go @@ -0,0 +1,107 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" +) + +// MGetParams represents possible parameters for the MGetReq +type MGetParams struct { + Preference string + Realtime *bool + Refresh *bool + Routing string + Source interface{} + SourceExcludes []string + SourceIncludes []string + StoredFields []string + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r MGetParams) get() map[string]string { + params := make(map[string]string) + + if r.Preference != "" { + params["preference"] = r.Preference + } + + if r.Realtime != nil { + params["realtime"] = strconv.FormatBool(*r.Realtime) + } + + if r.Refresh != nil { + params["refresh"] = strconv.FormatBool(*r.Refresh) + } + + if r.Routing != "" { + params["routing"] = r.Routing + } + + switch source := r.Source.(type) { + case bool: + params["_source"] = strconv.FormatBool(source) + case string: + if source != "" { + params["_source"] = source + } + case []string: + if len(source) > 0 { + params["_source"] = strings.Join(source, ",") + } + } + + if len(r.SourceExcludes) > 0 { + params["_source_excludes"] = strings.Join(r.SourceExcludes, ",") + } + + if len(r.SourceIncludes) > 0 { + params["_source_includes"] = strings.Join(r.SourceIncludes, ",") + } + + if len(r.StoredFields) > 0 { + params["stored_fields"] = strings.Join(r.StoredFields, ",") + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_mget.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_mget.go new file mode 100644 index 000000000..e1994d31d --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_mget.go @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" + "encoding/json" + "io" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// MGet executes a /_mget request with the optional MGetReq +func (c Client) MGet(ctx context.Context, req MGetReq) (*MGetResp, error) { + var ( + data MGetResp + err error + ) + if data.response, err = c.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// MGetReq represents possible options for the /_mget request +type MGetReq struct { + Index string + + Body io.Reader + + Header http.Header + Params MGetParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r MGetReq) GetRequest() (*http.Request, error) { + var path strings.Builder + path.Grow(len("//_mget") + len(r.Index)) + if len(r.Index) > 0 { + path.WriteString("/") + path.WriteString(r.Index) + } + path.WriteString("/_mget") + return opensearch.BuildRequest( + "POST", + path.String(), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// MGetResp represents the returned struct of the /_mget response +type MGetResp struct { + Docs []struct { + Index string `json:"_index"` + ID string `json:"_id"` + Version int `json:"_version"` + SeqNo int `json:"_seq_no"` + PrimaryTerm int `json:"_primary_term"` + Found bool `json:"found"` + Type string `json:"_type"` + Source json.RawMessage `json:"_source"` + } `json:"docs"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r MGetResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_msearch-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_msearch-params.go new file mode 100644 index 000000000..46741e1c2 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_msearch-params.go @@ -0,0 +1,92 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" +) + +// MSearchParams represents possible parameters for the MSearchReq +type MSearchParams struct { + CcsMinimizeRoundtrips *bool + MaxConcurrentSearches *int + MaxConcurrentShardRequests *int + PreFilterShardSize *int + RestTotalHitsAsInt *bool + SearchType string + TypedKeys *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r MSearchParams) get() map[string]string { + params := make(map[string]string) + + if r.CcsMinimizeRoundtrips != nil { + params["ccs_minimize_roundtrips"] = strconv.FormatBool(*r.CcsMinimizeRoundtrips) + } + + if r.MaxConcurrentSearches != nil { + params["max_concurrent_searches"] = strconv.FormatInt(int64(*r.MaxConcurrentSearches), 10) + } + + if r.MaxConcurrentShardRequests != nil { + params["max_concurrent_shard_requests"] = strconv.FormatInt(int64(*r.MaxConcurrentShardRequests), 10) + } + + if r.PreFilterShardSize != nil { + params["pre_filter_shard_size"] = strconv.FormatInt(int64(*r.PreFilterShardSize), 10) + } + + if r.RestTotalHitsAsInt != nil { + params["rest_total_hits_as_int"] = strconv.FormatBool(*r.RestTotalHitsAsInt) + } + + if r.SearchType != "" { + params["search_type"] = r.SearchType + } + + if r.TypedKeys != nil { + params["typed_keys"] = strconv.FormatBool(*r.TypedKeys) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_msearch-template-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_msearch-template-params.go new file mode 100644 index 000000000..845db9d2f --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_msearch-template-params.go @@ -0,0 +1,82 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" +) + +// MSearchTemplateParams represents possible parameters for the MSearchTemplateReq +type MSearchTemplateParams struct { + CcsMinimizeRoundtrips *bool + MaxConcurrentSearches *int + RestTotalHitsAsInt *bool + SearchType string + TypedKeys *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r MSearchTemplateParams) get() map[string]string { + params := make(map[string]string) + + if r.CcsMinimizeRoundtrips != nil { + params["ccs_minimize_roundtrips"] = strconv.FormatBool(*r.CcsMinimizeRoundtrips) + } + + if r.MaxConcurrentSearches != nil { + params["max_concurrent_searches"] = strconv.FormatInt(int64(*r.MaxConcurrentSearches), 10) + } + + if r.RestTotalHitsAsInt != nil { + params["rest_total_hits_as_int"] = strconv.FormatBool(*r.RestTotalHitsAsInt) + } + + if r.SearchType != "" { + params["search_type"] = r.SearchType + } + + if r.TypedKeys != nil { + params["typed_keys"] = strconv.FormatBool(*r.TypedKeys) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_msearch-template.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_msearch-template.go new file mode 100644 index 000000000..a836a4cc2 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_msearch-template.go @@ -0,0 +1,83 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" + "io" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// MSearchTemplate executes a /_msearch request with the optional MSearchTemplateReq +func (c Client) MSearchTemplate(ctx context.Context, req MSearchTemplateReq) (*MSearchTemplateResp, error) { + var ( + data MSearchTemplateResp + err error + ) + if data.response, err = c.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// MSearchTemplateReq represents possible options for the /_msearch request +type MSearchTemplateReq struct { + Indices []string + + Body io.Reader + + Header http.Header + Params MSearchTemplateParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r MSearchTemplateReq) GetRequest() (*http.Request, error) { + indices := strings.Join(r.Indices, ",") + var path strings.Builder + path.Grow(len("//_msearch/template") + len(indices)) + if len(r.Indices) > 0 { + path.WriteString("/") + path.WriteString(indices) + } + path.WriteString("/_msearch/template") + return opensearch.BuildRequest( + "POST", + path.String(), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// MSearchTemplateResp represents the returned struct of the /_msearch response +type MSearchTemplateResp struct { + Took int `json:"took"` + Responses []struct { + Took int `json:"took"` + Timeout bool `json:"timed_out"` + Shards ResponseShards `json:"_shards"` + Hits struct { + Total struct { + Value int `json:"value"` + Relation string `json:"relation"` + } `json:"total"` + MaxScore *float32 `json:"max_score"` + Hits []SearchHit `json:"hits"` + } `json:"hits"` + Status int `json:"status"` + } `json:"responses"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r MSearchTemplateResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_msearch.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_msearch.go new file mode 100644 index 000000000..6abfc7508 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_msearch.go @@ -0,0 +1,83 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" + "io" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// MSearch executes a /_msearch request with the optional MSearchReq +func (c Client) MSearch(ctx context.Context, req MSearchReq) (*MSearchResp, error) { + var ( + data MSearchResp + err error + ) + if data.response, err = c.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// MSearchReq represents possible options for the /_msearch request +type MSearchReq struct { + Indices []string + + Body io.Reader + + Header http.Header + Params MSearchParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r MSearchReq) GetRequest() (*http.Request, error) { + indices := strings.Join(r.Indices, ",") + var path strings.Builder + path.Grow(len("//_msearch") + len(indices)) + if len(r.Indices) > 0 { + path.WriteString("/") + path.WriteString(indices) + } + path.WriteString("/_msearch") + return opensearch.BuildRequest( + "POST", + path.String(), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// MSearchResp represents the returned struct of the /_msearch response +type MSearchResp struct { + Took int `json:"took"` + Responses []struct { + Took int `json:"took"` + Timeout bool `json:"timed_out"` + Shards ResponseShards `json:"_shards"` + Hits struct { + Total struct { + Value int `json:"value"` + Relation string `json:"relation"` + } `json:"total"` + MaxScore float32 `json:"max_score"` + Hits []SearchHit `json:"hits"` + } `json:"hits"` + Status int `json:"status"` + } `json:"responses"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r MSearchResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_mtermvectors-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_mtermvectors-params.go new file mode 100644 index 000000000..cfa2644aa --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_mtermvectors-params.go @@ -0,0 +1,118 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" +) + +// MTermvectorsParams represents possible parameters for the MTermvectorsReq +type MTermvectorsParams struct { + Fields []string + FieldStatistics *bool + Ids []string + Offsets *bool + Payloads *bool + Positions *bool + Preference string + Realtime *bool + Routing string + TermStatistics *bool + Version *int + VersionType string + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r MTermvectorsParams) get() map[string]string { + params := make(map[string]string) + + if len(r.Fields) > 0 { + params["fields"] = strings.Join(r.Fields, ",") + } + + if r.FieldStatistics != nil { + params["field_statistics"] = strconv.FormatBool(*r.FieldStatistics) + } + + if len(r.Ids) > 0 { + params["ids"] = strings.Join(r.Ids, ",") + } + + if r.Offsets != nil { + params["offsets"] = strconv.FormatBool(*r.Offsets) + } + + if r.Payloads != nil { + params["payloads"] = strconv.FormatBool(*r.Payloads) + } + + if r.Positions != nil { + params["positions"] = strconv.FormatBool(*r.Positions) + } + + if r.Preference != "" { + params["preference"] = r.Preference + } + + if r.Realtime != nil { + params["realtime"] = strconv.FormatBool(*r.Realtime) + } + + if r.Routing != "" { + params["routing"] = r.Routing + } + + if r.TermStatistics != nil { + params["term_statistics"] = strconv.FormatBool(*r.TermStatistics) + } + + if r.Version != nil { + params["version"] = strconv.FormatInt(int64(*r.Version), 10) + } + + if r.VersionType != "" { + params["version_type"] = r.VersionType + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_mtermvectors.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_mtermvectors.go new file mode 100644 index 000000000..71f9c14a5 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_mtermvectors.go @@ -0,0 +1,77 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" + "encoding/json" + "io" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// MTermvectors executes a /_mtermvectors request with the required MTermvectorsReq +func (c Client) MTermvectors(ctx context.Context, req MTermvectorsReq) (*MTermvectorsResp, error) { + var ( + data MTermvectorsResp + err error + ) + if data.response, err = c.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// MTermvectorsReq represents possible options for the /_mtermvectors request +type MTermvectorsReq struct { + Index string + + Body io.Reader + + Header http.Header + Params MTermvectorsParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r MTermvectorsReq) GetRequest() (*http.Request, error) { + var path strings.Builder + path.Grow(len("//_mtermvectors") + len(r.Index)) + if len(r.Index) > 0 { + path.WriteString("/") + path.WriteString(r.Index) + } + path.WriteString("/_mtermvectors") + return opensearch.BuildRequest( + "POST", + path.String(), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// MTermvectorsResp represents the returned struct of the /_mtermvectors response +type MTermvectorsResp struct { + Docs []struct { + Index string `json:"_index"` + ID string `json:"_id"` + Version int `json:"_version"` + Found bool `json:"found"` + Took int `json:"took"` + Type string `json:"_type"` // Deprecated field + TermVectors json.RawMessage `json:"term_vectors"` + } `json:"docs"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r MTermvectorsResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-hot_threads-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-hot_threads-params.go new file mode 100644 index 000000000..8e2ae4cc9 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-hot_threads-params.go @@ -0,0 +1,83 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// NodesHotThreadsParams represents possible parameters for the NodesHotThreadsReq +type NodesHotThreadsParams struct { + IgnoreIdleThreads *bool + Interval time.Duration + Snapshots *int + Threads *int + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r NodesHotThreadsParams) get() map[string]string { + params := make(map[string]string) + + if r.IgnoreIdleThreads != nil { + params["ignore_idle_threads"] = strconv.FormatBool(*r.IgnoreIdleThreads) + } + + if r.Interval != 0 { + params["interval"] = formatDuration(r.Interval) + } + + if r.Snapshots != nil { + params["snapshots"] = strconv.FormatInt(int64(*r.Snapshots), 10) + } + + if r.Threads != nil { + params["threads"] = strconv.FormatInt(int64(*r.Threads), 10) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-hot_threads.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-hot_threads.go new file mode 100644 index 000000000..ee5f5ad22 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-hot_threads.go @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// NodesHotThreadsReq represents possible options for the /_nodes request +type NodesHotThreadsReq struct { + NodeID []string + + Header http.Header + Params NodesHotThreadsParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r NodesHotThreadsReq) GetRequest() (*http.Request, error) { + nodes := strings.Join(r.NodeID, ",") + + var path strings.Builder + path.Grow(len("/_nodes//hot_threads") + len(nodes)) + path.WriteString("/_nodes/") + if len(r.NodeID) > 0 { + path.WriteString(nodes) + path.WriteString("/") + } + path.WriteString("hot_threads") + + return opensearch.BuildRequest( + "GET", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-info-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-info-params.go new file mode 100644 index 000000000..73feb40a1 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-info-params.go @@ -0,0 +1,68 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// NodesInfoParams represents possible parameters for the NodesInfoReq +type NodesInfoParams struct { + FlatSettings *bool + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r NodesInfoParams) get() map[string]string { + params := make(map[string]string) + + if r.FlatSettings != nil { + params["flat_settings"] = strconv.FormatBool(*r.FlatSettings) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-info.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-info.go new file mode 100644 index 000000000..559485b1c --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-info.go @@ -0,0 +1,195 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "encoding/json" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// NodesInfoReq represents possible options for the /_nodes request +type NodesInfoReq struct { + Metrics []string + NodeID []string + + Header http.Header + Params NodesInfoParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r NodesInfoReq) GetRequest() (*http.Request, error) { + nodes := strings.Join(r.NodeID, ",") + metrics := strings.Join(r.Metrics, ",") + + var path strings.Builder + + path.Grow(len("/_nodes//") + len(nodes) + len(metrics)) + + path.WriteString("/_nodes") + if len(r.NodeID) > 0 { + path.WriteString("/") + path.WriteString(nodes) + } + if len(r.Metrics) > 0 { + path.WriteString("/") + path.WriteString(metrics) + } + + return opensearch.BuildRequest( + "GET", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// NodesInfoResp represents the returned struct of the /_nodes response +type NodesInfoResp struct { + NodesInfo struct { + Total int `json:"total"` + Successful int `json:"successful"` + Failed int `json:"failed"` + } `json:"_nodes"` + ClusterName string `json:"cluster_name"` + Nodes map[string]NodesInfo `json:"nodes"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r NodesInfoResp) Inspect() Inspect { + return Inspect{Response: r.response} +} + +// NodesInfo is a sub type of NodesInfoResp containing information about nodes and their stats +type NodesInfo struct { + Name string `json:"name"` + TransportAddress string `json:"transport_address"` + Host string `json:"host"` + IP string `json:"ip"` + Version string `json:"version"` + BuildType string `json:"build_type"` + BuildHash string `json:"build_hash"` + TotalIndexingBuffer int64 `json:"total_indexing_buffer"` + Roles []string `json:"roles"` + Attributes map[string]string `json:"attributes"` + Settings json.RawMessage `json:"settings"` // Won't parse as it may contain fields that we can't know + OS NodesInfoOS `json:"os"` + Process NodesInfoProcess `json:"process"` + JVM NodesInfoJVM `json:"jvm"` + ThreadPool map[string]NodesInfoThreadPool `json:"thread_pool"` + Transport NodesInfoTransport `json:"transport"` + HTTP NodesInfoHTTP `json:"http"` + Plugins []NodesInfoPlugin `json:"plugins"` + Modules []NodesInfoPlugin `json:"modules"` + Ingest NodesInfoIngest `json:"ingest"` + Aggregations map[string]NodesInfoAgg `json:"aggregations"` + SearchPipelines NodesInfoSearchPipelines `json:"search_pipelines"` +} + +// NodesInfoOS is a sub type of NodesInfo containing information about the Operating System +type NodesInfoOS struct { + RefreshIntervalInMillis int `json:"refresh_interval_in_millis"` + Name string `json:"name"` + PrettyName string `json:"pretty_name"` + Arch string `json:"arch"` + Version string `json:"version"` + AvailableProcessors int `json:"available_processors"` + AllocatedProcessors int `json:"allocated_processors"` +} + +// NodesInfoProcess is a sub type of NodesInfo containing information about the nodes process +type NodesInfoProcess struct { + RefreshIntervalInMillis int `json:"refresh_interval_in_millis"` + ID int `json:"id"` + Mlockall bool `json:"mlockall"` +} + +// NodesInfoJVM is a sub type of NodesInfo containing information and stats about JVM +type NodesInfoJVM struct { + PID int `json:"pid"` + Version string `json:"version"` + VMName string `json:"vm_name"` + VMVersion string `json:"vm_version"` + VMVendor string `json:"vm_vendor"` + BundledJDK bool `json:"bundled_jdk"` + UsingBundledJDK bool `json:"using_bundled_jdk"` + StartTimeInMillis int64 `json:"start_time_in_millis"` + Mem struct { + HeapInitInBytes int64 `json:"heap_init_in_bytes"` + HeapMaxInBytes int64 `json:"heap_max_in_bytes"` + NonHeapInitInBytes int `json:"non_heap_init_in_bytes"` + NonHeapMaxInBytes int `json:"non_heap_max_in_bytes"` + DirectMaxInBytes int `json:"direct_max_in_bytes"` + } `json:"mem"` + GcCollectors []string `json:"gc_collectors"` + MemoryPools []string `json:"memory_pools"` + UsingCompressedOrdinaryObjectPointers string `json:"using_compressed_ordinary_object_pointers"` + InputArguments []string `json:"input_arguments"` +} + +// NodesInfoThreadPool is a sub type of NodesInfo containing information about a thread pool +type NodesInfoThreadPool struct { + Type string `json:"type"` + Size int `json:"size"` + QueueSize int `json:"queue_size"` + KeepAlive string `json:"keep_alive"` + Max int `json:"max"` + Core int `json:"core"` +} + +// NodesInfoTransport is a sub type of NodesInfo containing information about the nodes transport settings +type NodesInfoTransport struct { + BoundAddress []string `json:"bound_address"` + PublishAddress string `json:"publish_address"` + Profiles json.RawMessage `json:"profiles"` // Unknown content +} + +// NodesInfoHTTP is a sub type of NodesInfo containing information about the nodes http settings +type NodesInfoHTTP struct { + BoundAddress []string `json:"bound_address"` + PublishAddress string `json:"publish_address"` + MaxContentLengthInBytes int64 `json:"max_content_length_in_bytes"` +} + +// NodesInfoPlugin is a sub type of NodesInfo containing information about a plugin +type NodesInfoPlugin struct { + Name string `json:"name"` + Version string `json:"version"` + OpensearchVersion string `json:"opensearch_version"` + JavaVersion string `json:"java_version"` + Description string `json:"description"` + Classname string `json:"classname"` + CustomFoldername *string `json:"custom_foldername"` + ExtendedPlugins []string `json:"extended_plugins"` + HasNativeController bool `json:"has_native_controller"` +} + +// NodesInfoIngest is a sub type of NodesInfo containing information about ingest processors +type NodesInfoIngest struct { + Processors []NodesInfoType `json:"processors"` +} + +// NodesInfoAgg is a sub type of NodesInfo containing information about aggregations +type NodesInfoAgg struct { + Types []string `json:"types"` +} + +// NodesInfoSearchPipelines is a sub type of NodesInfo containing information about search pipelines +type NodesInfoSearchPipelines struct { + RequestProcessors []NodesInfoType `json:"request_processors"` + ResponseProcessors []NodesInfoType `json:"response_processors"` + Processors []NodesInfoType `json:"processors,omitempty"` // Deprecated field only available in 2.7.0 +} + +// NodesInfoType is a sub type of NodesInfoIngest, NodesInfoSearchPipelines containing information about a type +type NodesInfoType struct { + Type string `json:"type"` +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-reload_security-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-reload_security-params.go new file mode 100644 index 000000000..b1fb04051 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-reload_security-params.go @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "time" +) + +// NodesReloadSecurityParams represents possible parameters for the NodesReloadSecurityReq +type NodesReloadSecurityParams struct { + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r NodesReloadSecurityParams) get() map[string]string { + params := make(map[string]string) + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-reload_security.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-reload_security.go new file mode 100644 index 000000000..32409095f --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-reload_security.go @@ -0,0 +1,68 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "io" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// NodesReloadSecurityReq represents possible options for the /_nodes request +type NodesReloadSecurityReq struct { + NodeID []string + + Body io.Reader + + Header http.Header + Params NodesReloadSecurityParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r NodesReloadSecurityReq) GetRequest() (*http.Request, error) { + nodes := strings.Join(r.NodeID, ",") + + var path strings.Builder + + path.Grow(len("/_nodes//reload_secure_settings") + len(nodes)) + + path.WriteString("/_nodes") + if len(r.NodeID) > 0 { + path.WriteString("/") + path.WriteString(nodes) + } + path.WriteString("/reload_secure_settings") + + return opensearch.BuildRequest( + "POST", + path.String(), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// NodesReloadSecurityResp represents the returned struct of the /_nodes response +type NodesReloadSecurityResp struct { + NodesInfo struct { + Total int `json:"total"` + Successful int `json:"successful"` + Failed int `json:"failed"` + } `json:"_nodes"` + ClusterName string `json:"cluster_name"` + Nodes map[string]struct { + Name string `json:"name"` + } `json:"nodes"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r NodesReloadSecurityResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-stats-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-stats-params.go new file mode 100644 index 000000000..b9f592bfb --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-stats-params.go @@ -0,0 +1,104 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" + "time" +) + +// NodesStatsParams represents possible parameters for the NodesStatsReq +type NodesStatsParams struct { + CompletionFields []string + FielddataFields []string + Fields []string + Groups *bool + IncludeSegmentFileSizes *bool + IncludeUnloadedSegments *bool + Level string + Timeout time.Duration + Types []string + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r NodesStatsParams) get() map[string]string { + params := make(map[string]string) + + if len(r.CompletionFields) > 0 { + params["completion_fields"] = strings.Join(r.CompletionFields, ",") + } + + if len(r.FielddataFields) > 0 { + params["fielddata_fields"] = strings.Join(r.FielddataFields, ",") + } + + if len(r.Fields) > 0 { + params["fields"] = strings.Join(r.Fields, ",") + } + + if r.Groups != nil { + params["groups"] = strconv.FormatBool(*r.Groups) + } + + if r.IncludeSegmentFileSizes != nil { + params["include_segment_file_sizes"] = strconv.FormatBool(*r.IncludeSegmentFileSizes) + } + + if r.IncludeUnloadedSegments != nil { + params["include_unloaded_segments"] = strconv.FormatBool(*r.IncludeUnloadedSegments) + } + + if r.Level != "" { + params["level"] = r.Level + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if len(r.Types) > 0 { + params["types"] = strings.Join(r.Types, ",") + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-stats.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-stats.go new file mode 100644 index 000000000..7b18c968c --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-stats.go @@ -0,0 +1,707 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "encoding/json" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// NodesStatsReq represents possible options for the /_nodes request +type NodesStatsReq struct { + IndexMetric []string + Metric []string + NodeID []string + Header http.Header + Params NodesStatsParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r NodesStatsReq) GetRequest() (*http.Request, error) { + var path strings.Builder + + path.Grow(13 + len(strings.Join(r.NodeID, ",")) + 1 + len(strings.Join(r.Metric, ",")) + 1 + len(strings.Join(r.IndexMetric, ","))) + + path.WriteString("/") + path.WriteString("_nodes") + + if len(r.NodeID) > 0 { + path.WriteString("/") + path.WriteString(strings.Join(r.NodeID, ",")) + } + + path.WriteString("/") + path.WriteString("stats") + + if len(r.Metric) > 0 { + path.WriteString("/") + path.WriteString(strings.Join(r.Metric, ",")) + } + + if len(r.IndexMetric) > 0 { + path.WriteString("/") + path.WriteString(strings.Join(r.IndexMetric, ",")) + } + + return opensearch.BuildRequest( + "GET", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// NodesStatsResp represents the returned struct of the /_nodes response +type NodesStatsResp struct { + NodesInfo struct { + Total int `json:"total"` + Successful int `json:"successful"` + Failed int `json:"failed"` + } `json:"_nodes"` + ClusterName string `json:"cluster_name"` + Nodes map[string]NodesStats `json:"nodes"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r NodesStatsResp) Inspect() Inspect { + return Inspect{Response: r.response} +} + +// NodesStats is a map item of NodesStatsResp representing all values of a node +type NodesStats struct { + Timestamp int `json:"timestamp"` + Name string `json:"name"` + TransportAddress string `json:"transport_address"` + Host string `json:"host"` + IP string `json:"ip"` + Roles []string `json:"roles"` + Attributes map[string]string `json:"attributes"` + Indices NodesStatsIndices `json:"indices"` + OS NodesStatsOS `json:"os"` + Process NodesStatsProcess `json:"process"` + JVM NodesStatsJVM `json:"jvm"` + ThreadPool NodesStatsThreadPool `json:"thread_pool"` + FS NodesStatsFS `json:"fs"` + Transport NodesStatsTransport `json:"transport"` + HTTP NodesStatsHTTP `json:"http"` + Breakers NodesStatsBreakers `json:"breakers"` + Scripts NodesStatsScript `json:"script"` + Discovery NodesStatsDiscovery `json:"discovery"` + Ingest NodesStatsIngest `json:"ingest"` + AdaptiveSelection NodesStatsAdaptiveSelection `json:"adaptive_selection"` + ScriptCache NodesStatsScriptCache `json:"script_cache"` + IndexingPressure NodesStatsIndexingPressure `json:"indexing_pressure"` + ShardIndexingPressure NodesStatsShardIndexingPressure `json:"shard_indexing_pressure"` + SearchBackpressure NodesStatsSearchBackpressure `json:"search_backpressure"` + ClusterManagerThrottling NodesStatsClusterManagerThrottling `json:"cluster_manager_throttling"` + WeightedRouting NodesStatsWeightedRouting `json:"weighted_routing"` + SearchPipeline NodesStatsSearchPipeline `json:"search_pipeline"` + TaskCancellation NodesStatsTaskCancellation `json:"task_cancellation"` + ResourceUsageStats map[string]NodesStatsResourceUsageStats `json:"resource_usage_stats"` + SegmentReplicationBackpressure NodesStatsSegmentReplicationBackpressure `json:"segment_replication_backpressure"` + Repositories []json.RawMessage `json:"repositories"` + AdmissionControl NodesStatsAdmissionControl `json:"admission_control"` +} + +// NodesStatsIndices is a sub type of NodesStats representing Indices information of the node +type NodesStatsIndices struct { + Docs struct { + Count int `json:"count"` + Deleted int `json:"deleted"` + } `json:"docs"` + Store struct { + SizeInBytes int `json:"size_in_bytes"` + ReservedInBytes int `json:"reserved_in_bytes"` + } `json:"store"` + Indexing struct { + IndexTotal int `json:"index_total"` + IndexTimeInMillis int `json:"index_time_in_millis"` + IndexCurrent int `json:"index_current"` + IndexFailed int `json:"index_failed"` + DeleteTotal int `json:"delete_total"` + DeleteTimeInMillis int `json:"delete_time_in_millis"` + DeleteCurrent int `json:"delete_current"` + NoopUpdateTotal int `json:"noop_update_total"` + IsThrottled bool `json:"is_throttled"` + ThrottleTimeInMillis int `json:"throttle_time_in_millis"` + DocStatus map[string]int `json:"doc_status"` + } `json:"indexing"` + Get struct { + Total int `json:"total"` + TimeInMillis int `json:"time_in_millis"` + ExistsTotal int `json:"exists_total"` + ExistsTimeInMillis int `json:"exists_time_in_millis"` + MissingTotal int `json:"missing_total"` + MissingTimeInMillis int `json:"missing_time_in_millis"` + Current int `json:"current"` + } `json:"get"` + Search struct { + OpenContexts int `json:"open_contexts"` + QueryTotal int `json:"query_total"` + QueryTimeInMillis int `json:"query_time_in_millis"` + QueryCurrent int `json:"query_current"` + ConcurrentQueryTotal int `json:"concurrent_query_total"` + ConcurrentQueryTimeInMillis int `json:"concurrent_query_time_in_millis"` + ConcurrentQueryCurrent int `json:"concurrent_query_current"` + ConcurrentAVGSliceCount float32 `json:"concurrent_avg_slice_count"` + FetchTotal int `json:"fetch_total"` + FetchTimeInMillis int `json:"fetch_time_in_millis"` + FetchCurrent int `json:"fetch_current"` + ScrollTotal int `json:"scroll_total"` + ScrollTimeInMillis int `json:"scroll_time_in_millis"` + ScrollCurrent int `json:"scroll_current"` + PointInTimeTotal int `json:"point_in_time_total"` + PointInTimeTimeInMillis int `json:"point_in_time_time_in_millis"` + PointInTimeCurrent int `json:"point_in_time_current"` + SuggestTotal int `json:"suggest_total"` + SuggestTimeInMillis int `json:"suggest_time_in_millis"` + SuggestCurrent int `json:"suggest_current"` + Request struct { + DfsPreQuery NodesStatsIndicesSearchRequest `json:"dfs_pre_query"` + Query NodesStatsIndicesSearchRequest `json:"query"` + Fetch NodesStatsIndicesSearchRequest `json:"fetch"` + DfsQuery NodesStatsIndicesSearchRequest `json:"dfs_query"` + Expand NodesStatsIndicesSearchRequest `json:"expand"` + CanMatch NodesStatsIndicesSearchRequest `json:"can_match"` + } `json:"request"` + } `json:"search"` + Merges struct { + Current int `json:"current"` + CurrentDocs int `json:"current_docs"` + CurrentSizeInBytes int `json:"current_size_in_bytes"` + Total int `json:"total"` + TotalTimeInMillis int `json:"total_time_in_millis"` + TotalDocs int `json:"total_docs"` + TotalSizeInBytes int `json:"total_size_in_bytes"` + TotalStoppedTimeInMillis int `json:"total_stopped_time_in_millis"` + TotalThrottledTimeInMillis int `json:"total_throttled_time_in_millis"` + TotalAutoThrottleInBytes int `json:"total_auto_throttle_in_bytes"` + UnreferencedFileCleanupsPerformed int `json:"unreferenced_file_cleanups_performed"` + } `json:"merges"` + Refresh struct { + Total int `json:"total"` + TotalTimeInMillis int `json:"total_time_in_millis"` + ExternalTotal int `json:"external_total"` + ExternalTotalTimeInMillis int `json:"external_total_time_in_millis"` + Listeners int `json:"listeners"` + } `json:"refresh"` + Flush struct { + Total int `json:"total"` + Periodic int `json:"periodic"` + TotalTimeInMillis int `json:"total_time_in_millis"` + } `json:"flush"` + Warmer struct { + Current int `json:"current"` + Total int `json:"total"` + TotalTimeInMillis int `json:"total_time_in_millis"` + } `json:"warmer"` + QueryCache struct { + MemorySizeInBytes int `json:"memory_size_in_bytes"` + TotalCount int `json:"total_count"` + HitCount int `json:"hit_count"` + MissCount int `json:"miss_count"` + CacheSize int `json:"cache_size"` + CacheCount int `json:"cache_count"` + Evictions int `json:"evictions"` + } `json:"query_cache"` + Fielddata struct { + MemorySizeInBytes int `json:"memory_size_in_bytes"` + Evictions int `json:"evictions"` + } `json:"fielddata"` + Completion struct { + SizeInBytes int `json:"size_in_bytes"` + } `json:"completion"` + Segments struct { + Count int `json:"count"` + MemoryInBytes int `json:"memory_in_bytes"` + TermsMemoryInBytes int `json:"terms_memory_in_bytes"` + StoredFieldsMemoryInBytes int `json:"stored_fields_memory_in_bytes"` + TermVectorsMemoryInBytes int `json:"term_vectors_memory_in_bytes"` + NormsMemoryInBytes int `json:"norms_memory_in_bytes"` + PointsMemoryInBytes int `json:"points_memory_in_bytes"` + DocValuesMemoryInBytes int `json:"doc_values_memory_in_bytes"` + IndexWriterMemoryInBytes int `json:"index_writer_memory_in_bytes"` + VersionMapMemoryInBytes int `json:"version_map_memory_in_bytes"` + FixedBitSetMemoryInBytes int `json:"fixed_bit_set_memory_in_bytes"` + MaxUnsafeAutoIDTimestamp int `json:"max_unsafe_auto_id_timestamp"` + RemoteStore struct { + Upload struct { + TotalUploadSize struct { + StartedBytes int `json:"started_bytes"` + SucceededBytes int `json:"succeeded_bytes"` + FailedBytes int `json:"failed_bytes"` + } `json:"total_upload_size"` + RefreshSizeLag struct { + TotalBytes int `json:"total_bytes"` + MaxBytes int `json:"max_bytes"` + } `json:"refresh_size_lag"` + MaxRefreshTimeLagInMillis int `json:"max_refresh_time_lag_in_millis"` + TotalTimeSpentInMillis int `json:"total_time_spent_in_millis"` + Pressure struct { + TotalRejections int `json:"total_rejections"` + } `json:"pressure"` + } `json:"upload"` + Download struct { + TotalDownloadSize struct { + StartedBytes int `json:"started_bytes"` + SucceededBytes int `json:"succeeded_bytes"` + FailedBytes int `json:"failed_bytes"` + } `json:"total_download_size"` + TotalTimeSpentInMillis int `json:"total_time_spent_in_millis"` + } `json:"download"` + } `json:"remote_store"` + SegmentReplication struct { + // Type is json.RawMessage due to difference in opensearch versions from string to int + MaxBytesBehind json.RawMessage `json:"max_bytes_behind"` + TotalBytesBehind json.RawMessage `json:"total_bytes_behind"` + MaxReplicationLag json.RawMessage `json:"max_replication_lag"` + } `json:"segment_replication"` + FileSizes json.RawMessage `json:"file_sizes"` + } `json:"segments"` + Translog struct { + Operations int `json:"operations"` + SizeInBytes int `json:"size_in_bytes"` + UncommittedOperations int `json:"uncommitted_operations"` + UncommittedSizeInBytes int `json:"uncommitted_size_in_bytes"` + EarliestLastModifiedAge int `json:"earliest_last_modified_age"` + RemoteStore struct { + Upload struct { + TotalUploads struct { + Started int `json:"started"` + Failed int `json:"failed"` + Succeeded int `json:"succeeded"` + } `json:"total_uploads"` + TotalUploadSize struct { + StartedBytes int `json:"started_bytes"` + FailedBytes int `json:"failed_bytes"` + SucceededBytes int `json:"succeeded_bytes"` + } `json:"total_upload_size"` + } `json:"upload"` + } `json:"remote_store"` + } `json:"translog"` + RequestCache struct { + MemorySizeInBytes int `json:"memory_size_in_bytes"` + Evictions int `json:"evictions"` + HitCount int `json:"hit_count"` + MissCount int `json:"miss_count"` + } `json:"request_cache"` + Recovery struct { + CurrentAsSource int `json:"current_as_source"` + CurrentAsTarget int `json:"current_as_target"` + ThrottleTimeInMillis int `json:"throttle_time_in_millis"` + } `json:"recovery"` +} + +// NodesStatsOS is a sub type of NodesStats representing operating system information of the node +type NodesStatsOS struct { + Timestamp int `json:"timestamp"` + CPU struct { + Percent int `json:"percent"` + LoadAverage struct { + OneM float64 `json:"1m"` + FiveM float64 `json:"5m"` + One5M float64 `json:"15m"` + } `json:"load_average"` + } `json:"cpu"` + Mem struct { + TotalInBytes int `json:"total_in_bytes"` + FreeInBytes int `json:"free_in_bytes"` + UsedInBytes int `json:"used_in_bytes"` + FreePercent int `json:"free_percent"` + UsedPercent int `json:"used_percent"` + } `json:"mem"` + Swap struct { + TotalInBytes int `json:"total_in_bytes"` + FreeInBytes int `json:"free_in_bytes"` + UsedInBytes int `json:"used_in_bytes"` + } `json:"swap"` +} + +// NodesStatsProcess is a sub type of NodesStats representing processor information of the node +type NodesStatsProcess struct { + Timestamp int `json:"timestamp"` + OpenFileDescriptors int `json:"open_file_descriptors"` + MaxFileDescriptors int `json:"max_file_descriptors"` + CPU struct { + Percent int `json:"percent"` + TotalInMillis int `json:"total_in_millis"` + } `json:"cpu"` + Mem struct { + TotalVirtualInBytes int `json:"total_virtual_in_bytes"` + } `json:"mem"` +} + +// NodesStatsJVMPool is a sub type of NodesStatsJVM represeting all information a pool can have +type NodesStatsJVMPool struct { + UsedInBytes int `json:"used_in_bytes"` + MaxInBytes int `json:"max_in_bytes"` + PeakUsedInBytes int `json:"peak_used_in_bytes"` + PeakMaxInBytes int `json:"peak_max_in_bytes"` + LastGcStats struct { + UsedInBytes int `json:"used_in_bytes"` + MaxInBytes int `json:"max_in_bytes"` + UsagePercent int `json:"usage_percent"` + } `json:"last_gc_stats"` +} + +// NodesStatsJVMBufferPool is a sub map type represeting all information a buffer pool can have +type NodesStatsJVMBufferPool struct { + Count int `json:"count"` + UsedInBytes int `json:"used_in_bytes"` + TotalCapacityInBytes int `json:"total_capacity_in_bytes"` +} + +// NodesStatsJVM is a sub type of NodesStats representing java virtual maschine information of the node +type NodesStatsJVM struct { + Timestamp int `json:"timestamp"` + UptimeInMillis int `json:"uptime_in_millis"` + Mem struct { + HeapUsedInBytes int `json:"heap_used_in_bytes"` + HeapUsedPercent int `json:"heap_used_percent"` + HeapCommittedInBytes int `json:"heap_committed_in_bytes"` + HeapMaxInBytes int `json:"heap_max_in_bytes"` + NonHeapUsedInBytes int `json:"non_heap_used_in_bytes"` + NonHeapCommittedInBytes int `json:"non_heap_committed_in_bytes"` + Pools struct { + Young NodesStatsJVMPool `json:"young"` + Old NodesStatsJVMPool `json:"old"` + Survivor NodesStatsJVMPool `json:"survivor"` + } `json:"pools"` + } `json:"mem"` + Threads struct { + Count int `json:"count"` + PeakCount int `json:"peak_count"` + } `json:"threads"` + Gc struct { + Collectors map[string]NodesStatsJVMGCCollectors `json:"collectors"` + } `json:"gc"` + // Not parsing each field directly as one of them contains singe quotes which are not allowed as tag in golang json + // https://github.com/golang/go/issues/22518 + BufferPools map[string]NodesStatsJVMBufferPool `json:"buffer_pools"` + Classes struct { + CurrentLoadedCount int `json:"current_loaded_count"` + TotalLoadedCount int `json:"total_loaded_count"` + TotalUnloadedCount int `json:"total_unloaded_count"` + } `json:"classes"` +} + +// NodesStatsJVMGCCollectors is a sub type of NodesStatsJVM containing collector information +type NodesStatsJVMGCCollectors struct { + CollectionCount int `json:"collection_count"` + CollectionTimeInMillis int `json:"collection_time_in_millis"` +} + +// NodesStatsThreadPoolValues is a sub type of NodesStatsThreadPool representing all information a thread pool can have +type NodesStatsThreadPoolValues struct { + Threads int `json:"threads"` + Queue int `json:"queue"` + Active int `json:"active"` + Rejected int `json:"rejected"` + Largest int `json:"largest"` + Completed int `json:"completed"` + TotalWaitTimeInNanos *int64 `json:"total_wait_time_in_nanos,omitempty"` +} + +// NodesStatsThreadPool is a sub type of NodesStats representing thread pool information of the node +type NodesStatsThreadPool map[string]NodesStatsThreadPoolValues + +// NodesStatsFS is a sub type of NodesStats representing filesystem information of the node +type NodesStatsFS struct { + Timestamp int `json:"timestamp"` + Total struct { + TotalInBytes int `json:"total_in_bytes"` + FreeInBytes int `json:"free_in_bytes"` + AvailableInBytes int `json:"available_in_bytes"` + CacheReservedInBytes int `json:"cache_reserved_in_bytes"` + } `json:"total"` + Data []struct { + Path string `json:"path"` + Mount string `json:"mount"` + Type string `json:"type"` + TotalInBytes int `json:"total_in_bytes"` + FreeInBytes int `json:"free_in_bytes"` + AvailableInBytes int `json:"available_in_bytes"` + CacheReservedInBytes int `json:"cache_reserved_in_bytes"` + } `json:"data"` + IoStats struct { + Devices []struct { + DeviceName string `json:"device_name"` + Operations int `json:"operations"` + ReadOperations int `json:"read_operations"` + WriteOperations int `json:"write_operations"` + ReadKilobytes int `json:"read_kilobytes"` + WriteKilobytes int `json:"write_kilobytes"` + } `json:"devices"` + Total struct { + Operations int `json:"operations"` + ReadOperations int `json:"read_operations"` + WriteOperations int `json:"write_operations"` + ReadKilobytes int `json:"read_kilobytes"` + WriteKilobytes int `json:"write_kilobytes"` + } `json:"total"` + } `json:"io_stats"` +} + +// NodesStatsTransport is a sub type of NodesStats representing network transport information of the node +type NodesStatsTransport struct { + ServerOpen int `json:"server_open"` + TotalOutboundConnections int `json:"total_outbound_connections"` + RxCount int `json:"rx_count"` + RxSizeInBytes int `json:"rx_size_in_bytes"` + TxCount int `json:"tx_count"` + TxSizeInBytes int `json:"tx_size_in_bytes"` +} + +// NodesStatsHTTP is a sub type of NodesStats representing http information of the node +type NodesStatsHTTP struct { + CurrentOpen int `json:"current_open"` + TotalOpened int `json:"total_opened"` +} + +// NodesStatsBreaker is a sub type of NodesStatsBreakers containing all information a breaker can have +type NodesStatsBreaker struct { + LimitSizeInBytes int `json:"limit_size_in_bytes"` + LimitSize string `json:"limit_size"` + EstimatedSizeInBytes int `json:"estimated_size_in_bytes"` + EstimatedSize string `json:"estimated_size"` + Overhead float64 `json:"overhead"` + Tripped int `json:"tripped"` +} + +// NodesStatsBreakers is a sub type of NodesStats representing breakers information of the node +type NodesStatsBreakers struct { + Accounting NodesStatsBreaker `json:"accounting"` + Request NodesStatsBreaker `json:"request"` + Fielddata NodesStatsBreaker `json:"fielddata"` + InFlightRequests NodesStatsBreaker `json:"in_flight_requests"` + Parent NodesStatsBreaker `json:"parent"` +} + +// NodesStatsScript is a sub type of NodesStats representing script information of the node +type NodesStatsScript struct { + Compilations int `json:"compilations"` + CacheEvictions int `json:"cache_evictions"` + CompilationLimitTriggered int `json:"compilation_limit_triggered"` +} + +// NodesStatsDiscovery is a sub type of NodesStats representing discovery information of the node +type NodesStatsDiscovery struct { + ClusterStateQueue struct { + Total int `json:"total"` + Pending int `json:"pending"` + Committed int `json:"committed"` + } `json:"cluster_state_queue"` + PublishedClusterStates struct { + FullStates int `json:"full_states"` + IncompatibleDiffs int `json:"incompatible_diffs"` + CompatibleDiffs int `json:"compatible_diffs"` + } `json:"published_cluster_states"` + ClusterStateStats struct { + Overall struct { + UpdateCount int `json:"update_count"` + TotalTimeInMillis int `json:"total_time_in_millis"` + FailedCount int `json:"failed_count"` + } `json:"overall"` + } `json:"cluster_state_stats"` +} + +// NodesStatsIngestDetails is a sub map type of NodsStatsIngest containing all information of ingest pipelines +type NodesStatsIngestDetails struct { + Count int `json:"count"` + TimeInMillis int `json:"time_in_millis"` + Failed int `json:"failed"` + Current int `json:"current"` + Processors []json.RawMessage `json:"processors"` +} + +// NodesStatsIngest is a sub type of NodesStats representing ingest pipelines information of the node +type NodesStatsIngest struct { + Total struct { + Count int `json:"count"` + TimeInMillis int `json:"time_in_millis"` + Current int `json:"current"` + Failed int `json:"failed"` + } `json:"total"` + Pipelines map[string]NodesStatsIngestDetails `json:"pipelines"` +} + +// NodesStatsAdaptiveSelection is a sub type of NodesStats representing adaptive selection information of the node +type NodesStatsAdaptiveSelection map[string]struct { + OutgoingSearches int `json:"outgoing_searches"` + AvgQueueSize int `json:"avg_queue_size"` + AvgServiceTimeNs int `json:"avg_service_time_ns"` + AvgResponseTimeNs int `json:"avg_response_time_ns"` + Rank string `json:"rank"` +} + +// NodesStatsScriptCache is a sub type of NodesStats representing script cache information of the node +type NodesStatsScriptCache struct { + Sum struct { + Compilations int `json:"compilations"` + CacheEvictions int `json:"cache_evictions"` + CompilationLimitTriggered int `json:"compilation_limit_triggered"` + } `json:"sum"` + Contexts []struct { + Context string `json:"context"` + Compilations int `json:"compilations"` + CacheEvictions int `json:"cache_evictions"` + CompilationLimitTriggered int `json:"compilation_limit_triggered"` + } `json:"contexts"` +} + +// NodesStatsIndexingPressure is a sub type of NodesStats representing indexing pressure information of the node +type NodesStatsIndexingPressure struct { + Memory struct { + Current struct { + CombinedCoordinatingAndPrimaryInBytes int `json:"combined_coordinating_and_primary_in_bytes"` + CoordinatingInBytes int `json:"coordinating_in_bytes"` + PrimaryInBytes int `json:"primary_in_bytes"` + ReplicaInBytes int `json:"replica_in_bytes"` + AllInBytes int `json:"all_in_bytes"` + } `json:"current"` + Total struct { + CombinedCoordinatingAndPrimaryInBytes int `json:"combined_coordinating_and_primary_in_bytes"` + CoordinatingInBytes int `json:"coordinating_in_bytes"` + PrimaryInBytes int `json:"primary_in_bytes"` + ReplicaInBytes int `json:"replica_in_bytes"` + AllInBytes int `json:"all_in_bytes"` + CoordinatingRejections int `json:"coordinating_rejections"` + PrimaryRejections int `json:"primary_rejections"` + ReplicaRejections int `json:"replica_rejections"` + } `json:"total"` + LimitInBytes int `json:"limit_in_bytes"` + } `json:"memory"` +} + +// NodesStatsShardIndexingPressure is a sub type of NodesStats representing shard indexing pressure information of the node +type NodesStatsShardIndexingPressure struct { + Stats json.RawMessage `json:"stats"` // Unknown, can be added if you have an example + TotalRejectionsBreakupShadowMode struct { + NodeLimits int `json:"node_limits"` + NoSuccessfulRequestLimits int `json:"no_successful_request_limits"` + ThroughputDegradationLimits int `json:"throughput_degradation_limits"` + } `json:"total_rejections_breakup_shadow_mode"` + Enabled bool `json:"enabled"` + Enforced bool `json:"enforced"` +} + +// NodesStatsSearchBackpressureTracker is a sub type of NodesStatsSearchBrackpressure containing all information of a tracker +type NodesStatsSearchBackpressureTracker struct { + CancellationCount int `json:"cancellation_count"` + CurrentMaxMillis int `json:"current_max_millis"` + CurrentAvgMillis int `json:"current_avg_millis"` +} + +// NodesStatsSearchBackpressure is a sub type of NodesStats representing search packbressure information of a node +type NodesStatsSearchBackpressure struct { + SearchTask struct { + ResourceTrackerStats struct { + CPUUsageTracker NodesStatsSearchBackpressureTracker `json:"cpu_usage_tracker"` + ElapsedTimeTracker NodesStatsSearchBackpressureTracker `json:"elapsed_time_tracker"` + HeapUsageTracker struct { + CancellationCount int `json:"cancellation_count"` + CurrentMaxBytes int `json:"current_max_bytes"` + CurrentAvgBytes int `json:"current_avg_bytes"` + RollingAvgBytes int `json:"rolling_avg_bytes"` + } `json:"heap_usage_tracker"` + } `json:"resource_tracker_stats"` + CancellationStats struct { + CancellationCount int `json:"cancellation_count"` + CancellationLimitReachedCount int `json:"cancellation_limit_reached_count"` + } `json:"cancellation_stats"` + } `json:"search_task"` + SearchShardTask struct { + ResourceTrackerStats struct { + CPUUsageTracker NodesStatsSearchBackpressureTracker `json:"cpu_usage_tracker"` + ElapsedTimeTracker NodesStatsSearchBackpressureTracker `json:"elapsed_time_tracker"` + HeapUsageTracker struct { + CancellationCount int `json:"cancellation_count"` + CurrentMaxBytes int `json:"current_max_bytes"` + CurrentAvgBytes int `json:"current_avg_bytes"` + RollingAvgBytes int `json:"rolling_avg_bytes"` + } `json:"heap_usage_tracker"` + } `json:"resource_tracker_stats"` + CancellationStats struct { + CancellationCount int `json:"cancellation_count"` + CancellationLimitReachedCount int `json:"cancellation_limit_reached_count"` + } `json:"cancellation_stats"` + } `json:"search_shard_task"` + Mode string `json:"mode"` +} + +// NodesStatsClusterManagerThrottling is a sub type of NodesStats representing cluster manager throttling information of the node +type NodesStatsClusterManagerThrottling struct { + Stats struct { + TotalThrottledTasks int `json:"total_throttled_tasks"` + ThrottledTasksPerTaskType json.RawMessage `json:"throttled_tasks_per_task_type"` // Unknow struct, no example in doc + } `json:"stats"` +} + +// NodesStatsWeightedRouting is a sub type of NodesStats representing weighted routing information of the node +type NodesStatsWeightedRouting struct { + Stats struct { + FailOpenCount int `json:"fail_open_count"` + } `json:"stats"` +} + +// NodesStatsSearchPipeline is a sub type of NodesStats containing stats about search pipelines +type NodesStatsSearchPipeline struct { + TotalRequest struct { + Count int `json:"count"` + TimeInMillis int `json:"time_in_millis"` + Current int `json:"current"` + Failed int `json:"failed"` + } `json:"total_request"` + TotalResponse struct { + Count int `json:"count"` + TimeInMillis int `json:"time_in_millis"` + Current int `json:"current"` + Failed int `json:"failed"` + } `json:"total_response"` + Pipelines json.RawMessage `json:"pipelines"` +} + +// NodesStatsTaskCancellation is a sub type of NodesStats containing stats about canceled tasks +type NodesStatsTaskCancellation struct { + SearchShardTask struct { + CurrentCountPostCancel int `json:"current_count_post_cancel"` + TotalCountPostCancel int `json:"total_count_post_cancel"` + } `json:"search_shard_task"` +} + +// NodesStatsIndicesSearchRequest is a sub type of NodesStatsIndices containing stats about search requests +type NodesStatsIndicesSearchRequest struct { + TimeInMillis int `json:"time_in_millis"` + Current int `json:"current"` + Total int `json:"total"` +} + +// NodesStatsResourceUsageStats is a sub type of NodesStats containing nodes resource information +type NodesStatsResourceUsageStats struct { + Timestamp int64 `json:"timestamp"` + CPUUtilizationPercent string `json:"cpu_utilization_percent"` + MemoryUtilizationPercent string `json:"memory_utilization_percent"` +} + +// NodesStatsSegmentReplicationBackpressure is a sub type of NodesStats containing information about segment replication backpressure +type NodesStatsSegmentReplicationBackpressure struct { + TotalRejectedRequests int `json:"total_rejected_requests"` +} + +// NodesStatsAdmissionControl is a sub of NodesStats +type NodesStatsAdmissionControl struct { + GlobalCPUUsage struct { + Transport struct { + RejectionCount json.RawMessage `json:"rejection_count"` + } `json:"transport"` + } `json:"global_cpu_usage"` +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-usage-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-usage-params.go new file mode 100644 index 000000000..a1e2fd4f1 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-usage-params.go @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "time" +) + +// NodesUsageParams represents possible parameters for the NodesUsageReq +type NodesUsageParams struct { + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r NodesUsageParams) get() map[string]string { + params := make(map[string]string) + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-usage.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-usage.go new file mode 100644 index 000000000..4b5f392bd --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes-usage.go @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "encoding/json" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// NodesUsageReq represents possible options for the /_nodes request +type NodesUsageReq struct { + Metrics []string + NodeID []string + + Header http.Header + Params NodesUsageParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r NodesUsageReq) GetRequest() (*http.Request, error) { + nodes := strings.Join(r.NodeID, ",") + metrics := strings.Join(r.Metrics, ",") + + var path strings.Builder + + path.Grow(len("/_nodes//usage/") + len(nodes) + len(metrics)) + + path.WriteString("/_nodes") + if len(r.NodeID) > 0 { + path.WriteString("/") + path.WriteString(nodes) + } + path.WriteString("/usage") + if len(r.Metrics) > 0 { + path.WriteString("/") + path.WriteString(metrics) + } + + return opensearch.BuildRequest( + "GET", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// NodesUsageResp represents the returned struct of the /_nodes response +type NodesUsageResp struct { + NodesUsage struct { + Total int `json:"total"` + Successful int `json:"successful"` + Failed int `json:"failed"` + } `json:"_nodes"` + ClusterName string `json:"cluster_name"` + Nodes map[string]NodesUsage `json:"nodes"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r NodesUsageResp) Inspect() Inspect { + return Inspect{Response: r.response} +} + +// NodesUsage is a sub type of NodesUsageResp containing stats about rest api actions +type NodesUsage struct { + Timestamp int64 `json:"timestamp"` + Since int64 `json:"since"` + RestActions map[string]int `json:"rest_actions"` + Aggregations json.RawMessage `json:"aggregations"` // Can contain unknow fields +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes.go new file mode 100644 index 000000000..b4f9c94ca --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_nodes.go @@ -0,0 +1,93 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" + + "github.com/opensearch-project/opensearch-go/v3" +) + +type nodesClient struct { + apiClient *Client +} + +// Stats executes a /_nodes/_stats request with the optional NodesStatsReq +func (c nodesClient) Stats(ctx context.Context, req *NodesStatsReq) (*NodesStatsResp, error) { + if req == nil { + req = &NodesStatsReq{} + } + + var ( + data NodesStatsResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Info executes a /_nodes request with the optional NodesInfoReq +func (c nodesClient) Info(ctx context.Context, req *NodesInfoReq) (*NodesInfoResp, error) { + if req == nil { + req = &NodesInfoReq{} + } + + var ( + data NodesInfoResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// HotThreads executes a /_nodes/hot_threads request with the optional NodesHotThreadsReq +func (c nodesClient) HotThreads(ctx context.Context, req *NodesHotThreadsReq) (*opensearch.Response, error) { + if req == nil { + req = &NodesHotThreadsReq{} + } + return c.apiClient.do(ctx, req, nil) +} + +// ReloadSecurity executes a /_nodes/reload_secure_settings request with the optional NodesReloadSecurityReq +func (c nodesClient) ReloadSecurity(ctx context.Context, req *NodesReloadSecurityReq) (*NodesReloadSecurityResp, error) { + if req == nil { + req = &NodesReloadSecurityReq{} + } + + var ( + data NodesReloadSecurityResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Usage executes a /_nodes/usage request with the optional NodesUsageReq +func (c nodesClient) Usage(ctx context.Context, req *NodesUsageReq) (*NodesUsageResp, error) { + if req == nil { + req = &NodesUsageReq{} + } + + var ( + data NodesUsageResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ping-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ping-params.go new file mode 100644 index 000000000..fd0e44f45 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ping-params.go @@ -0,0 +1,52 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +// PingParams represents possible parameters for the PingReq +type PingParams struct { + Pretty bool + Human bool + ErrorTrace bool +} + +func (r PingParams) get() map[string]string { + params := make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ping.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ping.go new file mode 100644 index 000000000..e9657d4d7 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_ping.go @@ -0,0 +1,40 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// Ping executes a / request with the optional PingReq +func (c Client) Ping(ctx context.Context, req *PingReq) (*opensearch.Response, error) { + if req == nil { + req = &PingReq{} + } + + return c.do(ctx, req, nil) +} + +// PingReq represents possible options for the / request +type PingReq struct { + Header http.Header + Params PingParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r PingReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "HEAD", + "/", + nil, + r.Params.get(), + r.Header, + ) +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_point_in_time-create-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_point_in_time-create-params.go new file mode 100644 index 000000000..2fc653fcd --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_point_in_time-create-params.go @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "time" +) + +// PointInTimeCreateParams represents possible parameters for the PointInTimeCreateReq +type PointInTimeCreateParams struct { + KeepAlive time.Duration + Preference string + Routing string + ExpandWildcards string + AllowPartialPitCreation bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r PointInTimeCreateParams) get() map[string]string { + params := make(map[string]string) + + if r.KeepAlive != 0 { + params["keep_alive"] = formatDuration(r.KeepAlive) + } + + if r.Preference != "" { + params["preference"] = r.Preference + } + + if r.Routing != "" { + params["routing"] = r.Routing + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if r.AllowPartialPitCreation { + params["allow_partial_pit_creation"] = "true" + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_point_in_time-create.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_point_in_time-create.go new file mode 100644 index 000000000..e0ebaefb4 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_point_in_time-create.go @@ -0,0 +1,61 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// PointInTimeCreateReq represents possible options for the index create request +type PointInTimeCreateReq struct { + Indices []string + + Header http.Header + Params PointInTimeCreateParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r PointInTimeCreateReq) GetRequest() (*http.Request, error) { + indices := strings.Join(r.Indices, ",") + + var path strings.Builder + path.Grow(len("//_search/point_in_time") + len(indices)) + if len(r.Indices) > 0 { + path.WriteString("/") + path.WriteString(indices) + } + path.WriteString("/_search/point_in_time") + + return opensearch.BuildRequest( + "POST", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// PointInTimeCreateResp represents the returned struct of the index create response +type PointInTimeCreateResp struct { + PitID string `json:"pit_id"` + Shards struct { + Total int `json:"total"` + Successful int `json:"successful"` + Skipped int `json:"skipped"` + Failed int `json:"failed"` + } `json:"_shards"` + CreationTime int64 `json:"creation_time"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r PointInTimeCreateResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_point_in_time-delete-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_point_in_time-delete-params.go new file mode 100644 index 000000000..2e7680a0c --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_point_in_time-delete-params.go @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +// PointInTimeDeleteParams represents possible parameters for the PointInTimeDeleteReq +type PointInTimeDeleteParams struct { + Pretty bool + Human bool + ErrorTrace bool +} + +func (r PointInTimeDeleteParams) get() map[string]string { + params := make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_point_in_time-delete.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_point_in_time-delete.go new file mode 100644 index 000000000..2e8ae47ff --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_point_in_time-delete.go @@ -0,0 +1,64 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "bytes" + "encoding/json" + "io" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// PointInTimeDeleteReq represents possible options for the index create request +type PointInTimeDeleteReq struct { + PitID []string + + Header http.Header + Params PointInTimeDeleteParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r PointInTimeDeleteReq) GetRequest() (*http.Request, error) { + var body io.Reader + if len(r.PitID) > 0 { + bodyStruct := PointInTimeDeleteRequestBody{PitID: r.PitID} + bodyJSON, err := json.Marshal(bodyStruct) + if err != nil { + return nil, err + } + body = bytes.NewBuffer(bodyJSON) + } + + return opensearch.BuildRequest( + "DELETE", + "/_search/point_in_time", + body, + r.Params.get(), + r.Header, + ) +} + +// PointInTimeDeleteRequestBody is used to from the delete request body +type PointInTimeDeleteRequestBody struct { + PitID []string `json:"pit_id"` +} + +// PointInTimeDeleteResp represents the returned struct of the index create response +type PointInTimeDeleteResp struct { + Pits []struct { + PitID string `json:"pit_id"` + Successful bool `json:"successful"` + } `json:"pits"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r PointInTimeDeleteResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_point_in_time-get-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_point_in_time-get-params.go new file mode 100644 index 000000000..4b4bfa3f8 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_point_in_time-get-params.go @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +// PointInTimeGetParams represents possible parameters for the PointInTimeGetReq +type PointInTimeGetParams struct { + Pretty bool + Human bool + ErrorTrace bool +} + +func (r PointInTimeGetParams) get() map[string]string { + params := make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_point_in_time-get.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_point_in_time-get.go new file mode 100644 index 000000000..91688065b --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_point_in_time-get.go @@ -0,0 +1,45 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// PointInTimeGetReq represents possible options for the index create request +type PointInTimeGetReq struct { + Header http.Header + Params PointInTimeGetParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r PointInTimeGetReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "GET", + "/_search/point_in_time/_all", + nil, + r.Params.get(), + r.Header, + ) +} + +// PointInTimeGetResp represents the returned struct of the index create response +type PointInTimeGetResp struct { + Pits []struct { + PitID string `json:"pit_id"` + CreationTime int `json:"creation_time"` + KeepAlive int64 `json:"keep_alive"` + } `json:"pits"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r PointInTimeGetResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_point_in_time.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_point_in_time.go new file mode 100644 index 000000000..bc1a80af7 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_point_in_time.go @@ -0,0 +1,58 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" +) + +type pointInTimeClient struct { + apiClient *Client +} + +// Create executes a creade pointInTime request with the required PointInTimeCreateReq +func (c pointInTimeClient) Create(ctx context.Context, req PointInTimeCreateReq) (*PointInTimeCreateResp, error) { + var ( + data PointInTimeCreateResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Delete executes a delete pointInTime request with the required PointInTimeDeleteReq +func (c pointInTimeClient) Delete(ctx context.Context, req PointInTimeDeleteReq) (*PointInTimeDeleteResp, error) { + var ( + data PointInTimeDeleteResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Get executes a get pointInTime request with the optional PointInTimeGetReq +func (c pointInTimeClient) Get(ctx context.Context, req *PointInTimeGetReq) (*PointInTimeGetResp, error) { + if req == nil { + req = &PointInTimeGetReq{} + } + + var ( + data PointInTimeGetResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_rank_eval-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_rank_eval-params.go new file mode 100644 index 000000000..5741b01f5 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_rank_eval-params.go @@ -0,0 +1,77 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" +) + +// RankEvalParams represents possible parameters for the RankEvalReq +type RankEvalParams struct { + AllowNoIndices *bool + ExpandWildcards string + IgnoreUnavailable *bool + SearchType string + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r RankEvalParams) get() map[string]string { + params := make(map[string]string) + + if r.AllowNoIndices != nil { + params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + + if r.SearchType != "" { + params["search_type"] = r.SearchType + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_rank_eval.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_rank_eval.go new file mode 100644 index 000000000..d89300566 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_rank_eval.go @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" + "encoding/json" + "io" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// RankEval executes a /_rank_eval request with the required RankEvalReq +func (c Client) RankEval(ctx context.Context, req RankEvalReq) (*RankEvalResp, error) { + var ( + data RankEvalResp + err error + ) + if data.response, err = c.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// RankEvalReq represents possible options for the /_rank_eval request +type RankEvalReq struct { + Indices []string + + Body io.Reader + + Header http.Header + Params RankEvalParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r RankEvalReq) GetRequest() (*http.Request, error) { + indices := strings.Join(r.Indices, ",") + var path strings.Builder + path.Grow(len("//_rank_eval") + len(indices)) + if len(r.Indices) > 0 { + path.WriteString("/") + path.WriteString(indices) + } + path.WriteString("/_rank_eval") + return opensearch.BuildRequest( + "GET", + path.String(), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// RankEvalResp represents the returned struct of the /_rank_eval response +type RankEvalResp struct { + MetricScore float64 `json:"metric_score"` + Details json.RawMessage `json:"details"` + Failures json.RawMessage `json:"failures"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r RankEvalResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_reindex-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_reindex-params.go new file mode 100644 index 000000000..177392d36 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_reindex-params.go @@ -0,0 +1,99 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "fmt" + "strconv" + "time" +) + +// ReindexParams represents possible parameters for the ReindexReq +type ReindexParams struct { + MaxDocs *int + Refresh *bool + RequestsPerSecond *int + Scroll time.Duration + Slices interface{} + Timeout time.Duration + WaitForActiveShards string + WaitForCompletion *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r ReindexParams) get() map[string]string { + params := make(map[string]string) + + if r.MaxDocs != nil { + params["max_docs"] = strconv.FormatInt(int64(*r.MaxDocs), 10) + } + + if r.Refresh != nil { + params["refresh"] = strconv.FormatBool(*r.Refresh) + } + + if r.RequestsPerSecond != nil { + params["requests_per_second"] = strconv.FormatInt(int64(*r.RequestsPerSecond), 10) + } + + if r.Scroll != 0 { + params["scroll"] = formatDuration(r.Scroll) + } + + if r.Slices != nil { + params["slices"] = fmt.Sprintf("%v", r.Slices) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.WaitForActiveShards != "" { + params["wait_for_active_shards"] = r.WaitForActiveShards + } + + if r.WaitForCompletion != nil { + params["wait_for_completion"] = strconv.FormatBool(*r.WaitForCompletion) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_reindex.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_reindex.go new file mode 100644 index 000000000..d2942bcea --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_reindex.go @@ -0,0 +1,76 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" + "encoding/json" + "io" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// Reindex executes a / request with the optional ReindexReq +func (c Client) Reindex(ctx context.Context, req ReindexReq) (*ReindexResp, error) { + var ( + data ReindexResp + err error + ) + if data.response, err = c.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// ReindexReq represents possible options for the / request +type ReindexReq struct { + Body io.Reader + + Header http.Header + Params ReindexParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r ReindexReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "POST", + "/_reindex", + r.Body, + r.Params.get(), + r.Header, + ) +} + +// ReindexResp represents the returned struct of the / response +type ReindexResp struct { + Took int `json:"took"` + TimedOut bool `json:"timed_out"` + Total int `json:"total"` + Updated int `json:"updated"` + Created int `json:"created"` + Deleted int `json:"deleted"` + Batches int `json:"batches"` + VersionConflicts int `json:"version_conflicts"` + Noops int `json:"noops"` + Retries struct { + Bulk int `json:"bulk"` + Search int `json:"search"` + } `json:"retries"` + ThrottledMillis int `json:"throttled_millis"` + RequestsPerSecond float64 `json:"requests_per_second"` + ThrottledUntilMillis int `json:"throttled_until_millis"` + Failures []json.RawMessage `json:"failures"` + Task string `json:"task"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r ReindexResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_reindex_rethrottle-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_reindex_rethrottle-params.go new file mode 100644 index 000000000..9f85e171c --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_reindex_rethrottle-params.go @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" +) + +// ReindexRethrottleParams represents possible parameters for the ReindexRethrottleReq +type ReindexRethrottleParams struct { + RequestsPerSecond *int + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r ReindexRethrottleParams) get() map[string]string { + params := make(map[string]string) + + if r.RequestsPerSecond != nil { + params["requests_per_second"] = strconv.FormatInt(int64(*r.RequestsPerSecond), 10) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_reindex_rethrottle.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_reindex_rethrottle.go new file mode 100644 index 000000000..64ac0bb61 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_reindex_rethrottle.go @@ -0,0 +1,116 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// ReindexRethrottle executes a / request with the optional ReindexRethrottleReq +func (c Client) ReindexRethrottle(ctx context.Context, req ReindexRethrottleReq) (*ReindexRethrottleResp, error) { + var ( + data ReindexRethrottleResp + err error + ) + if data.response, err = c.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// ReindexRethrottleReq represents possible options for the / request +type ReindexRethrottleReq struct { + TaskID string + + Header http.Header + Params ReindexRethrottleParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r ReindexRethrottleReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "POST", + fmt.Sprintf("/_reindex/%s/_rethrottle", r.TaskID), + nil, + r.Params.get(), + r.Header, + ) +} + +// ReindexRethrottleResp represents the returned struct of the / response +type ReindexRethrottleResp struct { + Nodes map[string]struct { + Name string `json:"name"` + TransportAddress string `json:"transport_address"` + Host string `json:"host"` + IP string `json:"ip"` + Roles []string `json:"roles"` + Attributes map[string]string `json:"attributes"` + Tasks map[string]struct { + Node string `json:"node"` + ID int `json:"id"` + Type string `json:"type"` + Action string `json:"action"` + Status struct { + Total int `json:"total"` + Updated int `json:"updated"` + Created int `json:"created"` + Deleted int `json:"deleted"` + Batches int `json:"batches"` + VersionConflicts int `json:"version_conflicts"` + Noops int `json:"noops"` + Retries struct { + Bulk int `json:"bulk"` + Search int `json:"search"` + } `json:"retries"` + ThrottledMillis int `json:"throttled_millis"` + RequestsPerSecond float64 `json:"requests_per_second"` + ThrottledUntilMillis int `json:"throttled_until_millis"` + } `json:"status"` + Description string `json:"description"` + StartTimeInMillis int64 `json:"start_time_in_millis"` + RunningTimeInNanos int `json:"running_time_in_nanos"` + Cancellable bool `json:"cancellable"` + Cancelled bool `json:"cancelled"` + Headers json.RawMessage `json:"headers"` + ResourceStats struct { + Average struct { + CPUTimeInNanos int `json:"cpu_time_in_nanos"` + MemoryInBytes int `json:"memory_in_bytes"` + } `json:"average"` + Total struct { + CPUTimeInNanos int `json:"cpu_time_in_nanos"` + MemoryInBytes int `json:"memory_in_bytes"` + } `json:"total"` + Min struct { + CPUTimeInNanos int `json:"cpu_time_in_nanos"` + MemoryInBytes int `json:"memory_in_bytes"` + } `json:"min"` + Max struct { + CPUTimeInNanos int `json:"cpu_time_in_nanos"` + MemoryInBytes int `json:"memory_in_bytes"` + } `json:"max"` + ThreadInfo struct { + ThreadExecutions int `json:"thread_executions"` + ActiveThreads int `json:"active_threads"` + } `json:"thread_info"` + } `json:"resource_stats"` + } `json:"tasks"` + } `json:"nodes"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r ReindexRethrottleResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_render_search_template-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_render_search_template-params.go new file mode 100644 index 000000000..b979ba5d1 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_render_search_template-params.go @@ -0,0 +1,52 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +// RenderSearchTemplateParams represents possible parameters for the RenderSearchTemplateReq +type RenderSearchTemplateParams struct { + Pretty bool + Human bool + ErrorTrace bool +} + +func (r RenderSearchTemplateParams) get() map[string]string { + params := make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_render_search_template.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_render_search_template.go new file mode 100644 index 000000000..80f439ea3 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_render_search_template.go @@ -0,0 +1,69 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" + "encoding/json" + "io" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// RenderSearchTemplate executes a /_render/template request with the required RenderSearchTemplateReq +func (c Client) RenderSearchTemplate(ctx context.Context, req RenderSearchTemplateReq) (*RenderSearchTemplateResp, error) { + var ( + data RenderSearchTemplateResp + err error + ) + if data.response, err = c.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// RenderSearchTemplateReq represents possible options for the /_render/template request +type RenderSearchTemplateReq struct { + TemplateID string + + Body io.Reader + + Header http.Header + Params RenderSearchTemplateParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r RenderSearchTemplateReq) GetRequest() (*http.Request, error) { + var path strings.Builder + path.Grow(len("//_render/template") + len(r.TemplateID)) + path.WriteString("/_render/template") + if len(r.TemplateID) > 0 { + path.WriteString("/") + path.WriteString(r.TemplateID) + } + return opensearch.BuildRequest( + "POST", + path.String(), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// RenderSearchTemplateResp represents the returned struct of the /_render/template response +type RenderSearchTemplateResp struct { + TemplateOutput json.RawMessage `json:"template_output"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r RenderSearchTemplateResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-context-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-context-params.go new file mode 100644 index 000000000..acaf417be --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-context-params.go @@ -0,0 +1,52 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +// ScriptContextParams represents possible parameters for the ScriptContextReq +type ScriptContextParams struct { + Pretty bool + Human bool + ErrorTrace bool +} + +func (r ScriptContextParams) get() map[string]string { + params := make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-context.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-context.go new file mode 100644 index 000000000..203a74e70 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-context.go @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// ScriptContextReq represents possible options for the delete script request +type ScriptContextReq struct { + Header http.Header + Params ScriptContextParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r ScriptContextReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "GET", + "/_script_context", + nil, + r.Params.get(), + r.Header, + ) +} + +// ScriptContextResp represents the returned struct of the delete script response +type ScriptContextResp struct { + Contexts []struct { + Name string `json:"name"` + Methods []struct { + Name string `json:"name"` + ReturnType string `json:"return_type"` + Params []struct { + Name string `json:"name"` + Type string `json:"type"` + } `json:"params"` + } `json:"methods"` + } `json:"contexts"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r ScriptContextResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-delete-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-delete-params.go new file mode 100644 index 000000000..b456780fb --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-delete-params.go @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "time" +) + +// ScriptDeleteParams represents possible parameters for the ScriptDeleteReq +type ScriptDeleteParams struct { + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r ScriptDeleteParams) get() map[string]string { + params := make(map[string]string) + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-delete.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-delete.go new file mode 100644 index 000000000..1e7edcd6a --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-delete.go @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// ScriptDeleteReq represents possible options for the delete script request +type ScriptDeleteReq struct { + ScriptID string + + Header http.Header + Params ScriptDeleteParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r ScriptDeleteReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "DELETE", + fmt.Sprintf("/_scripts/%s", r.ScriptID), + nil, + r.Params.get(), + r.Header, + ) +} + +// ScriptDeleteResp represents the returned struct of the delete script response +type ScriptDeleteResp struct { + Acknowledged bool `json:"acknowledged"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r ScriptDeleteResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-get-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-get-params.go new file mode 100644 index 000000000..1ec6ac2d0 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-get-params.go @@ -0,0 +1,67 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "time" +) + +// ScriptGetParams represents possible parameters for the ScriptGetReq +type ScriptGetParams struct { + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r ScriptGetParams) get() map[string]string { + params := make(map[string]string) + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-get.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-get.go new file mode 100644 index 000000000..f0a813f88 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-get.go @@ -0,0 +1,49 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// ScriptGetReq represents possible options for the get script request +type ScriptGetReq struct { + ScriptID string + + Header http.Header + Params ScriptGetParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r ScriptGetReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "GET", + fmt.Sprintf("/_scripts/%s", r.ScriptID), + nil, + r.Params.get(), + r.Header, + ) +} + +// ScriptGetResp represents the returned struct of the get script response +type ScriptGetResp struct { + ID string `json:"_id"` + Found bool `json:"found"` + Script struct { + Lang string `json:"lang"` + Source string `json:"source"` + } `json:"script"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r ScriptGetResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-language-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-language-params.go new file mode 100644 index 000000000..544a78fe6 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-language-params.go @@ -0,0 +1,52 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +// ScriptLanguageParams represents possible parameters for the ScriptLanguageReq +type ScriptLanguageParams struct { + Pretty bool + Human bool + ErrorTrace bool +} + +func (r ScriptLanguageParams) get() map[string]string { + params := make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-language.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-language.go new file mode 100644 index 000000000..df46b3b52 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-language.go @@ -0,0 +1,45 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// ScriptLanguageReq represents possible options for the delete script request +type ScriptLanguageReq struct { + Header http.Header + Params ScriptLanguageParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r ScriptLanguageReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "GET", + "/_script_language", + nil, + r.Params.get(), + r.Header, + ) +} + +// ScriptLanguageResp represents the returned struct of the delete script response +type ScriptLanguageResp struct { + TypesAllowed []string `json:"types_allowed"` + LanguageContexts []struct { + Language string `json:"language"` + Contexts []string `json:"contexts"` + } `json:"language_contexts"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r ScriptLanguageResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-painless_execute-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-painless_execute-params.go new file mode 100644 index 000000000..44c2c7b51 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-painless_execute-params.go @@ -0,0 +1,52 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +// ScriptPainlessExecuteParams represents possible parameters for the ScriptPainlessExecuteReq +type ScriptPainlessExecuteParams struct { + Pretty bool + Human bool + ErrorTrace bool +} + +func (r ScriptPainlessExecuteParams) get() map[string]string { + params := make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-painless_execute.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-painless_execute.go new file mode 100644 index 000000000..861605942 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-painless_execute.go @@ -0,0 +1,45 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "encoding/json" + "io" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// ScriptPainlessExecuteReq represents possible options for the delete script request +type ScriptPainlessExecuteReq struct { + Body io.Reader + + Header http.Header + Params ScriptPainlessExecuteParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r ScriptPainlessExecuteReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "POST", + "/_scripts/painless/_execute", + r.Body, + r.Params.get(), + r.Header, + ) +} + +// ScriptPainlessExecuteResp represents the returned struct of the delete script response +type ScriptPainlessExecuteResp struct { + Result json.RawMessage `json:"result"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r ScriptPainlessExecuteResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-put-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-put-params.go new file mode 100644 index 000000000..abebbaefc --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-put-params.go @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "time" +) + +// ScriptPutParams represents possible parameters for the ScriptPutReq +type ScriptPutParams struct { + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r ScriptPutParams) get() map[string]string { + params := make(map[string]string) + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-put.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-put.go new file mode 100644 index 000000000..70a1ebbe4 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script-put.go @@ -0,0 +1,57 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "io" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// ScriptPutReq represents possible options for the put script request +type ScriptPutReq struct { + ScriptID string + ScriptContext string + + Body io.Reader + + Header http.Header + Params ScriptPutParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r ScriptPutReq) GetRequest() (*http.Request, error) { + var path strings.Builder + path.Grow(len("/_scripts//") + len(r.ScriptID) + len(r.ScriptContext)) + path.WriteString("/_scripts/") + path.WriteString(r.ScriptID) + if r.ScriptContext != "" { + path.WriteString("/") + path.WriteString(r.ScriptContext) + } + + return opensearch.BuildRequest( + "PUT", + path.String(), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// ScriptPutResp represents the returned struct of the put script response +type ScriptPutResp struct { + Acknowledged bool `json:"acknowledged"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r ScriptPutResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script.go new file mode 100644 index 000000000..2e3e0b60f --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_script.go @@ -0,0 +1,101 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" +) + +type scriptClient struct { + apiClient *Client +} + +// Delete executes a delete script request with the required ScriptDeleteReq +func (c scriptClient) Delete(ctx context.Context, req ScriptDeleteReq) (*ScriptDeleteResp, error) { + var ( + data ScriptDeleteResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Put executes an put script request with the required ScriptPutReq +func (c scriptClient) Put(ctx context.Context, req ScriptPutReq) (*ScriptPutResp, error) { + var ( + data ScriptPutResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Get executes a /_script request with the required ScriptGetReq +func (c scriptClient) Get(ctx context.Context, req ScriptGetReq) (*ScriptGetResp, error) { + var ( + data ScriptGetResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Context executes a /_script_context request with the optional ScriptContextReq +func (c scriptClient) Context(ctx context.Context, req *ScriptContextReq) (*ScriptContextResp, error) { + if req == nil { + req = &ScriptContextReq{} + } + + var ( + data ScriptContextResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Language executes a /_script_context request with the optional ScriptLanguageReq +func (c scriptClient) Language(ctx context.Context, req *ScriptLanguageReq) (*ScriptLanguageResp, error) { + if req == nil { + req = &ScriptLanguageReq{} + } + + var ( + data ScriptLanguageResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// PainlessExecute executes a /_script request with the required ScriptPainlessExecuteReq +func (c scriptClient) PainlessExecute(ctx context.Context, req ScriptPainlessExecuteReq) (*ScriptPainlessExecuteResp, error) { + var ( + data ScriptPainlessExecuteResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_scroll-delete-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_scroll-delete-params.go new file mode 100644 index 000000000..573d39d95 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_scroll-delete-params.go @@ -0,0 +1,52 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +// ScrollDeleteParams represents possible parameters for the ScrollDeleteReq +type ScrollDeleteParams struct { + Pretty bool + Human bool + ErrorTrace bool +} + +func (r ScrollDeleteParams) get() map[string]string { + params := make(map[string]string) + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_scroll-delete.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_scroll-delete.go new file mode 100644 index 000000000..e341aa069 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_scroll-delete.go @@ -0,0 +1,56 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "io" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// ScrollDeleteReq represents possible options for the index create request +type ScrollDeleteReq struct { + ScrollIDs []string + + Body io.Reader + + Header http.Header + Params ScrollDeleteParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r ScrollDeleteReq) GetRequest() (*http.Request, error) { + scrolls := strings.Join(r.ScrollIDs, ",") + var path strings.Builder + path.Grow(len("/_search/scroll/") + len(scrolls)) + path.WriteString("/_search/scroll") + if len(r.ScrollIDs) > 0 { + path.WriteString("/") + path.WriteString(scrolls) + } + return opensearch.BuildRequest( + "DELETE", + path.String(), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// ScrollDeleteResp represents the returned struct of the index create response +type ScrollDeleteResp struct { + NumFreed int `json:"num_freed"` + Succeeded bool `json:"succeeded"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r ScrollDeleteResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_scroll-get-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_scroll-get-params.go new file mode 100644 index 000000000..003b44922 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_scroll-get-params.go @@ -0,0 +1,73 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// ScrollGetParams represents possible parameters for the ScrollGetReq +type ScrollGetParams struct { + RestTotalHitsAsInt *bool + Scroll time.Duration + ScrollID string + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r ScrollGetParams) get() map[string]string { + params := make(map[string]string) + + if r.RestTotalHitsAsInt != nil { + params["rest_total_hits_as_int"] = strconv.FormatBool(*r.RestTotalHitsAsInt) + } + + if r.Scroll != 0 { + params["scroll"] = formatDuration(r.Scroll) + } + + if r.ScrollID != "" { + params["scroll_id"] = r.ScrollID + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_scroll-get.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_scroll-get.go new file mode 100644 index 000000000..d173ec679 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_scroll-get.go @@ -0,0 +1,57 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// ScrollGetReq represents possible options for the index create request +type ScrollGetReq struct { + ScrollID string + + Header http.Header + Params ScrollGetParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r ScrollGetReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "POST", + "/_search/scroll", + strings.NewReader(fmt.Sprintf(`{"scroll_id":"%s"}`, r.ScrollID)), + r.Params.get(), + r.Header, + ) +} + +// ScrollGetResp represents the returned struct of the index create response +type ScrollGetResp struct { + Took int `json:"took"` + Timeout bool `json:"timed_out"` + Shards ResponseShards `json:"_shards"` + Hits struct { + Total struct { + Value int `json:"value"` + Relation string `json:"relation"` + } `json:"total"` + MaxScore float32 `json:"max_score"` + Hits []SearchHit `json:"hits"` + } `json:"hits"` + ScrollID *string `json:"_scroll_id,omitempty"` + TerminatedEarly bool `json:"terminated_early"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r ScrollGetResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_scroll.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_scroll.go new file mode 100644 index 000000000..f8c4ef17c --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_scroll.go @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" +) + +type scrollClient struct { + apiClient *Client +} + +// Delete executes a delete scroll request with the required ScrollDeleteReq +func (c scrollClient) Delete(ctx context.Context, req ScrollDeleteReq) (*ScrollDeleteResp, error) { + var ( + data ScrollDeleteResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Get executes a get scroll request with the required ScrollGetReq +func (c scrollClient) Get(ctx context.Context, req ScrollGetReq) (*ScrollGetResp, error) { + var ( + data ScrollGetResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_search-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_search-params.go new file mode 100644 index 000000000..3dcff95f0 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_search-params.go @@ -0,0 +1,284 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "fmt" + "strconv" + "strings" + "time" +) + +// SearchParams represents possible parameters for the SearchReq +type SearchParams struct { + AllowNoIndices *bool + AllowPartialSearchResults *bool + Analyzer string + AnalyzeWildcard *bool + BatchedReduceSize *int + CcsMinimizeRoundtrips *bool + DefaultOperator string + Df string + DocvalueFields []string + ExpandWildcards string + Explain *bool + From *int + IgnoreThrottled *bool + IgnoreUnavailable *bool + Lenient *bool + MaxConcurrentShardRequests *int + MinCompatibleShardNode string + Preference string + PreFilterShardSize *int + Query string + RequestCache *bool + RestTotalHitsAsInt *bool + Routing []string + Scroll time.Duration + SearchType string + SeqNoPrimaryTerm *bool + Size *int + Sort []string + Source interface{} + SourceExcludes []string + SourceIncludes []string + Stats []string + StoredFields []string + SuggestField string + SuggestMode string + SuggestSize *int + SuggestText string + TerminateAfter *int + Timeout time.Duration + TrackScores *bool + TrackTotalHits interface{} + TypedKeys *bool + Version *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r SearchParams) get() map[string]string { + params := make(map[string]string) + + if r.AllowNoIndices != nil { + params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) + } + + if r.AllowPartialSearchResults != nil { + params["allow_partial_search_results"] = strconv.FormatBool(*r.AllowPartialSearchResults) + } + + if r.Analyzer != "" { + params["analyzer"] = r.Analyzer + } + + if r.AnalyzeWildcard != nil { + params["analyze_wildcard"] = strconv.FormatBool(*r.AnalyzeWildcard) + } + + if r.BatchedReduceSize != nil { + params["batched_reduce_size"] = strconv.FormatInt(int64(*r.BatchedReduceSize), 10) + } + + if r.CcsMinimizeRoundtrips != nil { + params["ccs_minimize_roundtrips"] = strconv.FormatBool(*r.CcsMinimizeRoundtrips) + } + + if r.DefaultOperator != "" { + params["default_operator"] = r.DefaultOperator + } + + if r.Df != "" { + params["df"] = r.Df + } + + if len(r.DocvalueFields) > 0 { + params["docvalue_fields"] = strings.Join(r.DocvalueFields, ",") + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if r.Explain != nil { + params["explain"] = strconv.FormatBool(*r.Explain) + } + + if r.From != nil { + params["from"] = strconv.FormatInt(int64(*r.From), 10) + } + + if r.IgnoreThrottled != nil { + params["ignore_throttled"] = strconv.FormatBool(*r.IgnoreThrottled) + } + + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + + if r.Lenient != nil { + params["lenient"] = strconv.FormatBool(*r.Lenient) + } + + if r.MaxConcurrentShardRequests != nil { + params["max_concurrent_shard_requests"] = strconv.FormatInt(int64(*r.MaxConcurrentShardRequests), 10) + } + + if r.MinCompatibleShardNode != "" { + params["min_compatible_shard_node"] = r.MinCompatibleShardNode + } + + if r.Preference != "" { + params["preference"] = r.Preference + } + + if r.PreFilterShardSize != nil { + params["pre_filter_shard_size"] = strconv.FormatInt(int64(*r.PreFilterShardSize), 10) + } + + if r.Query != "" { + params["q"] = r.Query + } + + if r.RequestCache != nil { + params["request_cache"] = strconv.FormatBool(*r.RequestCache) + } + + if r.RestTotalHitsAsInt != nil { + params["rest_total_hits_as_int"] = strconv.FormatBool(*r.RestTotalHitsAsInt) + } + + if len(r.Routing) > 0 { + params["routing"] = strings.Join(r.Routing, ",") + } + + if r.Scroll != 0 { + params["scroll"] = formatDuration(r.Scroll) + } + + if r.SearchType != "" { + params["search_type"] = r.SearchType + } + + if r.SeqNoPrimaryTerm != nil { + params["seq_no_primary_term"] = strconv.FormatBool(*r.SeqNoPrimaryTerm) + } + + if r.Size != nil { + params["size"] = strconv.FormatInt(int64(*r.Size), 10) + } + + if len(r.Sort) > 0 { + params["sort"] = strings.Join(r.Sort, ",") + } + + switch source := r.Source.(type) { + case bool: + params["_source"] = strconv.FormatBool(source) + case string: + if source != "" { + params["_source"] = source + } + case []string: + if len(source) > 0 { + params["_source"] = strings.Join(source, ",") + } + } + + if len(r.SourceExcludes) > 0 { + params["_source_excludes"] = strings.Join(r.SourceExcludes, ",") + } + + if len(r.SourceIncludes) > 0 { + params["_source_includes"] = strings.Join(r.SourceIncludes, ",") + } + + if len(r.Stats) > 0 { + params["stats"] = strings.Join(r.Stats, ",") + } + + if len(r.StoredFields) > 0 { + params["stored_fields"] = strings.Join(r.StoredFields, ",") + } + + if r.SuggestField != "" { + params["suggest_field"] = r.SuggestField + } + + if r.SuggestMode != "" { + params["suggest_mode"] = r.SuggestMode + } + + if r.SuggestSize != nil { + params["suggest_size"] = strconv.FormatInt(int64(*r.SuggestSize), 10) + } + + if r.SuggestText != "" { + params["suggest_text"] = r.SuggestText + } + + if r.TerminateAfter != nil { + params["terminate_after"] = strconv.FormatInt(int64(*r.TerminateAfter), 10) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.TrackScores != nil { + params["track_scores"] = strconv.FormatBool(*r.TrackScores) + } + + if r.TrackTotalHits != nil { + params["track_total_hits"] = fmt.Sprintf("%v", r.TrackTotalHits) + } + + if r.TypedKeys != nil { + params["typed_keys"] = strconv.FormatBool(*r.TypedKeys) + } + + if r.Version != nil { + params["version"] = strconv.FormatBool(*r.Version) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_search-template-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_search-template-params.go new file mode 100644 index 000000000..6e28be0c8 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_search-template-params.go @@ -0,0 +1,124 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" + "time" +) + +// SearchTemplateParams represents possible parameters for the SearchTemplateReq +type SearchTemplateParams struct { + AllowNoIndices *bool + CcsMinimizeRoundtrips *bool + ExpandWildcards string + Explain *bool + IgnoreThrottled *bool + IgnoreUnavailable *bool + Preference string + Profile *bool + RestTotalHitsAsInt *bool + Routing []string + Scroll time.Duration + SearchType string + TypedKeys *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r SearchTemplateParams) get() map[string]string { + params := make(map[string]string) + + if r.AllowNoIndices != nil { + params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) + } + + if r.CcsMinimizeRoundtrips != nil { + params["ccs_minimize_roundtrips"] = strconv.FormatBool(*r.CcsMinimizeRoundtrips) + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if r.Explain != nil { + params["explain"] = strconv.FormatBool(*r.Explain) + } + + if r.IgnoreThrottled != nil { + params["ignore_throttled"] = strconv.FormatBool(*r.IgnoreThrottled) + } + + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + + if r.Preference != "" { + params["preference"] = r.Preference + } + + if r.Profile != nil { + params["profile"] = strconv.FormatBool(*r.Profile) + } + + if r.RestTotalHitsAsInt != nil { + params["rest_total_hits_as_int"] = strconv.FormatBool(*r.RestTotalHitsAsInt) + } + + if len(r.Routing) > 0 { + params["routing"] = strings.Join(r.Routing, ",") + } + + if r.Scroll != 0 { + params["scroll"] = formatDuration(r.Scroll) + } + + if r.SearchType != "" { + params["search_type"] = r.SearchType + } + + if r.TypedKeys != nil { + params["typed_keys"] = strconv.FormatBool(*r.TypedKeys) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_search-template.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_search-template.go new file mode 100644 index 000000000..e93ca9c0f --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_search-template.go @@ -0,0 +1,79 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" + "io" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// SearchTemplate executes a /_search request with the optional SearchTemplateReq +func (c Client) SearchTemplate(ctx context.Context, req SearchTemplateReq) (*SearchTemplateResp, error) { + var ( + data SearchTemplateResp + err error + ) + if data.response, err = c.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// SearchTemplateReq represents possible options for the /_search request +type SearchTemplateReq struct { + Indices []string + + Body io.Reader + + Header http.Header + Params SearchTemplateParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r SearchTemplateReq) GetRequest() (*http.Request, error) { + indices := strings.Join(r.Indices, ",") + var path strings.Builder + path.Grow(len("//_search/template") + len(indices)) + if len(r.Indices) > 0 { + path.WriteString("/") + path.WriteString(indices) + } + path.WriteString("/_search/template") + return opensearch.BuildRequest( + "POST", + path.String(), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// SearchTemplateResp represents the returned struct of the /_search response +type SearchTemplateResp struct { + Took int `json:"took"` + Timeout bool `json:"timed_out"` + Shards ResponseShards `json:"_shards"` + Hits struct { + Total struct { + Value int `json:"value"` + Relation string `json:"relation"` + } `json:"total"` + MaxScore *float32 `json:"max_score"` + Hits []SearchHit `json:"hits"` + } `json:"hits"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r SearchTemplateResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_search.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_search.go new file mode 100644 index 000000000..46e1213f9 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_search.go @@ -0,0 +1,96 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" + "encoding/json" + "fmt" + "io" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// Search executes a /_search request with the optional SearchReq +func (c Client) Search(ctx context.Context, req *SearchReq) (*SearchResp, error) { + if req == nil { + req = &SearchReq{} + } + + var ( + data SearchResp + err error + ) + if data.response, err = c.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// SearchReq represents possible options for the /_search request +type SearchReq struct { + Indices []string + Body io.Reader + + Header http.Header + Params SearchParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r SearchReq) GetRequest() (*http.Request, error) { + var path string + if len(r.Indices) > 0 { + path = fmt.Sprintf("/%s/_search", strings.Join(r.Indices, ",")) + } else { + path = "_search" + } + + return opensearch.BuildRequest( + "POST", + path, + r.Body, + r.Params.get(), + r.Header, + ) +} + +// SearchResp represents the returned struct of the /_search response +type SearchResp struct { + Took int `json:"took"` + Timeout bool `json:"timed_out"` + Shards ResponseShards `json:"_shards"` + Hits struct { + Total struct { + Value int `json:"value"` + Relation string `json:"relation"` + } `json:"total"` + MaxScore float32 `json:"max_score"` + Hits []SearchHit `json:"hits"` + } `json:"hits"` + Errors bool `json:"errors"` + Aggregations json.RawMessage `json:"aggregations"` + ScrollID *string `json:"_scroll_id,omitempty"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r SearchResp) Inspect() Inspect { + return Inspect{Response: r.response} +} + +// SearchHit is a sub type of SearchResp containing information of the search hit with an unparsed Source field +type SearchHit struct { + Index string `json:"_index"` + ID string `json:"_id"` + Score float32 `json:"_score"` + Source json.RawMessage `json:"_source"` + Type string `json:"_type"` // Deprecated field + Sort []any `json:"sort"` +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_search_shards-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_search_shards-params.go new file mode 100644 index 000000000..c63ecadac --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_search_shards-params.go @@ -0,0 +1,87 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" +) + +// SearchShardsParams represents possible parameters for the SearchShardsReq +type SearchShardsParams struct { + AllowNoIndices *bool + ExpandWildcards string + IgnoreUnavailable *bool + Local *bool + Preference string + Routing string + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r SearchShardsParams) get() map[string]string { + params := make(map[string]string) + + if r.AllowNoIndices != nil { + params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if r.Preference != "" { + params["preference"] = r.Preference + } + + if r.Routing != "" { + params["routing"] = r.Routing + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_search_shards.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_search_shards.go new file mode 100644 index 000000000..2832514a7 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_search_shards.go @@ -0,0 +1,99 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" + "encoding/json" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// SearchShards executes a /_search request with the optional SearchShardsReq +func (c Client) SearchShards(ctx context.Context, req *SearchShardsReq) (*SearchShardsResp, error) { + if req == nil { + req = &SearchShardsReq{} + } + + var ( + data SearchShardsResp + err error + ) + if data.response, err = c.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// SearchShardsReq represents possible options for the /_search request +type SearchShardsReq struct { + Indices []string + + Header http.Header + Params SearchShardsParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r SearchShardsReq) GetRequest() (*http.Request, error) { + indices := strings.Join(r.Indices, ",") + var path strings.Builder + path.Grow(len("//_search_shards") + len(indices)) + if len(r.Indices) > 0 { + path.WriteString("/") + path.WriteString(indices) + } + path.WriteString("/_search_shards") + + return opensearch.BuildRequest( + "POST", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// SearchShardsResp represents the returned struct of the /_search response +type SearchShardsResp struct { + Nodes map[string]struct { + Name string `json:"name"` + EphemeralID string `json:"ephemeral_id"` + TransportAddress string `json:"transport_address"` + Attributes map[string]string `json:"attributes"` + } `json:"nodes"` + Indices map[string]json.RawMessage `json:"indices"` + Shards [][]struct { + State string `json:"state"` + Primary bool `json:"primary"` + Node string `json:"node"` + RelocatingNode *string `json:"relocating_node"` + Shard int `json:"shard"` + Index string `json:"index"` + ExpectedShardSizeInBytes int `json:"expected_shard_size_in_bytes"` + RecoverySource struct { + Type string `json:"type"` + } `json:"recovery_source"` + UnassignedInfo struct { + Reason string `json:"reason"` + At string `json:"at"` + Delayed bool `json:"delayed"` + AllocationStatus string `json:"allocation_status"` + } `json:"unassigned_info"` + AllocationID struct { + ID string `json:"id"` + } `json:"allocation_id"` + } `json:"shards"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r SearchShardsResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-clone-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-clone-params.go new file mode 100644 index 000000000..3e67f9bb2 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-clone-params.go @@ -0,0 +1,66 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "time" +) + +// SnapshotCloneParams represents possible parameters for the SnapshotCloneReq +type SnapshotCloneParams struct { + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r SnapshotCloneParams) get() map[string]string { + params := make(map[string]string) + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-clone.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-clone.go new file mode 100644 index 000000000..19226647c --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-clone.go @@ -0,0 +1,49 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "io" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// SnapshotCloneReq represents possible options for the index create request +type SnapshotCloneReq struct { + Repo string + Snapshot string + TargetSnapshot string + + Body io.Reader + + Header http.Header + Params SnapshotCloneParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r SnapshotCloneReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "PUT", + fmt.Sprintf("/_snapshot/%s/%s/_clone/%s", r.Repo, r.Snapshot, r.TargetSnapshot), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// SnapshotCloneResp represents the returned struct of the index create response +type SnapshotCloneResp struct { + Acknowledged bool `json:"acknowledged"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r SnapshotCloneResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-create-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-create-params.go new file mode 100644 index 000000000..9ae6386c0 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-create-params.go @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// SnapshotCreateParams represents possible parameters for the SnapshotCreateReq +type SnapshotCreateParams struct { + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + WaitForCompletion *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r SnapshotCreateParams) get() map[string]string { + params := make(map[string]string) + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.WaitForCompletion != nil { + params["wait_for_completion"] = strconv.FormatBool(*r.WaitForCompletion) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-create.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-create.go new file mode 100644 index 000000000..921cdea80 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-create.go @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "encoding/json" + "fmt" + "io" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// SnapshotCreateReq represents possible options for the index create request +type SnapshotCreateReq struct { + Repo string + Snapshot string + + Body io.Reader + + Header http.Header + Params SnapshotCreateParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r SnapshotCreateReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "PUT", + fmt.Sprintf("/_snapshot/%s/%s", r.Repo, r.Snapshot), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// SnapshotCreateResp represents the returned struct of the index create response +type SnapshotCreateResp struct { + Accepted bool `json:"accepted"` + Snapshot struct { + Snapshot string `json:"snapshot"` + UUID string `json:"uuid"` + VersionID int `json:"version_id"` + Version string `json:"version"` + RemoteStoreIndexShallowCopy bool `json:"remote_store_index_shallow_copy"` + Indices []string `json:"indices"` + DataStreams []json.RawMessage `json:"data_streams"` + IncludeGlobalState bool `json:"include_global_state"` + Metadata map[string]string `json:"metadata"` + State string `json:"state"` + StartTime string `json:"start_time"` + StartTimeInMillis int64 `json:"start_time_in_millis"` + EndTime string `json:"end_time"` + EndTimeInMillis int64 `json:"end_time_in_millis"` + DurationInMillis int `json:"duration_in_millis"` + Failures []json.RawMessage `json:"failures"` + Shards struct { + Total int `json:"total"` + Failed int `json:"failed"` + Successful int `json:"successful"` + } `json:"shards"` + } `json:"snapshot"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r SnapshotCreateResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-delete-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-delete-params.go new file mode 100644 index 000000000..93fdecebb --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-delete-params.go @@ -0,0 +1,67 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "time" +) + +// SnapshotDeleteParams represents possible parameters for the SnapshotDeleteReq +type SnapshotDeleteParams struct { + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r SnapshotDeleteParams) get() map[string]string { + params := make(map[string]string) + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-delete.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-delete.go new file mode 100644 index 000000000..142c1e54e --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-delete.go @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// SnapshotDeleteReq represents possible options for the index create request +type SnapshotDeleteReq struct { + Repo string + Snapshots []string + + Header http.Header + Params SnapshotDeleteParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r SnapshotDeleteReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "DELETE", + fmt.Sprintf("/_snapshot/%s/%s", r.Repo, strings.Join(r.Snapshots, ",")), + nil, + r.Params.get(), + r.Header, + ) +} + +// SnapshotDeleteResp represents the returned struct of the index create response +type SnapshotDeleteResp struct { + Acknowledged bool `json:"acknowledged"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r SnapshotDeleteResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-get-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-get-params.go new file mode 100644 index 000000000..9a2205dbc --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-get-params.go @@ -0,0 +1,87 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// SnapshotGetParams represents possible parameters for the SnapshotGetReq +type SnapshotGetParams struct { + IgnoreUnavailable *bool + IncludeRepository *bool + IndexDetails *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Verbose *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r SnapshotGetParams) get() map[string]string { + params := make(map[string]string) + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + + if r.IncludeRepository != nil { + params["include_repository"] = strconv.FormatBool(*r.IncludeRepository) + } + + if r.IndexDetails != nil { + params["index_details"] = strconv.FormatBool(*r.IndexDetails) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Verbose != nil { + params["verbose"] = strconv.FormatBool(*r.Verbose) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-get.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-get.go new file mode 100644 index 000000000..5b37bea00 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-get.go @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "encoding/json" + "fmt" + "io" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// SnapshotGetReq represents possible options for the index create request +type SnapshotGetReq struct { + Repo string + Snapshots []string + + Body io.Reader + + Header http.Header + Params SnapshotGetParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r SnapshotGetReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "GET", + fmt.Sprintf("/_snapshot/%s/%s", r.Repo, strings.Join(r.Snapshots, ",")), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// SnapshotGetResp represents the returned struct of the index create response +type SnapshotGetResp struct { + Snapshots []struct { + Snapshot string `json:"snapshot"` + UUID string `json:"uuid"` + VersionID int `json:"version_id"` + Version string `json:"version"` + RemoteStoreIndexShallowCopy bool `json:"remote_store_index_shallow_copy"` + Indices []string `json:"indices"` + DataStreams []json.RawMessage `json:"data_streams"` + IncludeGlobalState bool `json:"include_global_state"` + Metadata map[string]string `json:"metadata"` + State string `json:"state"` + StartTime string `json:"start_time"` + StartTimeInMillis int64 `json:"start_time_in_millis"` + EndTime string `json:"end_time"` + EndTimeInMillis int64 `json:"end_time_in_millis"` + DurationInMillis int `json:"duration_in_millis"` + Failures []json.RawMessage `json:"failures"` + Shards struct { + Total int `json:"total"` + Failed int `json:"failed"` + Successful int `json:"successful"` + } `json:"shards"` + } `json:"snapshots"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r SnapshotGetResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-restore-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-restore-params.go new file mode 100644 index 000000000..b03ae1a16 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-restore-params.go @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// SnapshotRestoreParams represents possible parameters for the SnapshotRestoreReq +type SnapshotRestoreParams struct { + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + WaitForCompletion *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r SnapshotRestoreParams) get() map[string]string { + params := make(map[string]string) + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.WaitForCompletion != nil { + params["wait_for_completion"] = strconv.FormatBool(*r.WaitForCompletion) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-restore.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-restore.go new file mode 100644 index 000000000..ae97dc0eb --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-restore.go @@ -0,0 +1,57 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "io" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// SnapshotRestoreReq represents possible options for the index create request +type SnapshotRestoreReq struct { + Repo string + Snapshot string + + Body io.Reader + + Header http.Header + Params SnapshotRestoreParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r SnapshotRestoreReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "POST", + fmt.Sprintf("/_snapshot/%s/%s/_restore", r.Repo, r.Snapshot), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// SnapshotRestoreResp represents the returned struct of the index create response +type SnapshotRestoreResp struct { + Accepted bool `json:"accepted"` + Snapshot struct { + Snapshot string `json:"snapshot"` + Indices []string `json:"indices"` + Shards struct { + Total int `json:"total"` + Failed int `json:"failed"` + Successful int `json:"successful"` + } `json:"shards"` + } `json:"snapshot"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r SnapshotRestoreResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-status-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-status-params.go new file mode 100644 index 000000000..bf5457c52 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-status-params.go @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// SnapshotStatusParams represents possible parameters for the SnapshotStatusReq +type SnapshotStatusParams struct { + IgnoreUnavailable *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r SnapshotStatusParams) get() map[string]string { + params := make(map[string]string) + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-status.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-status.go new file mode 100644 index 000000000..390744624 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot-status.go @@ -0,0 +1,87 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// SnapshotStatusReq represents possible options for the index create request +type SnapshotStatusReq struct { + Repo string + Snapshots []string + + Header http.Header + Params SnapshotStatusParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r SnapshotStatusReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "GET", + fmt.Sprintf("/_snapshot/%s/%s/_status", r.Repo, strings.Join(r.Snapshots, ",")), + nil, + r.Params.get(), + r.Header, + ) +} + +// SnapshotStatusResp represents the returned struct of the index create response +type SnapshotStatusResp struct { + Accepted bool `json:"accepted"` + Snapshots []struct { + Snapshot string `json:"snapshot"` + Repository string `json:"repository"` + UUID string `json:"uuid"` + State string `json:"state"` + IncludeGlobalState bool `json:"include_global_state"` + ShardsStats SnapshotStatusShardsStats `json:"shards_stats"` + Stats SnapshotStatusStats `json:"stats"` + Indices map[string]struct { + ShardsStats SnapshotStatusShardsStats `json:"shards_stats"` + Stats SnapshotStatusStats `json:"stats"` + Shards map[string]struct { + Stage string `json:"stage"` + Stats SnapshotStatusStats `json:"stats"` + } `json:"shards"` + } `json:"indices"` + } `json:"snapshots"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r SnapshotStatusResp) Inspect() Inspect { + return Inspect{Response: r.response} +} + +// SnapshotStatusShardsStats is a sub type of SnapshotStatusResp containing information about shard stats +type SnapshotStatusShardsStats struct { + Initializing int `json:"initializing"` + Started int `json:"started"` + Finalizing int `json:"finalizing"` + Done int `json:"done"` + Failed int `json:"failed"` + Total int `json:"total"` +} + +// SnapshotStatusStats is a sub type of SnapshotStatusResp containing information about snapshot stats +type SnapshotStatusStats struct { + Incremental struct { + FileCount int `json:"file_count"` + SizeInBytes int64 `json:"size_in_bytes"` + } `json:"incremental"` + Total struct { + FileCount int `json:"file_count"` + SizeInBytes int64 `json:"size_in_bytes"` + } `json:"total"` + StartTimeInMillis int64 `json:"start_time_in_millis"` + TimeInMillis int `json:"time_in_millis"` +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot.go new file mode 100644 index 000000000..9fa754828 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot.go @@ -0,0 +1,92 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import "context" + +type snapshotClient struct { + apiClient *Client + Repository repositoryClient +} + +// Create executes a creade snapshot request with the required SnapshotCreateReq +func (c snapshotClient) Create(ctx context.Context, req SnapshotCreateReq) (*SnapshotCreateResp, error) { + var ( + data SnapshotCreateResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Delete executes a delete snapshot request with the required SnapshotDeleteReq +func (c snapshotClient) Delete(ctx context.Context, req SnapshotDeleteReq) (*SnapshotDeleteResp, error) { + var ( + data SnapshotDeleteResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Get executes a get snapshot request with the required SnapshotGetReq +func (c snapshotClient) Get(ctx context.Context, req SnapshotGetReq) (*SnapshotGetResp, error) { + var ( + data SnapshotGetResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Clone executes a snapshot clone request with the required SnapshotCloneReq +func (c snapshotClient) Clone(ctx context.Context, req SnapshotCloneReq) (*SnapshotCloneResp, error) { + var ( + data SnapshotCloneResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Restore executes a snapshot restore request with the required SnapshotRestoreReq +func (c snapshotClient) Restore(ctx context.Context, req SnapshotRestoreReq) (*SnapshotRestoreResp, error) { + var ( + data SnapshotRestoreResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Status executes a snapshot status request with the required SnapshotStatusReq +func (c snapshotClient) Status(ctx context.Context, req SnapshotStatusReq) (*SnapshotStatusResp, error) { + var ( + data SnapshotStatusResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-cleanup-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-cleanup-params.go new file mode 100644 index 000000000..9b3b8ea7f --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-cleanup-params.go @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "time" +) + +// SnapshotRepositoryCleanupParams represents possible parameters for the SnapshotRepositoryCleanupReq +type SnapshotRepositoryCleanupParams struct { + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r SnapshotRepositoryCleanupParams) get() map[string]string { + params := make(map[string]string) + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-cleanup.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-cleanup.go new file mode 100644 index 000000000..399beb009 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-cleanup.go @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// SnapshotRepositoryCleanupReq represents possible options for the index create request +type SnapshotRepositoryCleanupReq struct { + Repo string + + Header http.Header + Params SnapshotRepositoryCleanupParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r SnapshotRepositoryCleanupReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "POST", + fmt.Sprintf("/_snapshot/%s/_cleanup", r.Repo), + nil, + r.Params.get(), + r.Header, + ) +} + +// SnapshotRepositoryCleanupResp represents the returned struct of the index create response +type SnapshotRepositoryCleanupResp struct { + Results struct { + DeletedBytes int `json:"deleted_bytes"` + DeletedBlobs int `json:"deleted_blobs"` + } `json:"results"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r SnapshotRepositoryCleanupResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-create-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-create-params.go new file mode 100644 index 000000000..b9945f4c9 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-create-params.go @@ -0,0 +1,77 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// SnapshotRepositoryCreateParams represents possible parameters for the SnapshotRepositoryCreateReq +type SnapshotRepositoryCreateParams struct { + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + Verify *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r SnapshotRepositoryCreateParams) get() map[string]string { + params := make(map[string]string) + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Verify != nil { + params["verify"] = strconv.FormatBool(*r.Verify) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-create.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-create.go new file mode 100644 index 000000000..8fc739a65 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-create.go @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "io" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// SnapshotRepositoryCreateReq represents possible options for the index create request +type SnapshotRepositoryCreateReq struct { + Repo string + + Body io.Reader + + Header http.Header + Params SnapshotRepositoryCreateParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r SnapshotRepositoryCreateReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "PUT", + fmt.Sprintf("/_snapshot/%s", r.Repo), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// SnapshotRepositoryCreateResp represents the returned struct of the index create response +type SnapshotRepositoryCreateResp struct { + Acknowledged bool `json:"acknowledged"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r SnapshotRepositoryCreateResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-delete-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-delete-params.go new file mode 100644 index 000000000..ed821942a --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-delete-params.go @@ -0,0 +1,71 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "time" +) + +// SnapshotRepositoryDeleteParams represents possible parameters for the SnapshotRepositoryDeleteReq +type SnapshotRepositoryDeleteParams struct { + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r SnapshotRepositoryDeleteParams) get() map[string]string { + params := make(map[string]string) + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-delete.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-delete.go new file mode 100644 index 000000000..bfd522a77 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-delete.go @@ -0,0 +1,54 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// SnapshotRepositoryDeleteReq represents possible options for the index create request +type SnapshotRepositoryDeleteReq struct { + Repos []string + + Header http.Header + Params SnapshotRepositoryDeleteParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r SnapshotRepositoryDeleteReq) GetRequest() (*http.Request, error) { + repos := strings.Join(r.Repos, ",") + + var path strings.Builder + path.Grow(len("/_snapshot/") + len(repos)) + path.WriteString("/_snapshot") + if len(r.Repos) > 0 { + path.WriteString("/") + path.WriteString(repos) + } + + return opensearch.BuildRequest( + "DELETE", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// SnapshotRepositoryDeleteResp represents the returned struct of the index create response +type SnapshotRepositoryDeleteResp struct { + Acknowledged bool `json:"acknowledged"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r SnapshotRepositoryDeleteResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-get-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-get-params.go new file mode 100644 index 000000000..a1865e39f --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-get-params.go @@ -0,0 +1,73 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// SnapshotRepositoryGetParams represents possible parameters for the SnapshotRepositoryGetReq +type SnapshotRepositoryGetParams struct { + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r SnapshotRepositoryGetParams) get() map[string]string { + params := make(map[string]string) + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-get.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-get.go new file mode 100644 index 000000000..b1027c22e --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-get.go @@ -0,0 +1,57 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// SnapshotRepositoryGetReq represents possible options for the index create request +type SnapshotRepositoryGetReq struct { + Repos []string + + Header http.Header + Params SnapshotRepositoryGetParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r SnapshotRepositoryGetReq) GetRequest() (*http.Request, error) { + repos := strings.Join(r.Repos, ",") + + var path strings.Builder + path.Grow(len("/_snapshot/") + len(repos)) + path.WriteString("/_snapshot") + if len(r.Repos) > 0 { + path.WriteString("/") + path.WriteString(repos) + } + + return opensearch.BuildRequest( + "GET", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// SnapshotRepositoryGetResp represents the returned struct of the index create response +type SnapshotRepositoryGetResp struct { + Repos map[string]struct { + Type string `json:"type"` + Settings map[string]string `json:"settings"` + } + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r SnapshotRepositoryGetResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-verify-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-verify-params.go new file mode 100644 index 000000000..e6a9d1956 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-verify-params.go @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "time" +) + +// SnapshotRepositoryVerifyParams represents possible parameters for the SnapshotRepositoryVerifyReq +type SnapshotRepositoryVerifyParams struct { + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r SnapshotRepositoryVerifyParams) get() map[string]string { + params := make(map[string]string) + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-verify.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-verify.go new file mode 100644 index 000000000..4ca7e1910 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository-verify.go @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// SnapshotRepositoryVerifyReq represents possible options for the index create request +type SnapshotRepositoryVerifyReq struct { + Repo string + + Header http.Header + Params SnapshotRepositoryVerifyParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r SnapshotRepositoryVerifyReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "POST", + fmt.Sprintf("/_snapshot/%s/_verify", r.Repo), + nil, + r.Params.get(), + r.Header, + ) +} + +// SnapshotRepositoryVerifyResp represents the returned struct of the index create response +type SnapshotRepositoryVerifyResp struct { + Nodes map[string]struct { + Name string `json:"name"` + } `json:"nodes"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r SnapshotRepositoryVerifyResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository.go new file mode 100644 index 000000000..9bd139a9c --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_snapshot_repository.go @@ -0,0 +1,83 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" +) + +type repositoryClient struct { + apiClient *Client +} + +// Create executes a put repository request with the required SnapshotRepositoryCreateReq +func (c repositoryClient) Create(ctx context.Context, req SnapshotRepositoryCreateReq) (*SnapshotRepositoryCreateResp, error) { + var ( + data SnapshotRepositoryCreateResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Delete executes a delete repository request with the required SnapshotRepositoryDeleteReq +func (c repositoryClient) Delete(ctx context.Context, req SnapshotRepositoryDeleteReq) (*SnapshotRepositoryDeleteResp, error) { + var ( + data SnapshotRepositoryDeleteResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Get executes a get repository request with the optional SnapshotRepositoryGetReq +func (c repositoryClient) Get(ctx context.Context, req *SnapshotRepositoryGetReq) (*SnapshotRepositoryGetResp, error) { + if req == nil { + req = &SnapshotRepositoryGetReq{} + } + var ( + data SnapshotRepositoryGetResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data.Repos); err != nil { + return &data, err + } + + return &data, nil +} + +// Cleanup executes a cleanup repository request with the required SnapshotRepositoryCleanupReq +func (c repositoryClient) Cleanup(ctx context.Context, req SnapshotRepositoryCleanupReq) (*SnapshotRepositoryCleanupResp, error) { + var ( + data SnapshotRepositoryCleanupResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Verify executes a verify repository request with the required SnapshotRepositoryVerifyReq +func (c repositoryClient) Verify(ctx context.Context, req SnapshotRepositoryVerifyReq) (*SnapshotRepositoryVerifyResp, error) { + var ( + data SnapshotRepositoryVerifyResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_tasks-cancel-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_tasks-cancel-params.go new file mode 100644 index 000000000..c113649ab --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_tasks-cancel-params.go @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" +) + +// TasksCancelParams represents possible parameters for the TasksCancelReq +type TasksCancelParams struct { + Actions []string + Nodes []string + ParentTaskID string + WaitForCompletion *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r TasksCancelParams) get() map[string]string { + params := make(map[string]string) + + if len(r.Actions) > 0 { + params["actions"] = strings.Join(r.Actions, ",") + } + + if len(r.Nodes) > 0 { + params["nodes"] = strings.Join(r.Nodes, ",") + } + + if r.ParentTaskID != "" { + params["parent_task_id"] = r.ParentTaskID + } + + if r.WaitForCompletion != nil { + params["wait_for_completion"] = strconv.FormatBool(*r.WaitForCompletion) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_tasks-cancel.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_tasks-cancel.go new file mode 100644 index 000000000..7809315f5 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_tasks-cancel.go @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "encoding/json" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// TasksCancelReq represents possible options for the index create request +type TasksCancelReq struct { + TaskID string + + Header http.Header + Params TasksCancelParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r TasksCancelReq) GetRequest() (*http.Request, error) { + var path strings.Builder + path.Grow(len("/_tasks//_cancel") + len(r.TaskID)) + path.WriteString("/_tasks") + if r.TaskID != "" { + path.WriteString("/") + path.WriteString(r.TaskID) + } + path.WriteString("/_cancel") + return opensearch.BuildRequest( + "POST", + path.String(), + nil, + r.Params.get(), + r.Header, + ) +} + +// TasksCancelResp represents the returned struct of the index create response +type TasksCancelResp struct { + Nodes map[string]TaskCancel `json:"nodes"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r TasksCancelResp) Inspect() Inspect { + return Inspect{Response: r.response} +} + +// TaskCancel is a sub type of TaskCancelResp containing information about a node the task was running on +type TaskCancel struct { + Name string `json:"name"` + TransportAddress string `json:"transport_address"` + Host string `json:"host"` + IP string `json:"ip"` + Roles []string `json:"roles"` + Attributes map[string]string `json:"attributes"` + Tasks map[string]TaskCancelInfo `json:"tasks"` +} + +// TaskCancelInfo is a sub type of TaskCancle containing information about the canceled task +type TaskCancelInfo struct { + Node string `json:"node"` + ID int `json:"id"` + Type string `json:"type"` + Action string `json:"action"` + StartTimeInMillis int64 `json:"start_time_in_millis"` + RunningTimeInNanos int `json:"running_time_in_nanos"` + CancellationTimeMillis int64 `json:"cancellation_time_millis"` + Cancellable bool `json:"cancellable"` + Cancelled bool `json:"cancelled"` + Headers json.RawMessage `json:"headers"` +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_tasks-get-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_tasks-get-params.go new file mode 100644 index 000000000..d420928d1 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_tasks-get-params.go @@ -0,0 +1,68 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// TasksGetParams represents possible parameters for the TasksGetReq +type TasksGetParams struct { + Timeout time.Duration + WaitForCompletion *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r TasksGetParams) get() map[string]string { + params := make(map[string]string) + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.WaitForCompletion != nil { + params["wait_for_completion"] = strconv.FormatBool(*r.WaitForCompletion) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_tasks-get.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_tasks-get.go new file mode 100644 index 000000000..e4a0eb002 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_tasks-get.go @@ -0,0 +1,89 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "encoding/json" + "fmt" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// TasksGetReq represents possible options for the index create request +type TasksGetReq struct { + TaskID string + + Header http.Header + Params TasksGetParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r TasksGetReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "GET", + fmt.Sprintf("/_tasks/%s", r.TaskID), + nil, + r.Params.get(), + r.Header, + ) +} + +// TasksGetResp represents the returned struct of the index create response +type TasksGetResp struct { + Completed bool `json:"completed"` + Task struct { + Node string `json:"node"` + ID int `json:"id"` + Type string `json:"type"` + Action string `json:"action"` + Description string `json:"description"` + StartTimeInMillis int64 `json:"start_time_in_millis"` + RunningTimeInNanos int64 `json:"running_time_in_nanos"` + Cancellable bool `json:"cancellable"` + Cancelled bool `json:"cancelled"` + Headers json.RawMessage `json:"headers"` + ResourceStats struct { + Average struct { + CPUTimeInNanos int `json:"cpu_time_in_nanos"` + MemoryInBytes int `json:"memory_in_bytes"` + } `json:"average"` + Total struct { + CPUTimeInNanos int `json:"cpu_time_in_nanos"` + MemoryInBytes int `json:"memory_in_bytes"` + } `json:"total"` + Min struct { + CPUTimeInNanos int `json:"cpu_time_in_nanos"` + MemoryInBytes int `json:"memory_in_bytes"` + } `json:"min"` + Max struct { + CPUTimeInNanos int `json:"cpu_time_in_nanos"` + MemoryInBytes int `json:"memory_in_bytes"` + } `json:"max"` + ThreadInfo struct { + ThreadExecutions int `json:"thread_executions"` + ActiveThreads int `json:"active_threads"` + } `json:"thread_info"` + } `json:"resource_stats"` + } `json:"task"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r TasksGetResp) Inspect() Inspect { + return Inspect{Response: r.response} +} + +// TasksGetDetails is a sub type of TasksGetResp containing information about an index template +type TasksGetDetails struct { + Order int64 `json:"order"` + Version int64 `json:"version"` + IndexPatterns []string `json:"index_patterns"` + Mappings json.RawMessage `json:"mappings"` + Settings json.RawMessage `json:"settings"` + Aliases json.RawMessage `json:"aliases"` +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_tasks-list-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_tasks-list-params.go new file mode 100644 index 000000000..f0dfd6c03 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_tasks-list-params.go @@ -0,0 +1,94 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" + "time" +) + +// TasksListParams represents possible parameters for the TasksListReq +type TasksListParams struct { + Actions []string + Detailed *bool + GroupBy string + Nodes []string + ParentTaskID string + Timeout time.Duration + WaitForCompletion *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r TasksListParams) get() map[string]string { + params := make(map[string]string) + + if len(r.Actions) > 0 { + params["actions"] = strings.Join(r.Actions, ",") + } + + if r.Detailed != nil { + params["detailed"] = strconv.FormatBool(*r.Detailed) + } + + if r.GroupBy != "" { + params["group_by"] = r.GroupBy + } + + if len(r.Nodes) > 0 { + params["nodes"] = strings.Join(r.Nodes, ",") + } + + if r.ParentTaskID != "" { + params["parent_task_id"] = r.ParentTaskID + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.WaitForCompletion != nil { + params["wait_for_completion"] = strconv.FormatBool(*r.WaitForCompletion) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_tasks-list.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_tasks-list.go new file mode 100644 index 000000000..7d3ecaf7c --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_tasks-list.go @@ -0,0 +1,94 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// TasksListReq represents possible options for the index create request +type TasksListReq struct { + Header http.Header + Params TasksListParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r TasksListReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "GET", + "/_tasks", + nil, + r.Params.get(), + r.Header, + ) +} + +// TasksListResp represents the returned struct of the index create response +type TasksListResp struct { + Nodes map[string]TasksListNodes `json:"nodes"` + Tasks map[string]TasksListTask `json:"tasks"` // tasks is returned when group_by is set to none or parents + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r TasksListResp) Inspect() Inspect { + return Inspect{Response: r.response} +} + +// TasksListNodes is a sub type of TaskListResp containing information about a node and the tasks running on it +type TasksListNodes struct { + Name string `json:"name"` + TransportAddress string `json:"transport_address"` + Host string `json:"host"` + IP string `json:"ip"` + Roles []string `json:"roles"` + Attributes map[string]string `json:"attributes"` + Tasks map[string]TasksListTask `json:"tasks"` +} + +// TasksListTask is a sub type of TaskListResp, TaskListNodes containing information about a task +type TasksListTask struct { + Node string `json:"node"` + ID int `json:"id"` + Type string `json:"type"` + Action string `json:"action"` + Description string `json:"description"` + StartTimeInMillis int64 `json:"start_time_in_millis"` + RunningTimeInNanos int64 `json:"running_time_in_nanos"` + Cancellable bool `json:"cancellable"` + Cancelled bool `json:"cancelled"` + Headers map[string]string `json:"headers"` + ResourceStats TasksListResourceStats `json:"resource_stats"` + ParentTaskID string `json:"parent_task_id"` + Children []TasksListTask `json:"children,omitempty"` +} + +// TasksListResourceStats is a sub type of TaskListTask containing information about task stats +type TasksListResourceStats struct { + Average struct { + CPUTimeInNanos int `json:"cpu_time_in_nanos"` + MemoryInBytes int `json:"memory_in_bytes"` + } `json:"average"` + Total struct { + CPUTimeInNanos int `json:"cpu_time_in_nanos"` + MemoryInBytes int `json:"memory_in_bytes"` + } `json:"total"` + Min struct { + CPUTimeInNanos int `json:"cpu_time_in_nanos"` + MemoryInBytes int `json:"memory_in_bytes"` + } `json:"min"` + Max struct { + CPUTimeInNanos int `json:"cpu_time_in_nanos"` + MemoryInBytes int `json:"memory_in_bytes"` + } `json:"max"` + ThreadInfo struct { + ThreadExecutions int `json:"thread_executions"` + ActiveThreads int `json:"active_threads"` + } `json:"thread_info"` +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_tasks.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_tasks.go new file mode 100644 index 000000000..bd31696f9 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_tasks.go @@ -0,0 +1,58 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" +) + +type tasksClient struct { + apiClient *Client +} + +// Cancel executes a delete tasks request with the required TasksCancelReq +func (c tasksClient) Cancel(ctx context.Context, req TasksCancelReq) (*TasksCancelResp, error) { + var ( + data TasksCancelResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// List executes a get tasks request with the optional TasksListReq +func (c tasksClient) List(ctx context.Context, req *TasksListReq) (*TasksListResp, error) { + if req == nil { + req = &TasksListReq{} + } + + var ( + data TasksListResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Get executes a get tasks request with the optional TasksGetReq +func (c tasksClient) Get(ctx context.Context, req TasksGetReq) (*TasksGetResp, error) { + var ( + data TasksGetResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template-create-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template-create-params.go new file mode 100644 index 000000000..c9f063838 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template-create-params.go @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// TemplateCreateParams represents possible parameters for the TemplateCreateReq +type TemplateCreateParams struct { + Create *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Order *int + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r TemplateCreateParams) get() map[string]string { + params := make(map[string]string) + + if r.Create != nil { + params["create"] = strconv.FormatBool(*r.Create) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Order != nil { + params["order"] = strconv.FormatInt(int64(*r.Order), 10) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template-create.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template-create.go new file mode 100644 index 000000000..db971f21f --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template-create.go @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "io" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// TemplateCreateReq represents possible options for the index create request +type TemplateCreateReq struct { + Template string + + Body io.Reader + + Header http.Header + Params TemplateCreateParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r TemplateCreateReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "PUT", + fmt.Sprintf("/_template/%s", r.Template), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// TemplateCreateResp represents the returned struct of the index create response +type TemplateCreateResp struct { + Acknowledged bool `json:"acknowledged"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r TemplateCreateResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template-delete-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template-delete-params.go new file mode 100644 index 000000000..72a899e27 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template-delete-params.go @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "time" +) + +// TemplateDeleteParams represents possible parameters for the TemplateDeleteReq +type TemplateDeleteParams struct { + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + Timeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r TemplateDeleteParams) get() map[string]string { + params := make(map[string]string) + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template-delete.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template-delete.go new file mode 100644 index 000000000..ee82b0fd2 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template-delete.go @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// TemplateDeleteReq represents possible options for the index create request +type TemplateDeleteReq struct { + Template string + + Header http.Header + Params TemplateDeleteParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r TemplateDeleteReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "DELETE", + fmt.Sprintf("/_template/%s", r.Template), + nil, + r.Params.get(), + r.Header, + ) +} + +// TemplateDeleteResp represents the returned struct of the index create response +type TemplateDeleteResp struct { + Acknowledged bool `json:"acknowledged"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r TemplateDeleteResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template-exists-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template-exists-params.go new file mode 100644 index 000000000..00d566b21 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template-exists-params.go @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// TemplateExistsParams represents possible parameters for the TemplateExistsReq +type TemplateExistsParams struct { + FlatSettings *bool + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r TemplateExistsParams) get() map[string]string { + params := make(map[string]string) + + if r.FlatSettings != nil { + params["flat_settings"] = strconv.FormatBool(*r.FlatSettings) + } + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template-exists.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template-exists.go new file mode 100644 index 000000000..201b1463b --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template-exists.go @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "fmt" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// TemplateExistsReq represents possible options for the index create request +type TemplateExistsReq struct { + Template string + + Header http.Header + Params TemplateExistsParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r TemplateExistsReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "HEAD", + fmt.Sprintf("/_template/%s", r.Template), + nil, + r.Params.get(), + r.Header, + ) +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template-get-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template-get-params.go new file mode 100644 index 000000000..ec30a245f --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template-get-params.go @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "time" +) + +// TemplateGetParams represents possible parameters for the TemplateGetReq +type TemplateGetParams struct { + FlatSettings *bool + Local *bool + MasterTimeout time.Duration + ClusterManagerTimeout time.Duration + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r TemplateGetParams) get() map[string]string { + params := make(map[string]string) + + if r.FlatSettings != nil { + params["flat_settings"] = strconv.FormatBool(*r.FlatSettings) + } + + if r.Local != nil { + params["local"] = strconv.FormatBool(*r.Local) + } + + if r.MasterTimeout != 0 { + params["master_timeout"] = formatDuration(r.MasterTimeout) + } + + if r.ClusterManagerTimeout != 0 { + params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template-get.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template-get.go new file mode 100644 index 000000000..fb8e157ea --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template-get.go @@ -0,0 +1,56 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "encoding/json" + "fmt" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// TemplateGetReq represents possible options for the index create request +type TemplateGetReq struct { + Templates []string + + Header http.Header + Params TemplateGetParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r TemplateGetReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "GET", + fmt.Sprintf("/_template/%s", strings.Join(r.Templates, ",")), + nil, + r.Params.get(), + r.Header, + ) +} + +// TemplateGetResp represents the returned struct of the index create response +type TemplateGetResp struct { + Templates map[string]TemplateGetDetails + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r TemplateGetResp) Inspect() Inspect { + return Inspect{Response: r.response} +} + +// TemplateGetDetails is a sub type of TemplateGetResp containing information about an index template +type TemplateGetDetails struct { + Order int64 `json:"order"` + Version int64 `json:"version"` + IndexPatterns []string `json:"index_patterns"` + Mappings json.RawMessage `json:"mappings"` + Settings json.RawMessage `json:"settings"` + Aliases json.RawMessage `json:"aliases"` +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template.go new file mode 100644 index 000000000..799c2bf0c --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_template.go @@ -0,0 +1,69 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" + + "github.com/opensearch-project/opensearch-go/v3" +) + +type templateClient struct { + apiClient *Client +} + +// Create executes a creade template request with the required TemplateCreateReq +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndexTemplate.Create instread +func (c templateClient) Create(ctx context.Context, req TemplateCreateReq) (*TemplateCreateResp, error) { + var ( + data TemplateCreateResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Delete executes a delete template request with the required TemplateDeleteReq +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndexTemplate.Delete instread +func (c templateClient) Delete(ctx context.Context, req TemplateDeleteReq) (*TemplateDeleteResp, error) { + var ( + data TemplateDeleteResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// Get executes a get template request with the optional TemplateGetReq +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndexTemplate.Get instread +func (c templateClient) Get(ctx context.Context, req *TemplateGetReq) (*TemplateGetResp, error) { + if req == nil { + req = &TemplateGetReq{} + } + + var ( + data TemplateGetResp + err error + ) + if data.response, err = c.apiClient.do(ctx, req, &data.Templates); err != nil { + return &data, err + } + + return &data, nil +} + +// Exists executes a exists template request with the required TemplatExistsReq +// Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndexTemplate.Exists instread +func (c templateClient) Exists(ctx context.Context, req TemplateExistsReq) (*opensearch.Response, error) { + return c.apiClient.do(ctx, req, nil) +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_termvectors-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_termvectors-params.go new file mode 100644 index 000000000..2a253b64e --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_termvectors-params.go @@ -0,0 +1,113 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" +) + +// TermvectorsParams represents possible parameters for the TermvectorsReq +type TermvectorsParams struct { + Fields []string + FieldStatistics *bool + Offsets *bool + Payloads *bool + Positions *bool + Preference string + Realtime *bool + Routing string + TermStatistics *bool + Version *int + VersionType string + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r TermvectorsParams) get() map[string]string { + params := make(map[string]string) + + if len(r.Fields) > 0 { + params["fields"] = strings.Join(r.Fields, ",") + } + + if r.FieldStatistics != nil { + params["field_statistics"] = strconv.FormatBool(*r.FieldStatistics) + } + + if r.Offsets != nil { + params["offsets"] = strconv.FormatBool(*r.Offsets) + } + + if r.Payloads != nil { + params["payloads"] = strconv.FormatBool(*r.Payloads) + } + + if r.Positions != nil { + params["positions"] = strconv.FormatBool(*r.Positions) + } + + if r.Preference != "" { + params["preference"] = r.Preference + } + + if r.Realtime != nil { + params["realtime"] = strconv.FormatBool(*r.Realtime) + } + + if r.Routing != "" { + params["routing"] = r.Routing + } + + if r.TermStatistics != nil { + params["term_statistics"] = strconv.FormatBool(*r.TermStatistics) + } + + if r.Version != nil { + params["version"] = strconv.FormatInt(int64(*r.Version), 10) + } + + if r.VersionType != "" { + params["version_type"] = r.VersionType + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_termvectors.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_termvectors.go new file mode 100644 index 000000000..37bc1202c --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_termvectors.go @@ -0,0 +1,80 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" + "encoding/json" + "io" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// Termvectors executes a /_termvectors request with the required TermvectorsReq +func (c Client) Termvectors(ctx context.Context, req TermvectorsReq) (*TermvectorsResp, error) { + var ( + data TermvectorsResp + err error + ) + if data.response, err = c.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// TermvectorsReq represents possible options for the /_termvectors request +type TermvectorsReq struct { + Index string + DocumentID string + + Body io.Reader + + Header http.Header + Params TermvectorsParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r TermvectorsReq) GetRequest() (*http.Request, error) { + var path strings.Builder + path.Grow(len("//_termvectors/") + len(r.Index) + len(r.DocumentID)) + if len(r.Index) > 0 { + path.WriteString("/") + path.WriteString(r.Index) + } + path.WriteString("/_termvectors") + if len(r.DocumentID) > 0 { + path.WriteString("/") + path.WriteString(r.DocumentID) + } + return opensearch.BuildRequest( + "POST", + path.String(), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// TermvectorsResp represents the returned struct of the /_termvectors response +type TermvectorsResp struct { + Index string `json:"_index"` + ID string `json:"_id"` + Version int `json:"_version"` + Found bool `json:"found"` + Took int `json:"took"` + Type string `json:"_type"` // Deprecated field + TermVectors json.RawMessage `json:"term_vectors"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r TermvectorsResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_update-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_update-params.go new file mode 100644 index 000000000..069e93198 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_update-params.go @@ -0,0 +1,123 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" + "strings" + "time" +) + +// UpdateParams represents possible parameters for the UpdateReq +type UpdateParams struct { + IfPrimaryTerm *int + IfSeqNo *int + Lang string + Refresh string + RequireAlias *bool + RetryOnConflict *int + Routing string + Source interface{} + SourceExcludes []string + SourceIncludes []string + Timeout time.Duration + WaitForActiveShards string + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r UpdateParams) get() map[string]string { + params := make(map[string]string) + + if r.IfPrimaryTerm != nil { + params["if_primary_term"] = strconv.FormatInt(int64(*r.IfPrimaryTerm), 10) + } + + if r.IfSeqNo != nil { + params["if_seq_no"] = strconv.FormatInt(int64(*r.IfSeqNo), 10) + } + + if r.Lang != "" { + params["lang"] = r.Lang + } + + if r.Refresh != "" { + params["refresh"] = r.Refresh + } + + if r.RequireAlias != nil { + params["require_alias"] = strconv.FormatBool(*r.RequireAlias) + } + + if r.RetryOnConflict != nil { + params["retry_on_conflict"] = strconv.FormatInt(int64(*r.RetryOnConflict), 10) + } + + if r.Routing != "" { + params["routing"] = r.Routing + } + + if source, ok := r.Source.(bool); ok { + params["_source"] = strconv.FormatBool(source) + } else if source, ok := r.Source.(string); ok && source != "" { + params["_source"] = source + } else if sources, ok := r.Source.([]string); ok && len(sources) > 0 { + params["_source"] = strings.Join(sources, ",") + } + + if len(r.SourceExcludes) > 0 { + params["_source_excludes"] = strings.Join(r.SourceExcludes, ",") + } + + if len(r.SourceIncludes) > 0 { + params["_source_includes"] = strings.Join(r.SourceIncludes, ",") + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.WaitForActiveShards != "" { + params["wait_for_active_shards"] = r.WaitForActiveShards + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_update.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_update.go new file mode 100644 index 000000000..f0c87b278 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_update.go @@ -0,0 +1,73 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" + "fmt" + "io" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// Update executes a /_update request with the optional UpdateReq +func (c Client) Update(ctx context.Context, req UpdateReq) (*UpdateResp, error) { + var ( + data UpdateResp + err error + ) + if data.response, err = c.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// UpdateReq represents possible options for the /_update request +type UpdateReq struct { + Index string + DocumentID string + + Body io.Reader + + Header http.Header + Params UpdateParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r UpdateReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "POST", + fmt.Sprintf("/%s/_update/%s", r.Index, r.DocumentID), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// UpdateResp represents the returned struct of the /_update response +type UpdateResp struct { + Index string `json:"_index"` + ID string `json:"_id"` + Version int `json:"_version"` + Result string `json:"result"` + Shards struct { + Total int `json:"total"` + Successful int `json:"successful"` + Failed int `json:"failed"` + } `json:"_shards"` + SeqNo int `json:"_seq_no"` + PrimaryTerm int `json:"_primary_term"` + Type string `json:"_type"` // Deprecated field + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r UpdateResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_update_by_query-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_update_by_query-params.go new file mode 100644 index 000000000..365bc4bd2 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_update_by_query-params.go @@ -0,0 +1,239 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "fmt" + "strconv" + "strings" + "time" +) + +// UpdateByQueryParams represents possible parameters for the UpdateByQueryReq +type UpdateByQueryParams struct { + AllowNoIndices *bool + Analyzer string + AnalyzeWildcard *bool + Conflicts string + DefaultOperator string + Df string + ExpandWildcards string + From *int + IgnoreUnavailable *bool + Lenient *bool + MaxDocs *int + Pipeline string + Preference string + Query string + Refresh *bool + RequestCache *bool + RequestsPerSecond *int + Routing []string + Scroll time.Duration + ScrollSize *int + SearchTimeout time.Duration + SearchType string + Size *int + Slices interface{} + Sort []string + Source interface{} + SourceExcludes []string + SourceIncludes []string + Stats []string + TerminateAfter *int + Timeout time.Duration + Version *bool + VersionType *bool + WaitForActiveShards string + WaitForCompletion *bool + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r UpdateByQueryParams) get() map[string]string { + params := make(map[string]string) + + if r.AllowNoIndices != nil { + params["allow_no_indices"] = strconv.FormatBool(*r.AllowNoIndices) + } + + if r.Analyzer != "" { + params["analyzer"] = r.Analyzer + } + + if r.AnalyzeWildcard != nil { + params["analyze_wildcard"] = strconv.FormatBool(*r.AnalyzeWildcard) + } + + if r.Conflicts != "" { + params["conflicts"] = r.Conflicts + } + + if r.DefaultOperator != "" { + params["default_operator"] = r.DefaultOperator + } + + if r.Df != "" { + params["df"] = r.Df + } + + if r.ExpandWildcards != "" { + params["expand_wildcards"] = r.ExpandWildcards + } + + if r.From != nil { + params["from"] = strconv.FormatInt(int64(*r.From), 10) + } + + if r.IgnoreUnavailable != nil { + params["ignore_unavailable"] = strconv.FormatBool(*r.IgnoreUnavailable) + } + + if r.Lenient != nil { + params["lenient"] = strconv.FormatBool(*r.Lenient) + } + + if r.MaxDocs != nil { + params["max_docs"] = strconv.FormatInt(int64(*r.MaxDocs), 10) + } + + if r.Pipeline != "" { + params["pipeline"] = r.Pipeline + } + + if r.Preference != "" { + params["preference"] = r.Preference + } + + if r.Query != "" { + params["q"] = r.Query + } + + if r.Refresh != nil { + params["refresh"] = strconv.FormatBool(*r.Refresh) + } + + if r.RequestCache != nil { + params["request_cache"] = strconv.FormatBool(*r.RequestCache) + } + + if r.RequestsPerSecond != nil { + params["requests_per_second"] = strconv.FormatInt(int64(*r.RequestsPerSecond), 10) + } + + if len(r.Routing) > 0 { + params["routing"] = strings.Join(r.Routing, ",") + } + + if r.Scroll != 0 { + params["scroll"] = formatDuration(r.Scroll) + } + + if r.ScrollSize != nil { + params["scroll_size"] = strconv.FormatInt(int64(*r.ScrollSize), 10) + } + + if r.SearchTimeout != 0 { + params["search_timeout"] = formatDuration(r.SearchTimeout) + } + + if r.SearchType != "" { + params["search_type"] = r.SearchType + } + + if r.Size != nil { + params["size"] = strconv.FormatInt(int64(*r.Size), 10) + } + + if r.Slices != nil { + params["slices"] = fmt.Sprintf("%v", r.Slices) + } + + if len(r.Sort) > 0 { + params["sort"] = strings.Join(r.Sort, ",") + } + + if source, ok := r.Source.(bool); ok { + params["_source"] = strconv.FormatBool(source) + } else if source, ok := r.Source.(string); ok && source != "" { + params["_source"] = source + } else if sources, ok := r.Source.([]string); ok && len(sources) > 0 { + params["_source"] = strings.Join(sources, ",") + } + + if len(r.SourceExcludes) > 0 { + params["_source_excludes"] = strings.Join(r.SourceExcludes, ",") + } + + if len(r.SourceIncludes) > 0 { + params["_source_includes"] = strings.Join(r.SourceIncludes, ",") + } + + if len(r.Stats) > 0 { + params["stats"] = strings.Join(r.Stats, ",") + } + + if r.TerminateAfter != nil { + params["terminate_after"] = strconv.FormatInt(int64(*r.TerminateAfter), 10) + } + + if r.Timeout != 0 { + params["timeout"] = formatDuration(r.Timeout) + } + + if r.Version != nil { + params["version"] = strconv.FormatBool(*r.Version) + } + + if r.VersionType != nil { + params["version_type"] = strconv.FormatBool(*r.VersionType) + } + + if r.WaitForActiveShards != "" { + params["wait_for_active_shards"] = r.WaitForActiveShards + } + + if r.WaitForCompletion != nil { + params["wait_for_completion"] = strconv.FormatBool(*r.WaitForCompletion) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_update_by_query.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_update_by_query.go new file mode 100644 index 000000000..2627a6b8d --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_update_by_query.go @@ -0,0 +1,80 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" + "encoding/json" + "fmt" + "io" + "net/http" + "strings" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// UpdateByQuery executes a /_update_by_query request with the optional UpdateByQueryReq +func (c Client) UpdateByQuery(ctx context.Context, req UpdateByQueryReq) (*UpdateByQueryResp, error) { + var ( + data UpdateByQueryResp + err error + ) + if data.response, err = c.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// UpdateByQueryReq represents possible options for the /_update_by_query request +type UpdateByQueryReq struct { + Indices []string + + Body io.Reader + + Header http.Header + Params UpdateByQueryParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r UpdateByQueryReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "POST", + fmt.Sprintf("/%s/_update_by_query", strings.Join(r.Indices, ",")), + r.Body, + r.Params.get(), + r.Header, + ) +} + +// UpdateByQueryResp represents the returned struct of the /_update_by_query response +type UpdateByQueryResp struct { + Took int `json:"took"` + TimedOut bool `json:"timed_out"` + Total int `json:"total"` + Updated int `json:"updated"` + Deleted int `json:"deleted"` + Batches int `json:"batches"` + VersionConflicts int `json:"version_conflicts"` + Noops int `json:"noops"` + Retries struct { + Bulk int `json:"bulk"` + Search int `json:"search"` + } `json:"retries"` + ThrottledMillis int `json:"throttled_millis"` + RequestsPerSecond float32 `json:"requests_per_second"` + ThrottledUntilMillis int `json:"throttled_until_millis"` + Failures []json.RawMessage `json:"failures"` + Type string `json:"_type"` // Deprecated field + Task string `json:"task"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r UpdateByQueryResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_update_by_query_rethrottle-params.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_update_by_query_rethrottle-params.go new file mode 100644 index 000000000..f7fe047c5 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_update_by_query_rethrottle-params.go @@ -0,0 +1,62 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchapi + +import ( + "strconv" +) + +// UpdateByQueryRethrottleParams represents possible parameters for the UpdateByQueryRethrottleReq +type UpdateByQueryRethrottleParams struct { + RequestsPerSecond *int + + Pretty bool + Human bool + ErrorTrace bool +} + +func (r UpdateByQueryRethrottleParams) get() map[string]string { + params := make(map[string]string) + + if r.RequestsPerSecond != nil { + params["requests_per_second"] = strconv.FormatInt(int64(*r.RequestsPerSecond), 10) + } + + if r.Pretty { + params["pretty"] = "true" + } + + if r.Human { + params["human"] = "true" + } + + if r.ErrorTrace { + params["error_trace"] = "true" + } + + return params +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_update_by_query_rethrottle.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_update_by_query_rethrottle.go new file mode 100644 index 000000000..aeec7fc23 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/api_update_by_query_rethrottle.go @@ -0,0 +1,116 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// UpdateByQueryRethrottle executes a / request with the optional UpdateByQueryRethrottleReq +func (c Client) UpdateByQueryRethrottle(ctx context.Context, req UpdateByQueryRethrottleReq) (*UpdateByQueryRethrottleResp, error) { + var ( + data UpdateByQueryRethrottleResp + err error + ) + if data.response, err = c.do(ctx, req, &data); err != nil { + return &data, err + } + + return &data, nil +} + +// UpdateByQueryRethrottleReq represents possible options for the / request +type UpdateByQueryRethrottleReq struct { + TaskID string + + Header http.Header + Params UpdateByQueryRethrottleParams +} + +// GetRequest returns the *http.Request that gets executed by the client +func (r UpdateByQueryRethrottleReq) GetRequest() (*http.Request, error) { + return opensearch.BuildRequest( + "POST", + fmt.Sprintf("/_update_by_query/%s/_rethrottle", r.TaskID), + nil, + r.Params.get(), + r.Header, + ) +} + +// UpdateByQueryRethrottleResp represents the returned struct of the / response +type UpdateByQueryRethrottleResp struct { + Nodes map[string]struct { + Name string `json:"name"` + TransportAddress string `json:"transport_address"` + Host string `json:"host"` + IP string `json:"ip"` + Roles []string `json:"roles"` + Attributes map[string]string `json:"attributes"` + Tasks map[string]struct { + Node string `json:"node"` + ID int `json:"id"` + Type string `json:"type"` + Action string `json:"action"` + Status struct { + Total int `json:"total"` + Updated int `json:"updated"` + Created int `json:"created"` + Deleted int `json:"deleted"` + Batches int `json:"batches"` + VersionConflicts int `json:"version_conflicts"` + Noops int `json:"noops"` + Retries struct { + Bulk int `json:"bulk"` + Search int `json:"search"` + } `json:"retries"` + ThrottledMillis int `json:"throttled_millis"` + RequestsPerSecond float64 `json:"requests_per_second"` + ThrottledUntilMillis int `json:"throttled_until_millis"` + } `json:"status"` + Description string `json:"description"` + StartTimeInMillis int64 `json:"start_time_in_millis"` + RunningTimeInNanos int `json:"running_time_in_nanos"` + Cancellable bool `json:"cancellable"` + Cancelled bool `json:"cancelled"` + Headers json.RawMessage `json:"headers"` + ResourceStats struct { + Average struct { + CPUTimeInNanos int `json:"cpu_time_in_nanos"` + MemoryInBytes int `json:"memory_in_bytes"` + } `json:"average"` + Total struct { + CPUTimeInNanos int `json:"cpu_time_in_nanos"` + MemoryInBytes int `json:"memory_in_bytes"` + } `json:"total"` + Min struct { + CPUTimeInNanos int `json:"cpu_time_in_nanos"` + MemoryInBytes int `json:"memory_in_bytes"` + } `json:"min"` + Max struct { + CPUTimeInNanos int `json:"cpu_time_in_nanos"` + MemoryInBytes int `json:"memory_in_bytes"` + } `json:"max"` + ThreadInfo struct { + ThreadExecutions int `json:"thread_executions"` + ActiveThreads int `json:"active_threads"` + } `json:"thread_info"` + } `json:"resource_stats"` + } `json:"tasks"` + } `json:"nodes"` + response *opensearch.Response +} + +// Inspect returns the Inspect type containing the raw *opensearch.Reponse +func (r UpdateByQueryRethrottleResp) Inspect() Inspect { + return Inspect{Response: r.response} +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/error.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/error.go new file mode 100644 index 000000000..e08f11cca --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/error.go @@ -0,0 +1,88 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "encoding/json" + "errors" + "fmt" +) + +// Error vars +var ( + ErrUnexpectedEmptyBody = errors.New("body is unexpectedly empty") + ErrReadBody = errors.New("failed to read body") + ErrJSONUnmarshalBody = errors.New("failed to json unmarshal body") + ErrUnknownOpensearchError = errors.New("opensearch error response could not be parsed as error") +) + +// Error represents the Opensearch API error response +type Error struct { + Err Err `json:"error"` + Status int `json:"status"` +} + +// Err represents the error of an API error response +type Err struct { + RootCause []RootCause `json:"root_cause"` + Type string `json:"type"` + Reason string `json:"reason"` + Index string `json:"index,omitempty"` + IndexUUID string `json:"index_uuid,omitempty"` +} + +// RootCause represents the root_cause of an API error response +type RootCause struct { + Type string `json:"type"` + Reason string `json:"reason"` + Index string `json:"index,omitempty"` + IndexUUID string `json:"index_uuid,omitempty"` +} + +// StringError represnets an Opensearch API Error with a string as error +type StringError struct { + Err string `json:"error"` + Status int `json:"status"` +} + +// Error returns a string +func (e Error) Error() string { + return fmt.Sprintf("status: %d, type: %s, reason: %s, root_cause: %s", e.Status, e.Err.Type, e.Err.Reason, e.Err.RootCause) +} + +// Error returns a string +func (e StringError) Error() string { + return fmt.Sprintf("status: %d, error: %s", e.Status, e.Err) +} + +// UnmarshalJSON is a custom unmarshal function for Error returning custom errors in special cases +func (e *Error) UnmarshalJSON(b []byte) error { + var dummy struct { + Err json.RawMessage `json:"error"` + Status int `json:"status"` + } + if err := json.Unmarshal(b, &dummy); err != nil { + return fmt.Errorf("%w: %s", err, b) + } + + if len(dummy.Err) == 0 { + return fmt.Errorf("%w: %s", ErrUnknownOpensearchError, b) + } + + var osErr Err + if err := json.Unmarshal(dummy.Err, &osErr); err != nil { + return StringError{Status: dummy.Status, Err: string(dummy.Err)} + } + if dummy.Status == 0 || (osErr.Type == "" && osErr.Reason == "") { + return fmt.Errorf("%w: %s", ErrUnknownOpensearchError, b) + } + + e.Err = osErr + e.Status = dummy.Status + + return nil +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/inspect.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/inspect.go new file mode 100644 index 000000000..616b612f3 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/inspect.go @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import "github.com/opensearch-project/opensearch-go/v3" + +// Inspect represents the struct returned by Inspect() func, its main use is to return the opensearch.Response to the user +type Inspect struct { + Response *opensearch.Response +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/opensearchapi.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/opensearchapi.go new file mode 100644 index 000000000..933cccc89 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchapi/opensearchapi.go @@ -0,0 +1,183 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. + +package opensearchapi + +import ( + "context" + "encoding/json" + "fmt" + "io" + "net/http" + "strconv" + "time" + + "github.com/opensearch-project/opensearch-go/v3" +) + +// Config represents the client configuration +type Config struct { + Client opensearch.Config +} + +// Client represents the opensearchapi Client summarizing all API calls +type Client struct { + Client *opensearch.Client + Cat catClient + Cluster clusterClient + Dangling danglingClient + Document documentClient + Indices indicesClient + Nodes nodesClient + Script scriptClient + ComponentTemplate componentTemplateClient + IndexTemplate indexTemplateClient + // Deprecated: uses legacy API (/_template), correct API is /_index_template, use IndexTemplate instead + Template templateClient + DataStream dataStreamClient + PointInTime pointInTimeClient + Ingest ingestClient + Tasks tasksClient + Scroll scrollClient + Snapshot snapshotClient +} + +// clientInit inits the Client with all sub clients +func clientInit(rootClient *opensearch.Client) *Client { + client := &Client{ + Client: rootClient, + } + client.Cat = catClient{apiClient: client} + client.Indices = indicesClient{ + apiClient: client, + Alias: aliasClient{apiClient: client}, + Mapping: mappingClient{apiClient: client}, + Settings: settingsClient{apiClient: client}, + } + client.Nodes = nodesClient{apiClient: client} + client.Cluster = clusterClient{apiClient: client} + client.Dangling = danglingClient{apiClient: client} + client.Script = scriptClient{apiClient: client} + client.Document = documentClient{apiClient: client} + client.ComponentTemplate = componentTemplateClient{apiClient: client} + client.IndexTemplate = indexTemplateClient{apiClient: client} + client.Template = templateClient{apiClient: client} + client.DataStream = dataStreamClient{apiClient: client} + client.PointInTime = pointInTimeClient{apiClient: client} + client.Ingest = ingestClient{apiClient: client} + client.Tasks = tasksClient{apiClient: client} + client.Scroll = scrollClient{apiClient: client} + client.Snapshot = snapshotClient{ + apiClient: client, + Repository: repositoryClient{apiClient: client}, + } + + return client +} + +// NewClient returns a opensearchapi client +func NewClient(config Config) (*Client, error) { + rootClient, err := opensearch.NewClient(config.Client) + if err != nil { + return nil, err + } + + return clientInit(rootClient), nil +} + +// NewDefaultClient returns a opensearchapi client using defaults +func NewDefaultClient() (*Client, error) { + rootClient, err := opensearch.NewClient(opensearch.Config{ + Addresses: []string{"http://localhost:9200"}, + }) + if err != nil { + return nil, err + } + + return clientInit(rootClient), nil +} + +// do calls the opensearch.Client.Do() and checks the response for openseach api errors +func (c *Client) do(ctx context.Context, req opensearch.Request, dataPointer any) (*opensearch.Response, error) { + resp, err := c.Client.Do(ctx, req, dataPointer) + if err != nil { + return nil, err + } + + if resp.IsError() { + if dataPointer != nil { + return resp, parseError(resp) + } else { + return resp, fmt.Errorf("status: %s", resp.Status()) + } + } + + return resp, nil +} + +// praseError tries to parse the opensearch api error into an custom error +func parseError(resp *opensearch.Response) error { + if resp.Body == nil { + return fmt.Errorf("%w, status: %s", ErrUnexpectedEmptyBody, resp.Status()) + } + + body, err := io.ReadAll(resp.Body) + if err != nil { + return fmt.Errorf("%w: %w", ErrReadBody, err) + } + + if resp.StatusCode == http.StatusMethodNotAllowed { + var apiError StringError + if err = json.Unmarshal(body, &apiError); err != nil { + return fmt.Errorf("%w: %w", ErrJSONUnmarshalBody, err) + } + return apiError + } + + // ToDo: Parse 404 errors separate as they are not in one standard format + // https://github.com/opensearch-project/OpenSearch/issues/9988 + + var apiError Error + if err = json.Unmarshal(body, &apiError); err != nil { + return fmt.Errorf("%w: %w", ErrJSONUnmarshalBody, err) + } + + return apiError +} + +// formatDuration converts duration to a string in the format +// accepted by Opensearch. +func formatDuration(d time.Duration) string { + if d < time.Millisecond { + return strconv.FormatInt(int64(d), 10) + "nanos" + } + + return strconv.FormatInt(int64(d)/int64(time.Millisecond), 10) + "ms" +} + +// ToPointer converts any value to a pointer, mainly used for request parameters +func ToPointer[V any](value V) *V { + return &value +} + +// ResponseShards is a sub type of api repsonses containing information about shards +type ResponseShards struct { + Total int `json:"total"` + Successful int `json:"successful"` + Failed int `json:"failed"` + Failures []ResponseShardsFailure `json:"failures"` + Skipped int `json:"skipped"` +} + +// ResponseShardsFailure is a sub type of ReponseShards containing information about a failed shard +type ResponseShardsFailure struct { + Shard int `json:"shard"` + Index any `json:"index"` + Reason struct { + Type string `json:"type"` + Reason string `json:"reason"` + } `json:"reason"` +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchtransport/connection.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchtransport/connection.go new file mode 100644 index 000000000..58e16ce02 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchtransport/connection.go @@ -0,0 +1,346 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchtransport + +import ( + "errors" + "fmt" + "math" + "net/url" + "sort" + "sync" + "time" +) + +const ( + defaultResurrectTimeoutInitial = 60 * time.Second + defaultResurrectTimeoutFactorCutoff = 5 +) + +// Selector defines the interface for selecting connections from the pool. +type Selector interface { + Select([]*Connection) (*Connection, error) +} + +// ConnectionPool defines the interface for the connection pool. +type ConnectionPool interface { + Next() (*Connection, error) // Next returns the next available connection. + OnSuccess(*Connection) // OnSuccess reports that the connection was successful. + OnFailure(*Connection) error // OnFailure reports that the connection failed. + URLs() []*url.URL // URLs returns the list of URLs of available connections. +} + +// Connection represents a connection to a node. +type Connection struct { + sync.Mutex + + URL *url.URL + IsDead bool + DeadSince time.Time + Failures int + + ID string + Name string + Roles []string + Attributes map[string]interface{} +} + +type singleConnectionPool struct { + connection *Connection + + metrics *metrics +} + +type statusConnectionPool struct { + sync.Mutex + + live []*Connection // List of live connections + dead []*Connection // List of dead connections + selector Selector + resurrectTimeoutInitial time.Duration + resurrectTimeoutFactorCutoff int + + metrics *metrics +} + +type roundRobinSelector struct { + sync.Mutex + + curr int // Index of the current connection +} + +// NewConnectionPool creates and returns a default connection pool. +func NewConnectionPool(conns []*Connection, selector Selector) ConnectionPool { + if len(conns) == 1 { + return &singleConnectionPool{connection: conns[0]} + } + + if selector == nil { + selector = &roundRobinSelector{curr: -1} + } + + return &statusConnectionPool{ + live: conns, + selector: selector, + resurrectTimeoutInitial: defaultResurrectTimeoutInitial, + resurrectTimeoutFactorCutoff: defaultResurrectTimeoutFactorCutoff, + } +} + +// Next returns the connection from pool. +func (cp *singleConnectionPool) Next() (*Connection, error) { + return cp.connection, nil +} + +// OnSuccess is a no-op for single connection pool. +func (cp *singleConnectionPool) OnSuccess(*Connection) {} + +// OnFailure is a no-op for single connection pool. +func (cp *singleConnectionPool) OnFailure(*Connection) error { return nil } + +// URLs returns the list of URLs of available connections. +func (cp *singleConnectionPool) URLs() []*url.URL { return []*url.URL{cp.connection.URL} } + +func (cp *singleConnectionPool) connections() []*Connection { return []*Connection{cp.connection} } + +// Next returns a connection from pool, or an error. +func (cp *statusConnectionPool) Next() (*Connection, error) { + cp.Lock() + defer cp.Unlock() + + // Return next live connection + if len(cp.live) > 0 { + return cp.selector.Select(cp.live) + } else if len(cp.dead) > 0 { + // No live connection is available, resurrect one of the dead ones. + c := cp.dead[len(cp.dead)-1] + cp.dead = cp.dead[:len(cp.dead)-1] + c.Lock() + defer c.Unlock() + cp.resurrect(c, false) + return c, nil + } + + return nil, errors.New("no connection available") +} + +// OnSuccess marks the connection as successful. +func (cp *statusConnectionPool) OnSuccess(c *Connection) { + c.Lock() + defer c.Unlock() + + // Short-circuit for live connection + if !c.IsDead { + return + } + + c.markAsHealthy() + + cp.Lock() + defer cp.Unlock() + cp.resurrect(c, true) +} + +// OnFailure marks the connection as failed. +func (cp *statusConnectionPool) OnFailure(c *Connection) error { + cp.Lock() + defer cp.Unlock() + + c.Lock() + + if c.IsDead { + if debugLogger != nil { + debugLogger.Logf("Already removed %s\n", c.URL) + } + c.Unlock() + + return nil + } + + if debugLogger != nil { + debugLogger.Logf("Removing %s...\n", c.URL) + } + + c.markAsDead() + cp.scheduleResurrect(c) + c.Unlock() + + // Push item to dead list and sort slice by number of failures + cp.dead = append(cp.dead, c) + sort.Slice(cp.dead, func(i, j int) bool { + c1 := cp.dead[i] + c2 := cp.dead[j] + c1.Lock() + c2.Lock() + defer c1.Unlock() + defer c2.Unlock() + + res := c1.Failures > c2.Failures + return res + }) + + // Check if connection exists in the list, return error if not. + index := -1 + + for i, conn := range cp.live { + if conn == c { + index = i + } + } + + if index < 0 { + // Does this error even get raised? Under what conditions can the connection not be in the cp.live list? + // If the connection is marked dead the function already ended + return errors.New("connection not in live list") + } + + // Remove item; https://github.com/golang/go/wiki/SliceTricks + copy(cp.live[index:], cp.live[index+1:]) + cp.live = cp.live[:len(cp.live)-1] + + return nil +} + +// URLs returns the list of URLs of available connections. +func (cp *statusConnectionPool) URLs() []*url.URL { + cp.Lock() + defer cp.Unlock() + + urls := make([]*url.URL, len(cp.live)) + for idx, c := range cp.live { + urls[idx] = c.URL + } + + return urls +} + +func (cp *statusConnectionPool) connections() []*Connection { + var conns []*Connection + conns = append(conns, cp.live...) + conns = append(conns, cp.dead...) + + return conns +} + +// resurrect adds the connection to the list of available connections. +// When removeDead is true, it also removes it from the dead list. +// The calling code is responsible for locking. +func (cp *statusConnectionPool) resurrect(c *Connection, removeDead bool) { + if debugLogger != nil { + debugLogger.Logf("Resurrecting %s\n", c.URL) + } + + c.markAsLive() + cp.live = append(cp.live, c) + + if removeDead { + index := -1 + + for i, conn := range cp.dead { + if conn == c { + index = i + } + } + + if index >= 0 { + // Remove item; https://github.com/golang/go/wiki/SliceTricks + copy(cp.dead[index:], cp.dead[index+1:]) + cp.dead = cp.dead[:len(cp.dead)-1] + } + } +} + +// scheduleResurrect schedules the connection to be resurrected. +func (cp *statusConnectionPool) scheduleResurrect(c *Connection) { + factor := math.Min(float64(c.Failures-1), float64(cp.resurrectTimeoutFactorCutoff)) + timeout := time.Duration(cp.resurrectTimeoutInitial.Seconds() * math.Exp2(factor) * float64(time.Second)) + + if debugLogger != nil { + debugLogger.Logf( + "Resurrect %s (failures=%d, factor=%1.1f, timeout=%s) in %s\n", + c.URL, + c.Failures, + factor, + timeout, + c.DeadSince.Add(timeout).Sub(time.Now().UTC()).Truncate(time.Second), + ) + } + + time.AfterFunc(timeout, func() { + cp.Lock() + defer cp.Unlock() + + c.Lock() + defer c.Unlock() + + if !c.IsDead { + if debugLogger != nil { + debugLogger.Logf("Already resurrected %s\n", c.URL) + } + return + } + + cp.resurrect(c, true) + }) +} + +// Select returns the connection in a round-robin fashion. +func (s *roundRobinSelector) Select(conns []*Connection) (*Connection, error) { + s.Lock() + defer s.Unlock() + + s.curr = (s.curr + 1) % len(conns) + return conns[s.curr], nil +} + +// markAsDead marks the connection as dead. +func (c *Connection) markAsDead() { + c.IsDead = true + if c.DeadSince.IsZero() { + c.DeadSince = time.Now().UTC() + } + c.Failures++ +} + +// markAsLive marks the connection as alive. +func (c *Connection) markAsLive() { + c.IsDead = false +} + +// markAsHealthy marks the connection as healthy. +func (c *Connection) markAsHealthy() { + c.IsDead = false + c.DeadSince = time.Time{} + c.Failures = 0 +} + +// String returns a readable connection representation. +func (c *Connection) String() string { + c.Lock() + defer c.Unlock() + return fmt.Sprintf("<%s> dead=%v failures=%d", c.URL, c.IsDead, c.Failures) +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchtransport/discovery.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchtransport/discovery.go new file mode 100644 index 000000000..93ed61e9d --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchtransport/discovery.go @@ -0,0 +1,220 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchtransport + +import ( + "context" + "encoding/json" + "fmt" + "io" + "net" + "net/http" + "net/url" + "strings" + "sync" + "time" +) + +// Discoverable defines the interface for transports supporting node discovery. +type Discoverable interface { + DiscoverNodes() error +} + +// nodeInfo represents the information about node in a cluster. +type nodeInfo struct { + ID string + Name string + URL *url.URL + Roles []string `json:"roles"` + Attributes map[string]interface{} + HTTP struct { + PublishAddress string `json:"publish_address"` + } +} + +// DiscoverNodes reloads the client connections by fetching information from the cluster. +func (c *Client) DiscoverNodes() error { + conns := make([]*Connection, 0) + + nodes, err := c.getNodesInfo() + if err != nil { + if debugLogger != nil { + debugLogger.Logf("Error getting nodes info: %s\n", err) + } + + return fmt.Errorf("discovery: get nodes: %w", err) + } + + for _, node := range nodes { + var isClusterManagerOnlyNode bool + + if len(node.Roles) == 1 && (node.Roles[0] == "master" || node.Roles[0] == "cluster_manager") { + isClusterManagerOnlyNode = true + } + + if debugLogger != nil { + var skip string + if isClusterManagerOnlyNode { + skip = "; [SKIP]" + } + + debugLogger.Logf("Discovered node [%s]; %s; roles=%s%s\n", node.Name, node.URL, node.Roles, skip) + } + + // Skip cluster_manager only nodes + // TODO: Move logic to Selector? + if isClusterManagerOnlyNode { + continue + } + + conns = append(conns, &Connection{ + URL: node.URL, + ID: node.ID, + Name: node.Name, + Roles: node.Roles, + Attributes: node.Attributes, + }) + } + + c.Lock() + defer c.Unlock() + + if lockable, ok := c.pool.(sync.Locker); ok { + lockable.Lock() + defer lockable.Unlock() + } + + if c.poolFunc != nil { + c.pool = c.poolFunc(conns, c.selector) + } else { + // TODO: Replace only live connections, leave dead scheduled for resurrect? + c.pool = NewConnectionPool(conns, c.selector) + } + + return nil +} + +func (c *Client) getNodesInfo() ([]nodeInfo, error) { + scheme := c.urls[0].Scheme + + req, err := http.NewRequestWithContext(context.TODO(), http.MethodGet, "/_nodes/http", nil) + if err != nil { + return nil, err + } + + c.Lock() + conn, err := c.pool.Next() + c.Unlock() + // TODO: If no connection is returned, fallback to original URLs + if err != nil { + return nil, err + } + + c.setReqURL(conn.URL, req) + c.setReqAuth(conn.URL, req) + c.setReqUserAgent(req) + + res, err := c.transport.RoundTrip(req) + if err != nil { + return nil, err + } + defer res.Body.Close() + + if res.StatusCode > http.StatusOK { + body, err := io.ReadAll(res.Body) + if err != nil { + return nil, fmt.Errorf("server error: %s: %w", res.Status, err) + } + return nil, fmt.Errorf("server error: %s: %s", res.Status, body) + } + + var env map[string]json.RawMessage + if err := json.NewDecoder(res.Body).Decode(&env); err != nil { + return nil, err + } + + var nodes map[string]nodeInfo + if err := json.Unmarshal(env["nodes"], &nodes); err != nil { + return nil, err + } + + out := make([]nodeInfo, len(nodes)) + idx := 0 + + for id, node := range nodes { + node.ID = id + u := c.getNodeURL(node, scheme) + node.URL = u + out[idx] = node + idx++ + } + + return out, nil +} + +func (c *Client) getNodeURL(node nodeInfo, scheme string) *url.URL { + var ( + host string + port string + err error + + addrs = strings.Split(node.HTTP.PublishAddress, "/") + ports = strings.Split(node.HTTP.PublishAddress, ":") + ) + + if len(addrs) > 1 { + host = addrs[0] + } else { + host, _, err = net.SplitHostPort(addrs[0]) + if err != nil { + host = strings.Split(addrs[0], ":")[0] + } + } + port = ports[len(ports)-1] + u := &url.URL{ + Scheme: scheme, + Host: net.JoinHostPort(host, port), + } + + return u +} + +func (c *Client) scheduleDiscoverNodes() { + //nolint:errcheck // errors are logged inside the function + go c.DiscoverNodes() + + c.Lock() + defer c.Unlock() + + if c.discoverNodesTimer != nil { + c.discoverNodesTimer.Stop() + } + + c.discoverNodesTimer = time.AfterFunc(c.discoverNodesInterval, func() { + c.scheduleDiscoverNodes() + }) +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchtransport/doc.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchtransport/doc.go new file mode 100644 index 000000000..721e27d5a --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchtransport/doc.go @@ -0,0 +1,59 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +/* +Package opensearchtransport provides the transport layer for the OpenSearch client. + +It is automatically included in the client provided by the github.com/opensearch-project/opensearch-go package +and is not intended for direct use: to configure the client, use the opensearch.Config struct. + +The default HTTP transport of the client is http.Transport; use the Transport option to customize it; + +The package will automatically retry requests on network-related errors, and on specific +response status codes (by default 502, 503, 504). Use the RetryOnStatus option to customize the list. +The transport will not retry a timeout network error, unless enabled by setting EnableRetryOnTimeout to true. + +Use the MaxRetries option to configure the number of retries, and set DisableRetry to true +to disable the retry behavior altogether. + +By default, the retry will be performed without any delay; to configure a backoff interval, +implement the RetryBackoff option function; see an example in the package unit tests for information. + +When multiple addresses are passed in configuration, the package will use them in a round-robin fashion, +and will keep track of live and dead nodes. The status of dead nodes is checked periodically. + +To customize the node selection behavior, provide a Selector implementation in the configuration. +To replace the connection pool entirely, provide a custom ConnectionPool implementation via +the ConnectionPoolFunc option. + +The package defines the Logger interface for logging information about request and response. +It comes with several bundled loggers for logging in text and JSON. + +Use the EnableDebugLogger option to enable the debugging logger for connection management. + +Use the EnableMetrics option to enable metric collection and export. +*/ +package opensearchtransport diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchtransport/logger.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchtransport/logger.go new file mode 100644 index 000000000..f7994e9d3 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchtransport/logger.go @@ -0,0 +1,449 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchtransport + +import ( + "bufio" + "bytes" + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" + "strconv" + "strings" + "time" +) + +var debugLogger DebuggingLogger + +// Logger defines an interface for logging request and response. +type Logger interface { + // LogRoundTrip should not modify the request or response, except for consuming and closing the body. + // Implementations have to check for nil values in request and response. + LogRoundTrip(*http.Request, *http.Response, error, time.Time, time.Duration) error + // RequestBodyEnabled makes the client pass a copy of request body to the logger. + RequestBodyEnabled() bool + // ResponseBodyEnabled makes the client pass a copy of response body to the logger. + ResponseBodyEnabled() bool +} + +// DebuggingLogger defines the interface for a debugging logger. +type DebuggingLogger interface { + Log(a ...interface{}) error + Logf(format string, a ...interface{}) error +} + +// TextLogger prints the log message in plain text. +type TextLogger struct { + Output io.Writer + EnableRequestBody bool + EnableResponseBody bool +} + +// ColorLogger prints the log message in a terminal-optimized plain text. +type ColorLogger struct { + Output io.Writer + EnableRequestBody bool + EnableResponseBody bool +} + +// CurlLogger prints the log message as a runnable curl command. +type CurlLogger struct { + Output io.Writer + EnableRequestBody bool + EnableResponseBody bool +} + +// JSONLogger prints the log message as JSON. +type JSONLogger struct { + Output io.Writer + EnableRequestBody bool + EnableResponseBody bool +} + +// debuggingLogger prints debug messages as plain text. +type debuggingLogger struct { + Output io.Writer +} + +// LogRoundTrip prints the information about request and response. +func (l *TextLogger) LogRoundTrip(req *http.Request, res *http.Response, err error, start time.Time, dur time.Duration) error { + fmt.Fprintf(l.Output, "%s %s %s [status:%d request:%s]\n", + start.Format(time.RFC3339), + req.Method, + req.URL.String(), + resStatusCode(res), + dur.Truncate(time.Millisecond), + ) + if l.RequestBodyEnabled() && req != nil && req.Body != nil && req.Body != http.NoBody { + var buf bytes.Buffer + if req.GetBody != nil { + b, _ := req.GetBody() + buf.ReadFrom(b) + } else { + buf.ReadFrom(req.Body) + } + logBodyAsText(l.Output, &buf, ">") + } + if l.ResponseBodyEnabled() && res != nil && res.Body != nil && res.Body != http.NoBody { + defer res.Body.Close() + var buf bytes.Buffer + buf.ReadFrom(res.Body) + logBodyAsText(l.Output, &buf, "<") + } + if err != nil { + fmt.Fprintf(l.Output, "! ERROR: %v\n", err) + } + return nil +} + +// RequestBodyEnabled returns true when the request body should be logged. +func (l *TextLogger) RequestBodyEnabled() bool { return l.EnableRequestBody } + +// ResponseBodyEnabled returns true when the response body should be logged. +func (l *TextLogger) ResponseBodyEnabled() bool { return l.EnableResponseBody } + +// LogRoundTrip prints the information about request and response. +func (l *ColorLogger) LogRoundTrip(req *http.Request, res *http.Response, err error, _ time.Time, dur time.Duration) error { + query, _ := url.QueryUnescape(req.URL.RawQuery) + if query != "" { + query = "?" + query + } + + var ( + status string + color string + ) + + status = res.Status + switch { + case res.StatusCode > 0 && res.StatusCode < 300: + color = "\x1b[32m" + case res.StatusCode > 299 && res.StatusCode < 500: + color = "\x1b[33m" + case res.StatusCode > 499: + color = "\x1b[31m" + default: + status = "ERROR" + color = "\x1b[31;4m" + } + + fmt.Fprintf(l.Output, "%6s \x1b[1;4m%s://%s%s\x1b[0m%s %s%s\x1b[0m \x1b[2m%s\x1b[0m\n", + req.Method, + req.URL.Scheme, + req.URL.Host, + req.URL.Path, + query, + color, + status, + dur.Truncate(time.Millisecond), + ) + + if l.RequestBodyEnabled() && req != nil && req.Body != nil && req.Body != http.NoBody { + var buf bytes.Buffer + if req.GetBody != nil { + b, _ := req.GetBody() + buf.ReadFrom(b) + } else { + buf.ReadFrom(req.Body) + } + fmt.Fprint(l.Output, "\x1b[2m") + logBodyAsText(l.Output, &buf, " »") + fmt.Fprint(l.Output, "\x1b[0m") + } + + if l.ResponseBodyEnabled() && res != nil && res.Body != nil && res.Body != http.NoBody { + defer res.Body.Close() + var buf bytes.Buffer + buf.ReadFrom(res.Body) + fmt.Fprint(l.Output, "\x1b[2m") + logBodyAsText(l.Output, &buf, " «") + fmt.Fprint(l.Output, "\x1b[0m") + } + + if err != nil { + fmt.Fprintf(l.Output, "\x1b[31;1m» ERROR \x1b[31m%v\x1b[0m\n", err) + } + + if l.RequestBodyEnabled() || l.ResponseBodyEnabled() { + fmt.Fprintf(l.Output, "\x1b[2m%s\x1b[0m\n", strings.Repeat("─", 80)) + } + return nil +} + +// RequestBodyEnabled returns true when the request body should be logged. +func (l *ColorLogger) RequestBodyEnabled() bool { return l.EnableRequestBody } + +// ResponseBodyEnabled returns true when the response body should be logged. +func (l *ColorLogger) ResponseBodyEnabled() bool { return l.EnableResponseBody } + +// LogRoundTrip prints the information about request and response. +func (l *CurlLogger) LogRoundTrip(req *http.Request, res *http.Response, _ error, start time.Time, dur time.Duration) error { + var b bytes.Buffer + + var query string + qvalues := url.Values{} + for k, v := range req.URL.Query() { + if k == "pretty" { + continue + } + for _, qv := range v { + qvalues.Add(k, qv) + } + } + if len(qvalues) > 0 { + query = qvalues.Encode() + } + + b.WriteString(`curl`) + if req.Method == http.MethodHead { + b.WriteString(" --head") + } else { + fmt.Fprintf(&b, " -X %s", req.Method) + } + + if len(req.Header) > 0 { + for k, vv := range req.Header { + if k == "Authorization" || k == "User-Agent" { + continue + } + v := strings.Join(vv, ",") + b.WriteString(fmt.Sprintf(" -H '%s: %s'", k, v)) + } + } + + // If by some oddity we end up with a nil req.URL, we handle it gracefully. + if req.URL == nil { + b.WriteString(" '") + } else { + b.WriteString(fmt.Sprintf(" '%s://%s%s", req.URL.Scheme, req.URL.Host, req.URL.Path)) + } + b.WriteString("?pretty") + if query != "" { + fmt.Fprintf(&b, "&%s", query) + } + b.WriteString("'") + + if req != nil && req.Body != nil && req.Body != http.NoBody { + var buf bytes.Buffer + if req.GetBody != nil { + b, _ := req.GetBody() + buf.ReadFrom(b) + } else { + buf.ReadFrom(req.Body) + } + + b.Grow(buf.Len()) + b.WriteString(" -d \\\n'") + json.Indent(&b, buf.Bytes(), "", " ") + b.WriteString("'") + } + + b.WriteRune('\n') + + status := res.Status + + fmt.Fprintf(&b, "# => %s [%s] %s\n", start.UTC().Format(time.RFC3339), status, dur.Truncate(time.Millisecond)) + if l.ResponseBodyEnabled() && res != nil && res.Body != nil && res.Body != http.NoBody { + var buf bytes.Buffer + buf.ReadFrom(res.Body) + + b.Grow(buf.Len()) + b.WriteString("# ") + json.Indent(&b, buf.Bytes(), "# ", " ") + } + + b.WriteString("\n") + if l.ResponseBodyEnabled() && res != nil && res.Body != nil && res.Body != http.NoBody { + b.WriteString("\n") + } + + b.WriteTo(l.Output) + + return nil +} + +// RequestBodyEnabled returns true when the request body should be logged. +func (l *CurlLogger) RequestBodyEnabled() bool { return l.EnableRequestBody } + +// ResponseBodyEnabled returns true when the response body should be logged. +func (l *CurlLogger) ResponseBodyEnabled() bool { return l.EnableResponseBody } + +// LogRoundTrip prints the information about request and response. +func (l *JSONLogger) LogRoundTrip(req *http.Request, res *http.Response, err error, start time.Time, dur time.Duration) error { + // TODO: Research performance optimization of using sync.Pool + + bsize := 200 + b := bytes.NewBuffer(make([]byte, 0, bsize)) + v := make([]byte, 0, bsize) + + appendTime := func(t time.Time) { + v = v[:0] + v = t.AppendFormat(v, time.RFC3339) + b.Write(v) + } + + appendQuote := func(s string) { + v = v[:0] + v = strconv.AppendQuote(v, s) + b.Write(v) + } + + appendInt := func(i int64) { + v = v[:0] + v = strconv.AppendInt(v, i, 10) + b.Write(v) + } + + b.WriteRune('{') + // -- Timestamp + b.WriteString(`"@timestamp":"`) + appendTime(start.UTC()) + b.WriteRune('"') + // -- Event + b.WriteString(`,"event":{`) + b.WriteString(`"duration":`) + appendInt(dur.Nanoseconds()) + b.WriteRune('}') + // -- URL + b.WriteString(`,"url":{`) + b.WriteString(`"scheme":`) + appendQuote(req.URL.Scheme) + b.WriteString(`,"domain":`) + appendQuote(req.URL.Hostname()) + if port := req.URL.Port(); port != "" { + b.WriteString(`,"port":`) + b.WriteString(port) + } + b.WriteString(`,"path":`) + appendQuote(req.URL.Path) + b.WriteString(`,"query":`) + appendQuote(req.URL.RawQuery) + b.WriteRune('}') // Close "url" + // -- HTTP + b.WriteString(`,"http":`) + // ---- Request + b.WriteString(`{"request":{`) + b.WriteString(`"method":`) + appendQuote(req.Method) + if l.RequestBodyEnabled() && req != nil && req.Body != nil && req.Body != http.NoBody { + var buf bytes.Buffer + if req.GetBody != nil { + b, _ := req.GetBody() + buf.ReadFrom(b) + } else { + buf.ReadFrom(req.Body) + } + + b.Grow(buf.Len() + 8) + b.WriteString(`,"body":`) + appendQuote(buf.String()) + } + b.WriteRune('}') // Close "http.request" + // ---- Response + b.WriteString(`,"response":{`) + b.WriteString(`"status_code":`) + appendInt(int64(resStatusCode(res))) + if l.ResponseBodyEnabled() && res != nil && res.Body != nil && res.Body != http.NoBody { + defer res.Body.Close() + var buf bytes.Buffer + buf.ReadFrom(res.Body) + + b.Grow(buf.Len() + 8) + b.WriteString(`,"body":`) + appendQuote(buf.String()) + } + b.WriteRune('}') // Close "http.response" + b.WriteRune('}') // Close "http" + // -- Error + if err != nil { + b.WriteString(`,"error":{"message":`) + appendQuote(err.Error()) + b.WriteRune('}') // Close "error" + } + b.WriteRune('}') + b.WriteRune('\n') + b.WriteTo(l.Output) + + return nil +} + +// RequestBodyEnabled returns true when the request body should be logged. +func (l *JSONLogger) RequestBodyEnabled() bool { return l.EnableRequestBody } + +// ResponseBodyEnabled returns true when the response body should be logged. +func (l *JSONLogger) ResponseBodyEnabled() bool { return l.EnableResponseBody } + +// Log prints the arguments to output in default format. +func (l *debuggingLogger) Log(a ...interface{}) error { + _, err := fmt.Fprint(l.Output, a...) + return err +} + +// Logf prints formats the arguments and prints them to output. +func (l *debuggingLogger) Logf(format string, a ...interface{}) error { + _, err := fmt.Fprintf(l.Output, format, a...) + return err +} + +func logBodyAsText(dst io.Writer, body io.Reader, prefix string) { + scanner := bufio.NewScanner(body) + for scanner.Scan() { + s := scanner.Text() + if s != "" { + fmt.Fprintf(dst, "%s %s\n", prefix, s) + } + } +} + +func duplicateBody(body io.ReadCloser) (io.ReadCloser, io.ReadCloser, error) { + var ( + b1 bytes.Buffer + b2 bytes.Buffer + tr = io.TeeReader(body, &b2) + ) + + if _, err := b1.ReadFrom(tr); err != nil { + return io.NopCloser(io.MultiReader(&b1, errorReader{err: err})), io.NopCloser(io.MultiReader(&b2, errorReader{err: err})), err + } + + defer func() { body.Close() }() + + return io.NopCloser(&b1), io.NopCloser(&b2), nil +} + +func resStatusCode(res *http.Response) int { + if res == nil { + return -1 + } + return res.StatusCode +} + +type errorReader struct{ err error } + +func (r errorReader) Read(_ []byte) (int, error) { return 0, r.err } diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchtransport/metrics.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchtransport/metrics.go new file mode 100644 index 000000000..442d04ae5 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchtransport/metrics.go @@ -0,0 +1,193 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchtransport + +import ( + "errors" + "fmt" + "strconv" + "strings" + "sync" + "time" +) + +// Measurable defines the interface for transports supporting metrics. +type Measurable interface { + Metrics() (Metrics, error) +} + +// connectionable defines the interface for transports returning a list of connections. +type connectionable interface { + connections() []*Connection +} + +// Metrics represents the transport metrics. +type Metrics struct { + Requests int `json:"requests"` + Failures int `json:"failures"` + Responses map[int]int `json:"responses"` + + Connections []fmt.Stringer `json:"connections"` +} + +// ConnectionMetric represents metric information for a connection. +type ConnectionMetric struct { + URL string `json:"url"` + Failures int `json:"failures,omitempty"` + IsDead bool `json:"dead,omitempty"` + DeadSince *time.Time `json:"dead_since,omitempty"` + + Meta struct { + ID string `json:"id"` + Name string `json:"name"` + Roles []string `json:"roles"` + } `json:"meta"` +} + +// metrics represents the inner state of metrics. +type metrics struct { + sync.RWMutex + + requests int + failures int + responses map[int]int +} + +// Metrics returns the transport metrics. +func (c *Client) Metrics() (Metrics, error) { + if c.metrics == nil { + return Metrics{}, errors.New("transport metrics not enabled") + } + c.metrics.RLock() + defer c.metrics.RUnlock() + + if lockable, ok := c.pool.(sync.Locker); ok { + lockable.Lock() + defer lockable.Unlock() + } + + m := Metrics{ + Requests: c.metrics.requests, + Failures: c.metrics.failures, + Responses: c.metrics.responses, + } + + if pool, ok := c.pool.(connectionable); ok { + connections := pool.connections() + for idx, c := range connections { + c.Lock() + + cm := ConnectionMetric{ + URL: c.URL.String(), + IsDead: c.IsDead, + Failures: c.Failures, + } + + if !c.DeadSince.IsZero() { + cm.DeadSince = &connections[idx].DeadSince + } + + if c.ID != "" { + cm.Meta.ID = c.ID + } + + if c.Name != "" { + cm.Meta.Name = c.Name + } + + if len(c.Roles) > 0 { + cm.Meta.Roles = c.Roles + } + + m.Connections = append(m.Connections, cm) + c.Unlock() + } + } + + return m, nil +} + +// String returns the metrics as a string. +func (m Metrics) String() string { + var ( + i int + b strings.Builder + ) + b.WriteString("{") + + b.WriteString("Requests:") + b.WriteString(strconv.Itoa(m.Requests)) + + b.WriteString(" Failures:") + b.WriteString(strconv.Itoa(m.Failures)) + + if len(m.Responses) > 0 { + b.WriteString(" Responses: ") + b.WriteString("[") + + for code, num := range m.Responses { + b.WriteString(strconv.Itoa(code)) + b.WriteString(":") + b.WriteString(strconv.Itoa(num)) + if i+1 < len(m.Responses) { + b.WriteString(", ") + } + i++ + } + b.WriteString("]") + } + + b.WriteString(" Connections: [") + for i, c := range m.Connections { + b.WriteString(c.String()) + if i+1 < len(m.Connections) { + b.WriteString(", ") + } + } + b.WriteString("]") + + b.WriteString("}") + return b.String() +} + +// String returns the connection information as a string. +func (cm ConnectionMetric) String() string { + var b strings.Builder + b.WriteString("{") + b.WriteString(cm.URL) + if cm.IsDead { + fmt.Fprintf(&b, " dead=%v", cm.IsDead) + } + if cm.Failures > 0 { + fmt.Fprintf(&b, " failures=%d", cm.Failures) + } + if cm.DeadSince != nil { + fmt.Fprintf(&b, " dead_since=%s", cm.DeadSince.Local().Format(time.Stamp)) + } + b.WriteString("}") + return b.String() +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchtransport/opensearchtransport.go b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchtransport/opensearchtransport.go new file mode 100644 index 000000000..e1cfc29c6 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/opensearchtransport/opensearchtransport.go @@ -0,0 +1,501 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package opensearchtransport + +import ( + "bytes" + "compress/gzip" + "crypto/x509" + "errors" + "fmt" + "io" + "net" + "net/http" + "net/url" + "os" + "regexp" + "runtime" + "strings" + "sync" + "time" + + "github.com/opensearch-project/opensearch-go/v3/internal/version" + "github.com/opensearch-project/opensearch-go/v3/signer" +) + +const ( + // Version returns the package version as a string. + Version = version.Client + defaultMaxRetries = 3 +) + +var reGoVersion = regexp.MustCompile(`go(\d+\.\d+\..+)`) + +// Interface defines the interface for HTTP client. +type Interface interface { + Perform(*http.Request) (*http.Response, error) +} + +// Config represents the configuration of HTTP client. +type Config struct { + URLs []*url.URL + Username string + Password string + + Header http.Header + CACert []byte + + Signer signer.Signer + + RetryOnStatus []int + DisableRetry bool + EnableRetryOnTimeout bool + MaxRetries int + RetryBackoff func(attempt int) time.Duration + + CompressRequestBody bool + + EnableMetrics bool + EnableDebugLogger bool + + DiscoverNodesInterval time.Duration + + Transport http.RoundTripper + Logger Logger + Selector Selector + + ConnectionPoolFunc func([]*Connection, Selector) ConnectionPool +} + +// Client represents the HTTP client. +type Client struct { + sync.Mutex + + urls []*url.URL + username string + password string + header http.Header + userAgent string + + signer signer.Signer + + retryOnStatus []int + disableRetry bool + enableRetryOnTimeout bool + maxRetries int + retryBackoff func(attempt int) time.Duration + discoverNodesInterval time.Duration + discoverNodesTimer *time.Timer + + compressRequestBody bool + + metrics *metrics + + transport http.RoundTripper + logger Logger + selector Selector + pool ConnectionPool + poolFunc func([]*Connection, Selector) ConnectionPool +} + +// New creates new transport client. +// +// http.DefaultTransport will be used if no transport is passed in the configuration. +func New(cfg Config) (*Client, error) { + if cfg.Transport == nil { + cfg.Transport = http.DefaultTransport + } + + if cfg.CACert != nil { + httpTransport, ok := cfg.Transport.(*http.Transport) + if !ok { + return nil, fmt.Errorf("unable to set CA certificate for transport of type %T", cfg.Transport) + } + + httpTransport = httpTransport.Clone() + httpTransport.TLSClientConfig.RootCAs = x509.NewCertPool() + + if ok := httpTransport.TLSClientConfig.RootCAs.AppendCertsFromPEM(cfg.CACert); !ok { + return nil, errors.New("unable to add CA certificate") + } + + cfg.Transport = httpTransport + } + + if len(cfg.RetryOnStatus) == 0 && cfg.RetryOnStatus == nil { + cfg.RetryOnStatus = []int{502, 503, 504} + } + + if cfg.MaxRetries == 0 { + cfg.MaxRetries = defaultMaxRetries + } + + conns := make([]*Connection, len(cfg.URLs)) + for idx, u := range cfg.URLs { + conns[idx] = &Connection{URL: u} + } + + client := Client{ + urls: cfg.URLs, + username: cfg.Username, + password: cfg.Password, + header: cfg.Header, + + signer: cfg.Signer, + + retryOnStatus: cfg.RetryOnStatus, + disableRetry: cfg.DisableRetry, + enableRetryOnTimeout: cfg.EnableRetryOnTimeout, + maxRetries: cfg.MaxRetries, + retryBackoff: cfg.RetryBackoff, + discoverNodesInterval: cfg.DiscoverNodesInterval, + + compressRequestBody: cfg.CompressRequestBody, + + transport: cfg.Transport, + logger: cfg.Logger, + selector: cfg.Selector, + poolFunc: cfg.ConnectionPoolFunc, + } + + client.userAgent = initUserAgent() + + if client.poolFunc != nil { + client.pool = client.poolFunc(conns, client.selector) + } else { + client.pool = NewConnectionPool(conns, client.selector) + } + + if cfg.EnableDebugLogger { + debugLogger = &debuggingLogger{Output: os.Stdout} + } + + if cfg.EnableMetrics { + client.metrics = &metrics{responses: make(map[int]int)} + // TODO(karmi): Type assertion to interface + if pool, ok := client.pool.(*singleConnectionPool); ok { + pool.metrics = client.metrics + } + if pool, ok := client.pool.(*statusConnectionPool); ok { + pool.metrics = client.metrics + } + } + + if client.discoverNodesInterval > 0 { + time.AfterFunc(client.discoverNodesInterval, func() { + client.scheduleDiscoverNodes() + }) + } + + return &client, nil +} + +// Perform executes the request and returns a response or error. +func (c *Client) Perform(req *http.Request) (*http.Response, error) { + var ( + res *http.Response + err error + ) + + // Record metrics, when enabled + if c.metrics != nil { + c.metrics.Lock() + c.metrics.requests++ + c.metrics.Unlock() + } + + // Update request + c.setReqUserAgent(req) + c.setReqGlobalHeader(req) + + if req.Body != nil && req.Body != http.NoBody { + if c.compressRequestBody { + var buf bytes.Buffer + zw := gzip.NewWriter(&buf) + if _, err := io.Copy(zw, req.Body); err != nil { + return nil, fmt.Errorf("failed to compress request body: %w", err) + } + if err := zw.Close(); err != nil { + return nil, fmt.Errorf("failed to compress request body (during close): %w", err) + } + + req.GetBody = func() (io.ReadCloser, error) { + r := buf + return io.NopCloser(&r), nil + } + //nolint:errcheck // error is always nil + req.Body, _ = req.GetBody() + + req.Header.Set("Content-Encoding", "gzip") + req.ContentLength = int64(buf.Len()) + } else if req.GetBody == nil { + if !c.disableRetry || (c.logger != nil && c.logger.RequestBodyEnabled()) { + var buf bytes.Buffer + //nolint:errcheck // ignored as this is only for logging + buf.ReadFrom(req.Body) + req.GetBody = func() (io.ReadCloser, error) { + r := buf + return io.NopCloser(&r), nil + } + //nolint:errcheck // error is always nil + req.Body, _ = req.GetBody() + } + } + } + + for i := 0; i <= c.maxRetries; i++ { + var ( + conn *Connection + shouldRetry bool + shouldCloseBody bool + ) + + // Get connection from the pool + c.Lock() + conn, err = c.pool.Next() + c.Unlock() + if err != nil { + if c.logger != nil { + c.logRoundTrip(req, nil, err, time.Time{}, time.Duration(0)) + } + return nil, fmt.Errorf("cannot get connection: %w", err) + } + + // Update request + c.setReqURL(conn.URL, req) + c.setReqAuth(conn.URL, req) + + if err = c.signRequest(req); err != nil { + return nil, fmt.Errorf("failed to sign request: %w", err) + } + + if !c.disableRetry && i > 0 && req.Body != nil && req.Body != http.NoBody { + body, err := req.GetBody() + if err != nil { + return nil, fmt.Errorf("cannot get request body: %w", err) + } + req.Body = body + } + + // Set up time measures and execute the request + start := time.Now().UTC() + res, err = c.transport.RoundTrip(req) + dur := time.Since(start) + + // Log request and response + if c.logger != nil { + if c.logger.RequestBodyEnabled() && req.Body != nil && req.Body != http.NoBody { + //nolint:errcheck // ignored as this is only for logging + req.Body, _ = req.GetBody() + } + c.logRoundTrip(req, res, err, start, dur) + } + + if err != nil { + // Record metrics, when enabled + if c.metrics != nil { + c.metrics.Lock() + c.metrics.failures++ + c.metrics.Unlock() + } + + // Report the connection as unsuccessful + c.Lock() + //nolint:errcheck // Questionable if the function even returns an error + c.pool.OnFailure(conn) + c.Unlock() + + // Retry on EOF errors + if errors.Is(err, io.EOF) { + shouldRetry = true + } + + // Retry on network errors, but not on timeout errors, unless configured + var netError net.Error + if errors.As(err, &netError) { + if (!netError.Timeout() || c.enableRetryOnTimeout) && !c.disableRetry { + shouldRetry = true + } + } + } else { + // Report the connection as succesfull + c.Lock() + c.pool.OnSuccess(conn) + c.Unlock() + } + + if res != nil && c.metrics != nil { + c.metrics.Lock() + c.metrics.responses[res.StatusCode]++ + c.metrics.Unlock() + } + + // Retry on configured response statuses + if res != nil && !c.disableRetry { + for _, code := range c.retryOnStatus { + if res.StatusCode == code { + shouldRetry = true + shouldCloseBody = true + } + } + } + + // Break if retry should not be performed + if !shouldRetry { + break + } + + // Drain and close body when retrying after response + if shouldCloseBody && i < c.maxRetries { + if res.Body != nil { + //nolint:errcheck // undexpected but okay if it failes + io.Copy(io.Discard, res.Body) + res.Body.Close() + } + } + + // Delay the retry if a backoff function is configured + if c.retryBackoff != nil { + time.Sleep(c.retryBackoff(i + 1)) + } + } + // Read, close and replace the http response body to close the connection + if res != nil && res.Body != nil { + body, err := io.ReadAll(res.Body) + res.Body.Close() + if err == nil { + res.Body = io.NopCloser(bytes.NewReader(body)) + } + } + + // TODO(karmi): Wrap error + return res, err +} + +// URLs returns a list of transport URLs. +func (c *Client) URLs() []*url.URL { + return c.pool.URLs() +} + +func (c *Client) setReqURL(u *url.URL, req *http.Request) { + req.URL.Scheme = u.Scheme + req.URL.Host = u.Host + + if u.Path != "" { + var b strings.Builder + b.Grow(len(u.Path) + len(req.URL.Path)) + b.WriteString(u.Path) + b.WriteString(req.URL.Path) + req.URL.Path = b.String() + } +} + +func (c *Client) setReqAuth(u *url.URL, req *http.Request) { + if _, ok := req.Header["Authorization"]; !ok { + if u.User != nil { + password, _ := u.User.Password() + req.SetBasicAuth(u.User.Username(), password) + return + } + + if c.username != "" && c.password != "" { + req.SetBasicAuth(c.username, c.password) + return + } + } +} + +func (c *Client) signRequest(req *http.Request) error { + if c.signer != nil { + return c.signer.SignRequest(req) + } + return nil +} + +func (c *Client) setReqUserAgent(req *http.Request) { + req.Header.Set("User-Agent", c.userAgent) +} + +func (c *Client) setReqGlobalHeader(req *http.Request) { + if len(c.header) > 0 { + for k, v := range c.header { + if req.Header.Get(k) != k { + for _, vv := range v { + req.Header.Add(k, vv) + } + } + } + } +} + +func (c *Client) logRoundTrip( + req *http.Request, + res *http.Response, + err error, + start time.Time, + dur time.Duration, +) { + var dupRes http.Response + if res != nil { + dupRes = *res + } + + if c.logger.ResponseBodyEnabled() { + if res != nil && res.Body != nil && res.Body != http.NoBody { + //nolint:errcheck // ignored as this is only for logging + b1, b2, _ := duplicateBody(res.Body) + dupRes.Body = b1 + res.Body = b2 + } + } + + //nolint:errcheck // ignored as this is only for logging + c.logger.LogRoundTrip(req, &dupRes, err, start, dur) +} + +func initUserAgent() string { + var b strings.Builder + + b.WriteString("opensearch-go") + b.WriteRune('/') + b.WriteString(Version) + b.WriteRune(' ') + b.WriteRune('(') + b.WriteString(runtime.GOOS) + b.WriteRune(' ') + b.WriteString(runtime.GOARCH) + b.WriteString("; ") + b.WriteString("Go ") + if v := reGoVersion.ReplaceAllString(runtime.Version(), "$1"); v != "" { + b.WriteString(v) + } else { + b.WriteString(runtime.Version()) + } + b.WriteRune(')') + + return b.String() +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/request.go b/vendor/github.com/opensearch-project/opensearch-go/v3/request.go new file mode 100644 index 000000000..1e2dc4af6 --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/request.go @@ -0,0 +1,31 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package opensearch + +import ( + "net/http" +) + +// Request represents a requests the client can execute +type Request interface { + GetRequest() (*http.Request, error) +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/request_builder.go b/vendor/github.com/opensearch-project/opensearch-go/v3/request_builder.go new file mode 100644 index 000000000..ebfc1b80d --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/request_builder.go @@ -0,0 +1,66 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package opensearch + +import ( + "io" + "net/http" +) + +const ( + headerContentType = "Content-Type" +) + +// BuildRequest is a helper function to build a http.Request +func BuildRequest(method string, path string, body io.Reader, params map[string]string, headers http.Header) (*http.Request, error) { + //nolint:noctx // ctx gets appended when the requests gets executet + httpReq, err := http.NewRequest(method, path, body) + if err != nil { + return nil, err + } + + if len(params) > 0 { + q := httpReq.URL.Query() + for k, v := range params { + q.Set(k, v) + } + + httpReq.URL.RawQuery = q.Encode() + } + + if body != nil { + httpReq.Header[headerContentType] = []string{"application/json"} + } + + if len(headers) > 0 { + if len(httpReq.Header) == 0 { + httpReq.Header = headers + } else { + for k, vv := range headers { + for _, v := range vv { + httpReq.Header.Add(k, v) + } + } + } + } + return httpReq, nil +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/response.go b/vendor/github.com/opensearch-project/opensearch-go/v3/response.go new file mode 100644 index 000000000..db4d0191d --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/response.go @@ -0,0 +1,63 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package opensearch + +import ( + "fmt" + "io" + "net/http" +) + +const httpStatusCodeThreshold = 299 + +// Response represents the API response. +type Response struct { + StatusCode int + Header http.Header + Body io.ReadCloser +} + +// String returns the response as a string. +func (r Response) String() string { + if r.Body != nil { + body, err := io.ReadAll(r.Body) + if err != nil { + body = []byte(fmt.Sprintf("", err)) + } + return fmt.Sprintf("%s %s", r.Status(), body) + } + return r.Status() +} + +// Status retuens the response status as string. +func (r Response) Status() string { + status := http.StatusText(r.StatusCode) + if status == "" { + status = "" + } + return fmt.Sprintf("[%d %s]", r.StatusCode, status) +} + +// IsError returns true when the response status indicates failure. +func (r *Response) IsError() bool { + return r.StatusCode > httpStatusCodeThreshold +} diff --git a/vendor/github.com/opensearch-project/opensearch-go/v3/signer/signer.go b/vendor/github.com/opensearch-project/opensearch-go/v3/signer/signer.go new file mode 100644 index 000000000..8a5beb94f --- /dev/null +++ b/vendor/github.com/opensearch-project/opensearch-go/v3/signer/signer.go @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: Apache-2.0 +// +// The OpenSearch Contributors require contributions made to +// this file be licensed under the Apache-2.0 license or a +// compatible open source license. +// +// Modifications Copyright OpenSearch Contributors. See +// GitHub history for details. + +package signer + +import "net/http" + +// Signer an interface that will sign http.Request +type Signer interface { + SignRequest(request *http.Request) error +} diff --git a/vendor/golang.org/x/time/rate/rate.go b/vendor/golang.org/x/time/rate/rate.go index 794b2e32b..563270c15 100644 --- a/vendor/golang.org/x/time/rate/rate.go +++ b/vendor/golang.org/x/time/rate/rate.go @@ -195,7 +195,7 @@ func (r *Reservation) CancelAt(t time.Time) { // update state r.lim.last = t r.lim.tokens = tokens - if r.timeToAct == r.lim.lastEvent { + if r.timeToAct.Equal(r.lim.lastEvent) { prevEvent := r.timeToAct.Add(r.limit.durationFromTokens(float64(-r.tokens))) if !prevEvent.Before(t) { r.lim.lastEvent = prevEvent diff --git a/vendor/kubedb.dev/apimachinery/apis/kafka/v1alpha1/connect_cluster_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kafka/v1alpha1/connect_cluster_helpers.go index 39f9ec374..5b59a4757 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kafka/v1alpha1/connect_cluster_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kafka/v1alpha1/connect_cluster_helpers.go @@ -159,7 +159,8 @@ func (ks connectClusterStatsService) Path() string { } func (ks connectClusterStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (k *ConnectCluster) StatsService() mona.StatsAccessor { @@ -179,7 +180,8 @@ func (k *ConnectCluster) PetSetName() string { } func (k *ConnectCluster) ConfigSecretName() string { - return meta_util.NameWithSuffix(k.OffshootName(), "config") + uid := string(k.UID) + return meta_util.NameWithSuffix(k.OffshootName(), uid[len(uid)-6:]) } func (k *ConnectCluster) GetPersistentSecrets() []string { @@ -255,6 +257,7 @@ func (k *ConnectCluster) SetDefaults(kc client.Client) { if k.Spec.Replicas == nil { k.Spec.Replicas = pointer.Int32P(1) } + k.Spec.Configuration = copyConfigurationField(k.Spec.Configuration, &k.Spec.ConfigSecret) var kfVersion catalog.KafkaVersion err := kc.Get(context.TODO(), types.NamespacedName{Name: k.Spec.Version}, &kfVersion) diff --git a/vendor/kubedb.dev/apimachinery/apis/kafka/v1alpha1/connect_cluster_types.go b/vendor/kubedb.dev/apimachinery/apis/kafka/v1alpha1/connect_cluster_types.go index d2f3891dd..a70fb2821 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kafka/v1alpha1/connect_cluster_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kafka/v1alpha1/connect_cluster_types.go @@ -95,6 +95,9 @@ type ConnectClusterSpec struct { // +optional ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + // +optional + Configuration *dbapi.ConfigurationSpec `json:"configuration,omitempty"` + // PodTemplate is an optional configuration for pods used to expose database // +optional PodTemplate ofst.PodTemplateSpec `json:"podTemplate,omitempty"` diff --git a/vendor/kubedb.dev/apimachinery/apis/kafka/v1alpha1/connector_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kafka/v1alpha1/connector_helpers.go index 14c39a1c7..96ddd54ff 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kafka/v1alpha1/connector_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kafka/v1alpha1/connector_helpers.go @@ -39,6 +39,8 @@ func (k *Connector) Default() { if k.Spec.DeletionPolicy == "" { k.Spec.DeletionPolicy = dbapi.DeletionPolicyDelete } + + k.Spec.Configuration = copyConfigurationField(k.Spec.Configuration, &k.Spec.ConfigSecret) } func (k *Connector) ResourceShortCode() string { diff --git a/vendor/kubedb.dev/apimachinery/apis/kafka/v1alpha1/connector_types.go b/vendor/kubedb.dev/apimachinery/apis/kafka/v1alpha1/connector_types.go index 1a1a6f80f..9ad72b653 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kafka/v1alpha1/connector_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kafka/v1alpha1/connector_types.go @@ -61,6 +61,9 @@ type ConnectorSpec struct { // ConfigSecret is a required field to provide configuration file for Connector to create connectors for Kafka connect cluster(i.e connector.properties). ConfigSecret *core.LocalObjectReference `json:"configSecret"` + // +optional + Configuration *dbapi.ConfigurationSpec `json:"configuration,omitempty"` + // DeletionPolicy controls the delete operation for database // +optional DeletionPolicy dbapi.DeletionPolicy `json:"deletionPolicy,omitempty"` diff --git a/vendor/kubedb.dev/apimachinery/apis/kafka/v1alpha1/helpers.go b/vendor/kubedb.dev/apimachinery/apis/kafka/v1alpha1/helpers.go new file mode 100644 index 000000000..2a814d2f2 --- /dev/null +++ b/vendor/kubedb.dev/apimachinery/apis/kafka/v1alpha1/helpers.go @@ -0,0 +1,33 @@ +/* +Copyright AppsCode Inc. and Contributors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + dbapi "kubedb.dev/apimachinery/apis/kubedb/v1" + + core "k8s.io/api/core/v1" +) + +func copyConfigurationField(cnf *dbapi.ConfigurationSpec, sec **core.LocalObjectReference) *dbapi.ConfigurationSpec { + if cnf == nil && (*sec) != nil && (*sec).Name != "" { + cnf = &dbapi.ConfigurationSpec{ + SecretName: (*sec).Name, + } + } + *sec = nil + return cnf +} diff --git a/vendor/kubedb.dev/apimachinery/apis/kafka/v1alpha1/openapi_generated.go b/vendor/kubedb.dev/apimachinery/apis/kafka/v1alpha1/openapi_generated.go index 959571d32..5dfaba965 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kafka/v1alpha1/openapi_generated.go +++ b/vendor/kubedb.dev/apimachinery/apis/kafka/v1alpha1/openapi_generated.go @@ -26666,6 +26666,11 @@ func schema_apimachinery_apis_kafka_v1alpha1_ConnectClusterSpec(ref common.Refer Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), }, }, + "configuration": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec"), + }, + }, "podTemplate": { SchemaProps: spec.SchemaProps{ Description: "PodTemplate is an optional configuration for pods used to expose database", @@ -26712,7 +26717,7 @@ func schema_apimachinery_apis_kafka_v1alpha1_ConnectClusterSpec(ref common.Refer }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.ObjectReference", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.SecretReference"}, + "k8s.io/api/core/v1.LocalObjectReference", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.ObjectReference", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.SecretReference"}, } } @@ -26873,6 +26878,11 @@ func schema_apimachinery_apis_kafka_v1alpha1_ConnectorSpec(ref common.ReferenceC Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), }, }, + "configuration": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec"), + }, + }, "deletionPolicy": { SchemaProps: spec.SchemaProps{ Description: "DeletionPolicy controls the delete operation for database", @@ -26885,7 +26895,7 @@ func schema_apimachinery_apis_kafka_v1alpha1_ConnectorSpec(ref common.ReferenceC }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "kmodules.xyz/client-go/api/v1.ObjectReference"}, + "k8s.io/api/core/v1.LocalObjectReference", "kmodules.xyz/client-go/api/v1.ObjectReference", "kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec"}, } } diff --git a/vendor/kubedb.dev/apimachinery/apis/kafka/v1alpha1/zz_generated.deepcopy.go b/vendor/kubedb.dev/apimachinery/apis/kafka/v1alpha1/zz_generated.deepcopy.go index b23b48d4c..6ad1e3288 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kafka/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/kubedb.dev/apimachinery/apis/kafka/v1alpha1/zz_generated.deepcopy.go @@ -150,6 +150,11 @@ func (in *ConnectClusterSpec) DeepCopyInto(out *ConnectClusterSpec) { *out = new(corev1.LocalObjectReference) **out = **in } + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(kubedbv1.ConfigurationSpec) + (*in).DeepCopyInto(*out) + } in.PodTemplate.DeepCopyInto(&out.PodTemplate) if in.ServiceTemplates != nil { in, out := &in.ServiceTemplates, &out.ServiceTemplates @@ -274,6 +279,11 @@ func (in *ConnectorSpec) DeepCopyInto(out *ConnectorSpec) { *out = new(corev1.LocalObjectReference) **out = **in } + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(kubedbv1.ConfigurationSpec) + (*in).DeepCopyInto(*out) + } return } diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/constants.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/constants.go index 7665246b9..8d2161612 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/constants.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/constants.go @@ -41,6 +41,11 @@ const ( PrometheusTokenFile = "/var/prometheus-data/token.txt" MonitoringAgentAnnotation = GroupName + "/monitoring-agent" + InlinePropertiesKey = "inline.properties" + InlineConfigKey = "inline.conf" + InlineConfigKeyPrefix = "inline" + InlineConfigKeyPrefixZZ = "zz-inline" + // distributed const DistributedDatabaseLabel = GroupName + "/distributed" DistributedCustomConfigSecretNameSuffix = "custom-config" @@ -145,6 +150,8 @@ const ( ElasticsearchVolumeCustomConfig = "custom-config" ElasticsearchVolumeData = "data" ElasticsearchVolumeTemp = "temp" + ElasticsearchConfigFileName = "elasticsearch.yml" + ElasticsearchScriptFileName = "config-merger.sh" // Ref: // - https://www.elastic.co/guide/en/elasticsearch/reference/7.6/heap-size.html#heap-size @@ -556,11 +563,11 @@ const ( PostgresSharedTlsVolumeName = "certs" PostgresSharedTlsVolumeMountPath = "/tls/certs" PostgresCustomConfigFile = "user.conf" - - PostgresKeyFileSecretSuffix = "key" - PostgresPEMSecretSuffix = "pem" - PostgresDefaultUsername = "postgres" - PostgresPgCoordinatorStatus = "Coordinator/Status" + PostgresTuningConfigFile = "pgtune.conf" + PostgresKeyFileSecretSuffix = "key" + PostgresPEMSecretSuffix = "pem" + PostgresDefaultUsername = "postgres" + PostgresPgCoordinatorStatus = "Coordinator/Status" // to pause the failover for postgres. this is helpful for ops request PostgresPgCoordinatorStatusPause = "Pause" // to resume the failover for postgres. this is helpful for ops request @@ -1777,6 +1784,7 @@ const ( Neo4jContainerName = "neo4j" Neo4jInitContainerName = "neo4j-init" + Neo4jConfigFileName = "neo4j.conf" ) // =========================== Cassandra Constants ============================ @@ -2034,13 +2042,13 @@ var ( } // DefaultResourcesMemoryIntensiveMSSQLServer must be used for Microsoft SQL Server - DefaultResourcesMemoryIntensiveMSSQLServer = core.ResourceRequirements{ + DefaultResourcesMSSQLServer = core.ResourceRequirements{ Requests: core.ResourceList{ - core.ResourceCPU: resource.MustParse("1"), - core.ResourceMemory: resource.MustParse("1.5Gi"), + core.ResourceCPU: resource.MustParse("1.5"), + core.ResourceMemory: resource.MustParse("2Gi"), }, Limits: core.ResourceList{ - core.ResourceMemory: resource.MustParse("2Gi"), + core.ResourceMemory: resource.MustParse("4Gi"), }, } @@ -2225,6 +2233,8 @@ const ( QdrantDataDir = "/qdrant/storage" QdrantConfigVolName = "qdrant-config" QdrantConfigDir = "/qdrant/config" + QdrantTLSVolName = "tls" + QdrantTLSVolDir = "/tls" QdrantConfigFileName = "config.yaml" diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/elasticsearch_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/elasticsearch_helpers.go index 5d91a87f1..073003828 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/elasticsearch_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/elasticsearch_helpers.go @@ -213,7 +213,8 @@ func (e *Elasticsearch) GetUserCredSecretName(username string) (string, error) { // returns the secret name for the default elasticsearch configuration func (e *Elasticsearch) ConfigSecretName() string { - return meta_util.NameWithSuffix(e.Name, "config") + uid := string(e.UID) + return meta_util.NameWithSuffix(e.OffshootName(), uid[len(uid)-6:]) } func (e *Elasticsearch) GetConnectionScheme() string { @@ -374,7 +375,8 @@ func (e elasticsearchStatsService) Path() string { } func (e elasticsearchStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (e elasticsearchStatsService) TLSConfig() *promapi.TLSConfig { @@ -471,6 +473,7 @@ func (e *Elasticsearch) SetDefaults(esVersion *catalog.ElasticsearchVersion) { e.Spec.AuthSecret.Kind = kubedb.ResourceKindSecret } } + e.Spec.Configuration = copyConfigurationField(e.Spec.Configuration, &e.Spec.ConfigSecret) // set default elasticsearch node name prefix if e.Spec.Topology != nil { diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/elasticsearch_types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/elasticsearch_types.go index 18dddcac8..70b45aaf8 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/elasticsearch_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/elasticsearch_types.go @@ -99,6 +99,9 @@ type ElasticsearchSpec struct { // +optional ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + // +optional + Configuration *ConfigurationSpec `json:"configuration,omitempty"` + // SecureConfigSecret is an optional field to provide secure settings for database. // - Ref: https://www.elastic.co/guide/en/elasticsearch/reference/7.14/secure-settings.html // Secure settings are store at "ES_CONFIG_DIR/elasticsearch.keystore" file (contents are encoded with password), diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/helpers.go index 30556832a..80ad1ae61 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/helpers.go @@ -184,3 +184,13 @@ func GetActivationTimeFromSecret(secretName *core.Secret) (*metav1.Time, error) func IsVirtualAuthSecretReferred(authSecret *SecretReference) bool { return authSecret != nil && authSecret.APIGroup == vsecretapi.GroupName } + +func copyConfigurationField(cnf *ConfigurationSpec, sec **core.LocalObjectReference) *ConfigurationSpec { + if cnf == nil && (*sec) != nil && (*sec).Name != "" { + cnf = &ConfigurationSpec{ + SecretName: (*sec).Name, + } + } + *sec = nil + return cnf +} diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/kafka_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/kafka_helpers.go index ac482ef3c..3311d9574 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/kafka_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/kafka_helpers.go @@ -175,7 +175,8 @@ func (ks kafkaStatsService) Path() string { } func (ks kafkaStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (k *Kafka) StatsService() mona.StatsAccessor { @@ -220,14 +221,9 @@ func (k *Kafka) NodeRoleSpecificLabelKey(role KafkaNodeRoleType) string { return kubedb.GroupName + "/role-" + string(role) } -func (k *Kafka) ConfigSecretName(role KafkaNodeRoleType) string { - switch role { - case KafkaNodeRoleController: - return meta_util.NameWithSuffix(k.OffshootName(), "controller-config") - case KafkaNodeRoleBroker: - return meta_util.NameWithSuffix(k.OffshootName(), "broker-config") - } - return meta_util.NameWithSuffix(k.OffshootName(), "config") +func (k *Kafka) ConfigSecretName() string { + uid := string(k.UID) + return meta_util.NameWithSuffix(k.OffshootName(), uid[len(uid)-6:]) } func (k *Kafka) GetAuthSecretName() string { @@ -255,10 +251,6 @@ func (k *Kafka) GetPersistentSecrets() []string { return secrets } -func (k *Kafka) CruiseControlConfigSecretName() string { - return meta_util.NameWithSuffix(k.OffshootName(), "cruise-control-config") -} - // CertificateName returns the default certificate name and/or certificate secret name for a certificate alias func (k *Kafka) CertificateName(alias KafkaCertificateAlias) string { return meta_util.NameWithSuffix(k.Name, fmt.Sprintf("%s-cert", string(alias))) @@ -352,6 +344,7 @@ func (k *Kafka) SetDefaults(kc client.Client) { if k.Spec.StorageType == "" { k.Spec.StorageType = StorageTypeDurable } + k.Spec.Configuration = copyConfigurationField(k.Spec.Configuration, &k.Spec.ConfigSecret) if !k.Spec.DisableSecurity { if k.Spec.AuthSecret == nil { diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/kafka_types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/kafka_types.go index 54efc418e..27e6578fd 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/kafka_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/kafka_types.go @@ -95,6 +95,9 @@ type KafkaSpec struct { // +optional ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + // +optional + Configuration *ConfigurationSpec `json:"configuration,omitempty"` + // Keystore encryption secret // +optional KeystoreCredSecret *SecretReference `json:"keystoreCredSecret,omitempty"` @@ -179,9 +182,8 @@ type KafkaStatus struct { } type KafkaCruiseControl struct { - // Configuration for cruise-control // +optional - ConfigSecret *SecretReference `json:"configSecret,omitempty"` + Configuration *ConfigurationSpec `json:"configuration,omitempty"` // Replicas represents number of replica for this specific type of node // +optional @@ -191,10 +193,6 @@ type KafkaCruiseControl struct { // +optional Suffix string `json:"suffix,omitempty"` - // Compute Resources required by the sidecar container. - // +optional - Resources core.ResourceRequirements `json:"resources,omitempty"` - // PodTemplate is an optional configuration for pods used to expose database // +optional PodTemplate ofstv2.PodTemplateSpec `json:"podTemplate,omitempty"` diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mariadb_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mariadb_helpers.go index 8a25461d3..114999990 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mariadb_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mariadb_helpers.go @@ -143,6 +143,10 @@ func (m MariaDB) offshootLabels(selector, override map[string]string) map[string return meta_util.FilterKeys(kubedb.GroupName, selector, meta_util.OverwriteKeys(nil, m.Labels, override)) } +func (m MariaDB) AddKeyPrefix(key string) string { + return meta_util.NameWithPrefix(kubedb.InlineConfigKeyPrefixZZ, key) +} + func (m MariaDB) ServiceLabels(alias ServiceAlias, extraLabels ...map[string]string) map[string]string { svcTemplate := GetServiceTemplate(m.Spec.ServiceTemplates, alias) return m.offshootLabels(meta_util.OverwriteKeys(m.OffshootSelectors(), extraLabels...), svcTemplate.Labels) @@ -256,7 +260,8 @@ func (m mariadbStatsService) Path() string { } func (m mariadbStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (m mariadbStatsService) TLSConfig() *promapi.TLSConfig { @@ -308,6 +313,7 @@ func (m *MariaDB) SetDefaults(mdVersion *v1alpha1.MariaDBVersion) { if m.Spec.Init != nil && m.Spec.Init.Archiver != nil && m.Spec.Init.Archiver.ReplicationStrategy == nil { m.Spec.Init.Archiver.ReplicationStrategy = ptr.To(ReplicationStrategySync) } + m.Spec.Configuration = copyConfigurationField(m.Spec.Configuration, &m.Spec.ConfigSecret) m.setDefaultContainerSecurityContext(mdVersion, &m.Spec.PodTemplate) m.setDefaultContainerResourceLimits(&m.Spec.PodTemplate) m.SetTLSDefaults() @@ -324,6 +330,7 @@ func (m *MariaDB) SetDefaults(mdVersion *v1alpha1.MariaDBVersion) { } if m.IsCluster() && m.IsMariaDBReplication() { m.SetDefaultsMaxscale(mdVersion, m.Spec.Topology.MaxScale) + m.Spec.WsrepSSTMethod = GaleraWsrepSSTMethodMariabackup } if m.Spec.Init != nil && m.Spec.Init.Archiver != nil { @@ -577,8 +584,9 @@ func (m *MariaDB) ReplicasAreReady(lister pslister.PetSetLister) (bool, string, return checkReplicas(lister.PetSets(m.Namespace), labels.SelectorFromSet(m.OffshootLabels()), expectedItems) } -func (m *MariaDB) InlineConfigSecretName() string { - return meta_util.NameWithSuffix(m.Name, "inline") +func (m *MariaDB) ConfigSecretName() string { + uid := string(m.UID) + return meta_util.NameWithSuffix(m.OffshootName(), uid[len(uid)-6:]) } func (m *MariaDB) CertMountPath(alias MariaDBCertificateAlias) string { diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mariadb_types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mariadb_types.go index 1c984a811..23f67791e 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mariadb_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mariadb_types.go @@ -101,6 +101,9 @@ type MariaDBSpec struct { // If specified, this file will be used as configuration file otherwise default configuration file will be used. ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + // +optional + Configuration *ConfigurationSpec `json:"configuration,omitempty"` + // PodTemplate is an optional configuration for pods used to expose database // +optional PodTemplate ofstv2.PodTemplateSpec `json:"podTemplate,omitempty"` diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/memcached_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/memcached_helpers.go index 9ca98ed3e..a3f5d0983 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/memcached_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/memcached_helpers.go @@ -126,12 +126,9 @@ func (m Memcached) GoverningServiceName() string { return meta_util.NameWithSuffix(m.ServiceName(), "pods") } -func (m Memcached) ConfigSecretName() string { - return meta_util.NameWithSuffix(m.OffshootName(), "config") -} - -func (m Memcached) CustomConfigSecretName() string { - return meta_util.NameWithSuffix(m.OffshootName(), "custom-config") +func (m *Memcached) ConfigSecretName() string { + uid := string(m.UID) + return meta_util.NameWithSuffix(m.OffshootName(), uid[len(uid)-6:]) } type memcachedApp struct { @@ -179,7 +176,8 @@ func (m memcachedStatsService) Path() string { } func (m memcachedStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (m memcachedStatsService) TLSConfig() *promapi.TLSConfig { @@ -217,6 +215,8 @@ func (m *Memcached) SetDefaults(mcVersion *catalog.MemcachedVersion) { } } + m.Spec.Configuration = copyConfigurationField(m.Spec.Configuration, &m.Spec.ConfigSecret) + m.setDefaultContainerSecurityContext(mcVersion, &m.Spec.PodTemplate) m.setDefaultContainerResourceLimits(&m.Spec.PodTemplate) diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/memcached_types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/memcached_types.go index 8f30eeae9..4cba4437f 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/memcached_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/memcached_types.go @@ -66,6 +66,10 @@ type MemcachedSpec struct { // If specified, this file will be used as configuration file otherwise default configuration file will be used. ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + // Configuration holds the custom config for memcached + // +optional + Configuration *ConfigurationSpec `json:"configuration,omitempty"` + // Database Authentication Secret // If specified, this will be used for authentication otherwise default secret will be used. // +optional diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mongodb_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mongodb_helpers.go index 8799ed225..f1aff481f 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mongodb_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mongodb_helpers.go @@ -590,7 +590,8 @@ func (m mongoDBStatsService) Path() string { } func (m mongoDBStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (m mongoDBStatsService) TLSConfig() *promapi.TLSConfig { @@ -655,7 +656,6 @@ func (m *MongoDB) SetDefaults(mgVersion *v1alpha1.MongoDBVersion) { } m.initializePodTemplates() - if m.Spec.ShardTopology != nil { m.setPodTemplateDefaultValues(m.Spec.ShardTopology.Mongos.PodTemplate, mgVersion, false) m.setPodTemplateDefaultValues(m.Spec.ShardTopology.Shard.PodTemplate, mgVersion, true) @@ -677,6 +677,7 @@ func (m *MongoDB) SetDefaults(mgVersion *v1alpha1.MongoDBVersion) { m.setPodTemplateDefaultValues(m.Spec.Hidden.PodTemplate, mgVersion, false) } + m.copyConfigurationFields() m.SetTLSDefaults() m.SetHealthCheckerDefaults() m.Spec.Monitor.SetDefaults() @@ -702,6 +703,23 @@ func (m *MongoDB) SetDefaults(mgVersion *v1alpha1.MongoDBVersion) { } } +func (m *MongoDB) copyConfigurationFields() { + if m.Spec.ShardTopology != nil { + m.Spec.ShardTopology.Shard.Configuration = copyConfigurationField(m.Spec.ShardTopology.Shard.Configuration, &m.Spec.ShardTopology.Shard.ConfigSecret) + m.Spec.ShardTopology.ConfigServer.Configuration = copyConfigurationField(m.Spec.ShardTopology.ConfigServer.Configuration, &m.Spec.ShardTopology.ConfigServer.ConfigSecret) + m.Spec.ShardTopology.Mongos.Configuration = copyConfigurationField(m.Spec.ShardTopology.Mongos.Configuration, &m.Spec.ShardTopology.Mongos.ConfigSecret) + } else { + m.Spec.Configuration = copyConfigurationField(m.Spec.Configuration, &m.Spec.ConfigSecret) + } + + if m.Spec.Arbiter != nil { + m.Spec.Arbiter.Configuration = copyConfigurationField(m.Spec.Arbiter.Configuration, &m.Spec.Arbiter.ConfigSecret) + } + if m.Spec.Hidden != nil { + m.Spec.Hidden.Configuration = copyConfigurationField(m.Spec.Hidden.Configuration, &m.Spec.Hidden.ConfigSecret) + } +} + func (m *MongoDB) initializePodTemplates() { if m.Spec.ShardTopology != nil { if m.Spec.ShardTopology.Shard.PodTemplate == nil { @@ -1082,5 +1100,6 @@ func (m *MongoDB) ConfigSecretName(nodeType string) string { if nodeType != "" { nodeType = "-" + nodeType } - return m.Name + nodeType + "-config" + uid := string(m.UID) + return meta_util.NameWithSuffix(m.OffshootName()+nodeType, uid[len(uid)-6:]) } diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mongodb_types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mongodb_types.go index 200bd2bb9..8ef2cb2ae 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mongodb_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mongodb_types.go @@ -101,6 +101,9 @@ type MongoDBSpec struct { // If specified, this file will be used as configuration file otherwise default configuration file will be used. ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + // +optional + Configuration *ConfigurationSpec `json:"configuration,omitempty"` + // PodTemplate is an optional configuration for pods used to expose database // +optional PodTemplate *ofstv2.PodTemplateSpec `json:"podTemplate,omitempty"` @@ -290,6 +293,9 @@ type MongoArbiterNode struct { // If specified, this file will be used as configuration file otherwise default configuration file will be used. ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + // +optional + Configuration *ConfigurationSpec `json:"configuration,omitempty"` + // PodTemplate is an optional configuration for pods used to expose database // +optional PodTemplate *ofstv2.PodTemplateSpec `json:"podTemplate,omitempty"` @@ -300,6 +306,9 @@ type MongoHiddenNode struct { // If specified, this file will be used as configuration file otherwise default configuration file will be used. ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + // +optional + Configuration *ConfigurationSpec `json:"configuration,omitempty"` + // PodTemplate is an optional configuration for pods used to expose database // +optional PodTemplate *ofstv2.PodTemplateSpec `json:"podTemplate,omitempty"` @@ -324,6 +333,9 @@ type MongoDBNode struct { // If specified, this file will be used as configuration file otherwise default configuration file will be used. ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + // +optional + Configuration *ConfigurationSpec `json:"configuration,omitempty"` + // PodTemplate is an optional configuration for pods used to expose database // +optional PodTemplate *ofstv2.PodTemplateSpec `json:"podTemplate,omitempty"` diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mysql_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mysql_helpers.go index 20a652a87..d0600fca1 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mysql_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mysql_helpers.go @@ -122,6 +122,10 @@ func (m MySQL) offshootLabels(selector, override map[string]string) map[string]s return meta_util.FilterKeys(kubedb.GroupName, selector, meta_util.OverwriteKeys(nil, m.Labels, override)) } +func (m MySQL) AddKeyPrefix(key string) string { + return meta_util.NameWithPrefix(kubedb.InlineConfigKeyPrefixZZ, key) +} + func (m MySQL) ResourceFQN() string { return fmt.Sprintf("%s.%s", ResourcePluralMySQL, kubedb.GroupName) } @@ -234,7 +238,8 @@ func (m mysqlStatsService) Path() string { } func (m mysqlStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (m mysqlStatsService) TLSConfig() *promapi.TLSConfig { @@ -353,7 +358,7 @@ func (m *MySQL) SetDefaults(myVersion *v1alpha1.MySQLVersion) error { if m.Spec.PodTemplate.Spec.ServiceAccountName == "" { m.Spec.PodTemplate.Spec.ServiceAccountName = m.OffshootName() } - + m.Spec.Configuration = copyConfigurationField(m.Spec.Configuration, &m.Spec.ConfigSecret) m.setDefaultContainerResourceLimits(&m.Spec.PodTemplate) m.SetTLSDefaults() m.SetHealthCheckerDefaults() @@ -584,3 +589,8 @@ func (m *MySQL) setDefaultContainerResourceLimits(podTemplate *ofstv2.PodTemplat } } } + +func (m *MySQL) ConfigSecretName() string { + uid := string(m.UID) + return meta_util.NameWithSuffix(m.OffshootName(), uid[len(uid)-6:]) +} diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mysql_types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mysql_types.go index 9b3ddcb1a..480342796 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mysql_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/mysql_types.go @@ -107,6 +107,9 @@ type MySQLSpec struct { // If specified, this file will be used as configuration file otherwise default configuration file will be used. ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + // +optional + Configuration *ConfigurationSpec `json:"configuration,omitempty"` + // PodTemplate is an optional configuration for pods used to expose database // +optional PodTemplate ofstv2.PodTemplateSpec `json:"podTemplate,omitempty"` diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/openapi_generated.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/openapi_generated.go index bb9bd1236..ad0f3c79b 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/openapi_generated.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/openapi_generated.go @@ -520,6 +520,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/kubedb/v1.ArchiverRecovery": schema_apimachinery_apis_kubedb_v1_ArchiverRecovery(ref), "kubedb.dev/apimachinery/apis/kubedb/v1.AutoOpsSpec": schema_apimachinery_apis_kubedb_v1_AutoOpsSpec(ref), "kubedb.dev/apimachinery/apis/kubedb/v1.BrokerRack": schema_apimachinery_apis_kubedb_v1_BrokerRack(ref), + "kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec": schema_apimachinery_apis_kubedb_v1_ConfigurationSpec(ref), "kubedb.dev/apimachinery/apis/kubedb/v1.ConnectionPoolConfig": schema_apimachinery_apis_kubedb_v1_ConnectionPoolConfig(ref), "kubedb.dev/apimachinery/apis/kubedb/v1.ConsumerNamespaces": schema_apimachinery_apis_kubedb_v1_ConsumerNamespaces(ref), "kubedb.dev/apimachinery/apis/kubedb/v1.Database": schema_apimachinery_apis_kubedb_v1_Database(ref), @@ -587,6 +588,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/kubedb/v1.PgBouncerStatus": schema_apimachinery_apis_kubedb_v1_PgBouncerStatus(ref), "kubedb.dev/apimachinery/apis/kubedb/v1.PostgreLeaderElectionConfig": schema_apimachinery_apis_kubedb_v1_PostgreLeaderElectionConfig(ref), "kubedb.dev/apimachinery/apis/kubedb/v1.Postgres": schema_apimachinery_apis_kubedb_v1_Postgres(ref), + "kubedb.dev/apimachinery/apis/kubedb/v1.PostgresConfiguration": schema_apimachinery_apis_kubedb_v1_PostgresConfiguration(ref), "kubedb.dev/apimachinery/apis/kubedb/v1.PostgresList": schema_apimachinery_apis_kubedb_v1_PostgresList(ref), "kubedb.dev/apimachinery/apis/kubedb/v1.PostgresReplication": schema_apimachinery_apis_kubedb_v1_PostgresReplication(ref), "kubedb.dev/apimachinery/apis/kubedb/v1.PostgresSpec": schema_apimachinery_apis_kubedb_v1_PostgresSpec(ref), @@ -594,6 +596,8 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/kubedb/v1.PostgresTuningConfig": schema_apimachinery_apis_kubedb_v1_PostgresTuningConfig(ref), "kubedb.dev/apimachinery/apis/kubedb/v1.ProxySQL": schema_apimachinery_apis_kubedb_v1_ProxySQL(ref), "kubedb.dev/apimachinery/apis/kubedb/v1.ProxySQLConfiguration": schema_apimachinery_apis_kubedb_v1_ProxySQLConfiguration(ref), + "kubedb.dev/apimachinery/apis/kubedb/v1.ProxySQLConfigurationSpec": schema_apimachinery_apis_kubedb_v1_ProxySQLConfigurationSpec(ref), + "kubedb.dev/apimachinery/apis/kubedb/v1.ProxySQLInitConfiguration": schema_apimachinery_apis_kubedb_v1_ProxySQLInitConfiguration(ref), "kubedb.dev/apimachinery/apis/kubedb/v1.ProxySQLList": schema_apimachinery_apis_kubedb_v1_ProxySQLList(ref), "kubedb.dev/apimachinery/apis/kubedb/v1.ProxySQLSpec": schema_apimachinery_apis_kubedb_v1_ProxySQLSpec(ref), "kubedb.dev/apimachinery/apis/kubedb/v1.ProxySQLStatus": schema_apimachinery_apis_kubedb_v1_ProxySQLStatus(ref), @@ -601,6 +605,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/kubedb/v1.Redis": schema_apimachinery_apis_kubedb_v1_Redis(ref), "kubedb.dev/apimachinery/apis/kubedb/v1.RedisAclSpec": schema_apimachinery_apis_kubedb_v1_RedisAclSpec(ref), "kubedb.dev/apimachinery/apis/kubedb/v1.RedisClusterSpec": schema_apimachinery_apis_kubedb_v1_RedisClusterSpec(ref), + "kubedb.dev/apimachinery/apis/kubedb/v1.RedisConfiguration": schema_apimachinery_apis_kubedb_v1_RedisConfiguration(ref), "kubedb.dev/apimachinery/apis/kubedb/v1.RedisList": schema_apimachinery_apis_kubedb_v1_RedisList(ref), "kubedb.dev/apimachinery/apis/kubedb/v1.RedisSentinel": schema_apimachinery_apis_kubedb_v1_RedisSentinel(ref), "kubedb.dev/apimachinery/apis/kubedb/v1.RedisSentinelList": schema_apimachinery_apis_kubedb_v1_RedisSentinelList(ref), @@ -615,7 +620,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/kubedb/v1.SemiSyncSpec": schema_apimachinery_apis_kubedb_v1_SemiSyncSpec(ref), "kubedb.dev/apimachinery/apis/kubedb/v1.Shards": schema_apimachinery_apis_kubedb_v1_Shards(ref), "kubedb.dev/apimachinery/apis/kubedb/v1.SystemUserSecretsSpec": schema_apimachinery_apis_kubedb_v1_SystemUserSecretsSpec(ref), - "kubedb.dev/apimachinery/apis/kubedb/v1.TuningResourcesOverride": schema_apimachinery_apis_kubedb_v1_TuningResourcesOverride(ref), "kubedb.dev/apimachinery/apis/kubedb/v1.elasticsearchApp": schema_apimachinery_apis_kubedb_v1_elasticsearchApp(ref), "kubedb.dev/apimachinery/apis/kubedb/v1.elasticsearchStatsService": schema_apimachinery_apis_kubedb_v1_elasticsearchStatsService(ref), "kubedb.dev/apimachinery/apis/kubedb/v1.kafkaStatsService": schema_apimachinery_apis_kubedb_v1_kafkaStatsService(ref), @@ -26828,6 +26832,41 @@ func schema_apimachinery_apis_kubedb_v1_BrokerRack(ref common.ReferenceCallback) } } +func schema_apimachinery_apis_kubedb_v1_ConfigurationSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "secretName": { + SchemaProps: spec.SchemaProps{ + Description: "SecretName is an optional field to provide custom configuration file for the database (i.e. elasticsearch.yml, mongod.conf ..). If specified, these configurations will be used with default configurations (if any) and applyConfig configurations (if any). configurations from this secret will override default configurations. This secret must be created by user.", + Type: []string{"string"}, + Format: "", + }, + }, + "inline": { + SchemaProps: spec.SchemaProps{ + Description: "Inline contains key-value pairs of configurations to be applied to the database. These configurations will override both default configurations and configurations from the config secret (if any).", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + }, + }, + } +} + func schema_apimachinery_apis_kubedb_v1_ConnectionPoolConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -27380,6 +27419,11 @@ func schema_apimachinery_apis_kubedb_v1_ElasticsearchSpec(ref common.ReferenceCa Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), }, }, + "configuration": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec"), + }, + }, "secureConfigSecret": { SchemaProps: spec.SchemaProps{ Description: "SecureConfigSecret is an optional field to provide secure settings for database.\n\t- Ref: https://www.elastic.co/guide/en/elasticsearch/reference/7.14/secure-settings.html\nSecure settings are store at \"ES_CONFIG_DIR/elasticsearch.keystore\" file (contents are encoded with password), once the keystore created. Expects a k8s secret name with data format:\n\tdata:\n\t\tkey: value\n\t\tpassword: KEYSTORE_PASSWORD\n\t\ts3.client.default.access_key: ACCESS_KEY\n\t\ts3.client.default.secret_key: SECRET_KEY", @@ -27488,7 +27532,7 @@ func schema_apimachinery_apis_kubedb_v1_ElasticsearchSpec(ref common.ReferenceCa }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "k8s.io/apimachinery/pkg/util/intstr.IntOrString", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.ElasticsearchClusterTopology", "kubedb.dev/apimachinery/apis/kubedb/v1.ElasticsearchRoleMapSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.ElasticsearchUserSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.InitSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.KernelSettings", "kubedb.dev/apimachinery/apis/kubedb/v1.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.SecretReference"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "k8s.io/apimachinery/pkg/util/intstr.IntOrString", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.ElasticsearchClusterTopology", "kubedb.dev/apimachinery/apis/kubedb/v1.ElasticsearchRoleMapSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.ElasticsearchUserSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.InitSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.KernelSettings", "kubedb.dev/apimachinery/apis/kubedb/v1.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.SecretReference"}, } } @@ -27943,10 +27987,9 @@ func schema_apimachinery_apis_kubedb_v1_KafkaCruiseControl(ref common.ReferenceC SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ - "configSecret": { + "configuration": { SchemaProps: spec.SchemaProps{ - Description: "Configuration for cruise-control", - Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1.SecretReference"), + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec"), }, }, "replicas": { @@ -27963,13 +28006,6 @@ func schema_apimachinery_apis_kubedb_v1_KafkaCruiseControl(ref common.ReferenceC Format: "", }, }, - "resources": { - SchemaProps: spec.SchemaProps{ - Description: "Compute Resources required by the sidecar container.", - Default: map[string]interface{}{}, - Ref: ref("k8s.io/api/core/v1.ResourceRequirements"), - }, - }, "podTemplate": { SchemaProps: spec.SchemaProps{ Description: "PodTemplate is an optional configuration for pods used to expose database", @@ -27987,7 +28023,7 @@ func schema_apimachinery_apis_kubedb_v1_KafkaCruiseControl(ref common.ReferenceC }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ResourceRequirements", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.KafkaBrokerCapacity", "kubedb.dev/apimachinery/apis/kubedb/v1.SecretReference"}, + "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.KafkaBrokerCapacity"}, } } @@ -28161,6 +28197,11 @@ func schema_apimachinery_apis_kubedb_v1_KafkaSpec(ref common.ReferenceCallback) Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), }, }, + "configuration": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec"), + }, + }, "keystoreCredSecret": { SchemaProps: spec.SchemaProps{ Description: "Keystore encryption secret", @@ -28232,7 +28273,7 @@ func schema_apimachinery_apis_kubedb_v1_KafkaSpec(ref common.ReferenceCallback) }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.BrokerRack", "kubedb.dev/apimachinery/apis/kubedb/v1.KafkaClusterTopology", "kubedb.dev/apimachinery/apis/kubedb/v1.KafkaCruiseControl", "kubedb.dev/apimachinery/apis/kubedb/v1.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.SecretReference"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.BrokerRack", "kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.KafkaClusterTopology", "kubedb.dev/apimachinery/apis/kubedb/v1.KafkaCruiseControl", "kubedb.dev/apimachinery/apis/kubedb/v1.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.SecretReference"}, } } @@ -28527,6 +28568,11 @@ func schema_apimachinery_apis_kubedb_v1_MariaDBSpec(ref common.ReferenceCallback Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), }, }, + "configuration": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec"), + }, + }, "podTemplate": { SchemaProps: spec.SchemaProps{ Description: "PodTemplate is an optional configuration for pods used to expose database", @@ -28606,7 +28652,7 @@ func schema_apimachinery_apis_kubedb_v1_MariaDBSpec(ref common.ReferenceCallback }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.AllowedConsumers", "kubedb.dev/apimachinery/apis/kubedb/v1.Archiver", "kubedb.dev/apimachinery/apis/kubedb/v1.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.InitSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.MariaDBTopology", "kubedb.dev/apimachinery/apis/kubedb/v1.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.SecretReference"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.AllowedConsumers", "kubedb.dev/apimachinery/apis/kubedb/v1.Archiver", "kubedb.dev/apimachinery/apis/kubedb/v1.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.InitSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.MariaDBTopology", "kubedb.dev/apimachinery/apis/kubedb/v1.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.SecretReference"}, } } @@ -28865,6 +28911,12 @@ func schema_apimachinery_apis_kubedb_v1_MemcachedSpec(ref common.ReferenceCallba Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), }, }, + "configuration": { + SchemaProps: spec.SchemaProps{ + Description: "Configuration holds the custom config for memcached", + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec"), + }, + }, "authSecret": { SchemaProps: spec.SchemaProps{ Description: "Database Authentication Secret If specified, this will be used for authentication otherwise default secret will be used.", @@ -28937,7 +28989,7 @@ func schema_apimachinery_apis_kubedb_v1_MemcachedSpec(ref common.ReferenceCallba }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.VolumeSource", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.SecretReference"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.VolumeSource", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.SecretReference"}, } } @@ -28995,6 +29047,11 @@ func schema_apimachinery_apis_kubedb_v1_MongoArbiterNode(ref common.ReferenceCal Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), }, }, + "configuration": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec"), + }, + }, "podTemplate": { SchemaProps: spec.SchemaProps{ Description: "PodTemplate is an optional configuration for pods used to expose database", @@ -29005,7 +29062,7 @@ func schema_apimachinery_apis_kubedb_v1_MongoArbiterNode(ref common.ReferenceCal }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec"}, + "k8s.io/api/core/v1.LocalObjectReference", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec"}, } } @@ -29082,6 +29139,11 @@ func schema_apimachinery_apis_kubedb_v1_MongoDBConfigNode(ref common.ReferenceCa Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), }, }, + "configuration": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec"), + }, + }, "podTemplate": { SchemaProps: spec.SchemaProps{ Description: "PodTemplate is an optional configuration for pods used to expose database", @@ -29105,7 +29167,7 @@ func schema_apimachinery_apis_kubedb_v1_MongoDBConfigNode(ref common.ReferenceCa }, }, Dependencies: []string{ - "k8s.io/api/core/v1.EmptyDirVolumeSource", "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec"}, + "k8s.io/api/core/v1.EmptyDirVolumeSource", "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec"}, } } @@ -29184,6 +29246,11 @@ func schema_apimachinery_apis_kubedb_v1_MongoDBMongosNode(ref common.ReferenceCa Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), }, }, + "configuration": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec"), + }, + }, "podTemplate": { SchemaProps: spec.SchemaProps{ Description: "PodTemplate is an optional configuration for pods used to expose database", @@ -29195,7 +29262,7 @@ func schema_apimachinery_apis_kubedb_v1_MongoDBMongosNode(ref common.ReferenceCa }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec"}, + "k8s.io/api/core/v1.LocalObjectReference", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec"}, } } @@ -29226,6 +29293,11 @@ func schema_apimachinery_apis_kubedb_v1_MongoDBNode(ref common.ReferenceCallback Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), }, }, + "configuration": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec"), + }, + }, "podTemplate": { SchemaProps: spec.SchemaProps{ Description: "PodTemplate is an optional configuration for pods used to expose database", @@ -29237,7 +29309,7 @@ func schema_apimachinery_apis_kubedb_v1_MongoDBNode(ref common.ReferenceCallback }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec"}, + "k8s.io/api/core/v1.LocalObjectReference", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec"}, } } @@ -29305,6 +29377,11 @@ func schema_apimachinery_apis_kubedb_v1_MongoDBShardNode(ref common.ReferenceCal Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), }, }, + "configuration": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec"), + }, + }, "podTemplate": { SchemaProps: spec.SchemaProps{ Description: "PodTemplate is an optional configuration for pods used to expose database", @@ -29328,7 +29405,7 @@ func schema_apimachinery_apis_kubedb_v1_MongoDBShardNode(ref common.ReferenceCal }, }, Dependencies: []string{ - "k8s.io/api/core/v1.EmptyDirVolumeSource", "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec"}, + "k8s.io/api/core/v1.EmptyDirVolumeSource", "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec"}, } } @@ -29465,6 +29542,11 @@ func schema_apimachinery_apis_kubedb_v1_MongoDBSpec(ref common.ReferenceCallback Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), }, }, + "configuration": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec"), + }, + }, "podTemplate": { SchemaProps: spec.SchemaProps{ Description: "PodTemplate is an optional configuration for pods used to expose database", @@ -29554,7 +29636,7 @@ func schema_apimachinery_apis_kubedb_v1_MongoDBSpec(ref common.ReferenceCallback }, }, Dependencies: []string{ - "k8s.io/api/core/v1.EmptyDirVolumeSource", "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.AllowedConsumers", "kubedb.dev/apimachinery/apis/kubedb/v1.Archiver", "kubedb.dev/apimachinery/apis/kubedb/v1.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.InitSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.MongoArbiterNode", "kubedb.dev/apimachinery/apis/kubedb/v1.MongoDBReplicaSet", "kubedb.dev/apimachinery/apis/kubedb/v1.MongoDBShardingTopology", "kubedb.dev/apimachinery/apis/kubedb/v1.MongoHiddenNode", "kubedb.dev/apimachinery/apis/kubedb/v1.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.SecretReference"}, + "k8s.io/api/core/v1.EmptyDirVolumeSource", "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.AllowedConsumers", "kubedb.dev/apimachinery/apis/kubedb/v1.Archiver", "kubedb.dev/apimachinery/apis/kubedb/v1.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.InitSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.MongoArbiterNode", "kubedb.dev/apimachinery/apis/kubedb/v1.MongoDBReplicaSet", "kubedb.dev/apimachinery/apis/kubedb/v1.MongoDBShardingTopology", "kubedb.dev/apimachinery/apis/kubedb/v1.MongoHiddenNode", "kubedb.dev/apimachinery/apis/kubedb/v1.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.SecretReference"}, } } @@ -29617,6 +29699,11 @@ func schema_apimachinery_apis_kubedb_v1_MongoHiddenNode(ref common.ReferenceCall Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), }, }, + "configuration": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec"), + }, + }, "podTemplate": { SchemaProps: spec.SchemaProps{ Description: "PodTemplate is an optional configuration for pods used to expose database", @@ -29643,7 +29730,7 @@ func schema_apimachinery_apis_kubedb_v1_MongoHiddenNode(ref common.ReferenceCall }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec"}, } } @@ -29890,6 +29977,11 @@ func schema_apimachinery_apis_kubedb_v1_MySQLSpec(ref common.ReferenceCallback) Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), }, }, + "configuration": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec"), + }, + }, "podTemplate": { SchemaProps: spec.SchemaProps{ Description: "PodTemplate is an optional configuration for pods used to expose database", @@ -29976,7 +30068,7 @@ func schema_apimachinery_apis_kubedb_v1_MySQLSpec(ref common.ReferenceCallback) }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.AllowedConsumers", "kubedb.dev/apimachinery/apis/kubedb/v1.Archiver", "kubedb.dev/apimachinery/apis/kubedb/v1.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.InitSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.MySQLTopology", "kubedb.dev/apimachinery/apis/kubedb/v1.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.SecretReference"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.AllowedConsumers", "kubedb.dev/apimachinery/apis/kubedb/v1.Archiver", "kubedb.dev/apimachinery/apis/kubedb/v1.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.InitSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.MySQLTopology", "kubedb.dev/apimachinery/apis/kubedb/v1.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.SecretReference"}, } } @@ -30359,6 +30451,11 @@ func schema_apimachinery_apis_kubedb_v1_PerconaXtraDBSpec(ref common.ReferenceCa Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), }, }, + "configuration": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec"), + }, + }, "podTemplate": { SchemaProps: spec.SchemaProps{ Description: "PodTemplate is an optional configuration for pods used to expose database", @@ -30431,7 +30528,7 @@ func schema_apimachinery_apis_kubedb_v1_PerconaXtraDBSpec(ref common.ReferenceCa }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.AllowedConsumers", "kubedb.dev/apimachinery/apis/kubedb/v1.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.InitSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.SecretReference", "kubedb.dev/apimachinery/apis/kubedb/v1.SystemUserSecretsSpec"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.AllowedConsumers", "kubedb.dev/apimachinery/apis/kubedb/v1.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.InitSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.SecretReference", "kubedb.dev/apimachinery/apis/kubedb/v1.SystemUserSecretsSpec"}, } } @@ -30650,6 +30747,11 @@ func schema_apimachinery_apis_kubedb_v1_PgBouncerSpec(ref common.ReferenceCallba Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), }, }, + "configuration": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec"), + }, + }, "init": { SchemaProps: spec.SchemaProps{ Description: "Init is used to initialize database", @@ -30701,7 +30803,7 @@ func schema_apimachinery_apis_kubedb_v1_PgBouncerSpec(ref common.ReferenceCallba }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.ConnectionPoolConfig", "kubedb.dev/apimachinery/apis/kubedb/v1.Database", "kubedb.dev/apimachinery/apis/kubedb/v1.InitSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.SecretReference"}, + "k8s.io/api/core/v1.LocalObjectReference", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.ConfigurationSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.ConnectionPoolConfig", "kubedb.dev/apimachinery/apis/kubedb/v1.Database", "kubedb.dev/apimachinery/apis/kubedb/v1.InitSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.SecretReference"}, } } @@ -30871,6 +30973,48 @@ func schema_apimachinery_apis_kubedb_v1_Postgres(ref common.ReferenceCallback) c } } +func schema_apimachinery_apis_kubedb_v1_PostgresConfiguration(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "secretName": { + SchemaProps: spec.SchemaProps{ + Description: "SecretName is an optional field to provide custom configuration file for the database (i.e. elasticsearch.yml, mongod.conf ..). If specified, these configurations will be used with default configurations (if any) and applyConfig configurations (if any). configurations from this secret will override default configurations. This secret must be created by user.", + Type: []string{"string"}, + Format: "", + }, + }, + "inline": { + SchemaProps: spec.SchemaProps{ + Description: "Inline contains key-value pairs of configurations to be applied to the database. These configurations will override both default configurations and configurations from the config secret (if any).", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "tuning": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1.PostgresTuningConfig"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "kubedb.dev/apimachinery/apis/kubedb/v1.PostgresTuningConfig"}, + } +} + func schema_apimachinery_apis_kubedb_v1_PostgresList(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -30951,9 +31095,9 @@ func schema_apimachinery_apis_kubedb_v1_PostgresReplication(ref common.Reference Format: "int32", }, }, - "forceFailOverAcceptingDataLossAfter": { + "forceFailoverAcceptingDataLossAfter": { SchemaProps: spec.SchemaProps{ - Description: "ForceFailOverAcceptingDataLossAfter is the maximum time to wait before running a force failover process This is helpful for a scenario where the old primary is not available and it has the most updated wal lsn Doing force failover may or may not end up loosing data depending on any wrtie transaction in the range lagged lsn between the new primary and the old primary", + Description: "ForceFailoverAcceptingDataLossAfter is the maximum time to wait before running a force failover process This is helpful for a scenario where the old primary is not available and it has the most updated wal lsn Doing force failover may or may not end up loosing data depending on any wrtie transaction in the range lagged lsn between the new primary and the old primary", Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), }, }, @@ -31084,6 +31228,11 @@ func schema_apimachinery_apis_kubedb_v1_PostgresSpec(ref common.ReferenceCallbac Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), }, }, + "configuration": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1.PostgresConfiguration"), + }, + }, "podTemplate": { SchemaProps: spec.SchemaProps{ Description: "PodTemplate is an optional configuration for pods used to expose database", @@ -31162,17 +31311,12 @@ func schema_apimachinery_apis_kubedb_v1_PostgresSpec(ref common.ReferenceCallbac Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1.PostgresReplication"), }, }, - "tuning": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1.PostgresTuningConfig"), - }, - }, }, Required: []string{"version"}, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.AllowedConsumers", "kubedb.dev/apimachinery/apis/kubedb/v1.ArbiterSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.Archiver", "kubedb.dev/apimachinery/apis/kubedb/v1.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.InitSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.PostgreLeaderElectionConfig", "kubedb.dev/apimachinery/apis/kubedb/v1.PostgresReplication", "kubedb.dev/apimachinery/apis/kubedb/v1.PostgresTuningConfig", "kubedb.dev/apimachinery/apis/kubedb/v1.RemoteReplicaSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.SecretReference"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.AllowedConsumers", "kubedb.dev/apimachinery/apis/kubedb/v1.ArbiterSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.Archiver", "kubedb.dev/apimachinery/apis/kubedb/v1.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.InitSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.PostgreLeaderElectionConfig", "kubedb.dev/apimachinery/apis/kubedb/v1.PostgresConfiguration", "kubedb.dev/apimachinery/apis/kubedb/v1.PostgresReplication", "kubedb.dev/apimachinery/apis/kubedb/v1.RemoteReplicaSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.SecretReference"}, } } @@ -31230,9 +31374,9 @@ func schema_apimachinery_apis_kubedb_v1_PostgresTuningConfig(ref common.Referenc Description: "PostgresTuningConfig defines configuration for PostgreSQL performance tuning", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "tuningProfile": { + "profile": { SchemaProps: spec.SchemaProps{ - Description: "TuningProfile defines a predefined tuning profile for different workload types. If specified, other tuning parameters will be calculated based on this profile.", + Description: "Profile defines a predefined tuning profile for different workload types. If specified, other tuning parameters will be calculated based on this profile.", Type: []string{"string"}, Format: "", }, @@ -31244,12 +31388,6 @@ func schema_apimachinery_apis_kubedb_v1_PostgresTuningConfig(ref common.Referenc Format: "int32", }, }, - "resourcesOverride": { - SchemaProps: spec.SchemaProps{ - Description: "ResourcesOverride allows overriding resource calculations. If specified, these values will be used instead of pod resource limits/requests.", - Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1.TuningResourcesOverride"), - }, - }, "storageType": { SchemaProps: spec.SchemaProps{ Description: "StorageType defines the type of storage for tuning purposes. If not specified, it will be inferred from StorageClass or default to HDD.", @@ -31267,8 +31405,6 @@ func schema_apimachinery_apis_kubedb_v1_PostgresTuningConfig(ref common.Referenc }, }, }, - Dependencies: []string{ - "kubedb.dev/apimachinery/apis/kubedb/v1.TuningResourcesOverride"}, } } @@ -31367,6 +31503,53 @@ func schema_apimachinery_apis_kubedb_v1_ProxySQLConfiguration(ref common.Referen } } +func schema_apimachinery_apis_kubedb_v1_ProxySQLConfigurationSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "init": { + SchemaProps: spec.SchemaProps{ + Description: "Init contains bootstrap-only configuration. This configuration is applied only once during initial deployment. Changes to this field after the database is initialized are ignored.", + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1.ProxySQLInitConfiguration"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "kubedb.dev/apimachinery/apis/kubedb/v1.ProxySQLInitConfiguration"}, + } +} + +func schema_apimachinery_apis_kubedb_v1_ProxySQLInitConfiguration(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "inline": { + SchemaProps: spec.SchemaProps{ + Description: "Inline contains structured bootstrap configuration. These values always take precedence over ConfigSecret.", + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1.ProxySQLConfiguration"), + }, + }, + "secretName": { + SchemaProps: spec.SchemaProps{ + Description: "a Secret containing raw bootstrap config files for ProxySQL. Allowed keys: AdminVariables.cnf, MySQLVariables.cnf, MySQLUsers.cnf, MySQLQueryRules.cnf. Values are patched verbatim into proxysql.cnf during bootstrap. Inline configuration (init.inline) always takes precedence. These configs are applied only once; invalid formatting may cause startup failure.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "kubedb.dev/apimachinery/apis/kubedb/v1.ProxySQLConfiguration"}, + } +} + func schema_apimachinery_apis_kubedb_v1_ProxySQLList(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -31430,7 +31613,7 @@ func schema_apimachinery_apis_kubedb_v1_ProxySQLSpec(ref common.ReferenceCallbac }, "syncUsers": { SchemaProps: spec.SchemaProps{ - Description: "SyncUsers is a boolean type and when enabled, operator fetches all users created in the backend server to the ProxySQL server . Password changes are also synced in proxysql when it is enabled.", + Description: "SyncUsers is a boolean type and when enabled, operator fetches all users created in the backend server to the ProxySQL server. Password changes are also synced in proxysql when it is enabled.", Type: []string{"boolean"}, Format: "", }, @@ -31441,6 +31624,18 @@ func schema_apimachinery_apis_kubedb_v1_ProxySQLSpec(ref common.ReferenceCallbac Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1.ProxySQLConfiguration"), }, }, + "configSecret": { + SchemaProps: spec.SchemaProps{ + Description: "ConfigSecret is an optional field to provide custom configuration file for proxysql. Users can provide a Secret containing raw bootstrap config files for ProxySQL. Allowed keys: AdminVariables.cnf, MySQLVariables.cnf, MySQLUsers.cnf, MySQLQueryRules.cnf. Values are patched verbatim into proxysql.cnf during bootstrap. InitConfiguration (spec.initConfig) takes precedence than this. These configs are applied only once; invalid formatting may cause startup failure.", + Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + }, + }, + "configuration": { + SchemaProps: spec.SchemaProps{ + Description: "Configuration is an optional field to provide custom configuration for ProxySQL. If specified, these configurations will be used with default configurations (if any). Configurations from this spec will override default configurations.", + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1.ProxySQLConfigurationSpec"), + }, + }, "version": { SchemaProps: spec.SchemaProps{ Description: "Version of ProxySQL to be deployed.", @@ -31451,7 +31646,7 @@ func schema_apimachinery_apis_kubedb_v1_ProxySQLSpec(ref common.ReferenceCallbac }, "replicas": { SchemaProps: spec.SchemaProps{ - Description: "Number of instances to deploy for ProxySQL. Currently we support only replicas = 1.", + Description: "Number of instances to deploy for ProxySQL. If replicas > 1, ProxySQL servers will be clustered.", Type: []string{"integer"}, Format: "int32", }, @@ -31474,12 +31669,6 @@ func schema_apimachinery_apis_kubedb_v1_ProxySQLSpec(ref common.ReferenceCallbac Ref: ref("kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec"), }, }, - "configSecret": { - SchemaProps: spec.SchemaProps{ - Description: "ConfigSecret is an optional field to provide custom configuration file for proxysql (i.e custom-proxysql.cnf). If specified, this file will be used as configuration file otherwise default configuration file will be used.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, "podTemplate": { SchemaProps: spec.SchemaProps{ Description: "PodTemplate is an optional configuration for pods used to expose proxysql", @@ -31533,7 +31722,7 @@ func schema_apimachinery_apis_kubedb_v1_ProxySQLSpec(ref common.ReferenceCallbac }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.ProxySQLConfiguration", "kubedb.dev/apimachinery/apis/kubedb/v1.SecretReference"}, + "k8s.io/api/core/v1.LocalObjectReference", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.ProxySQLConfiguration", "kubedb.dev/apimachinery/apis/kubedb/v1.ProxySQLConfigurationSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.SecretReference"}, } } @@ -31739,6 +31928,49 @@ func schema_apimachinery_apis_kubedb_v1_RedisClusterSpec(ref common.ReferenceCal } } +func schema_apimachinery_apis_kubedb_v1_RedisConfiguration(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "secretName": { + SchemaProps: spec.SchemaProps{ + Description: "SecretName is an optional field to provide custom configuration file for the database (i.e. elasticsearch.yml, mongod.conf ..). If specified, these configurations will be used with default configurations (if any) and applyConfig configurations (if any). configurations from this secret will override default configurations. This secret must be created by user.", + Type: []string{"string"}, + Format: "", + }, + }, + "inline": { + SchemaProps: spec.SchemaProps{ + Description: "Inline contains key-value pairs of configurations to be applied to the database. These configurations will override both default configurations and configurations from the config secret (if any).", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "acl": { + SchemaProps: spec.SchemaProps{ + Description: "Redis ACL Configuration", + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1.RedisAclSpec"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "kubedb.dev/apimachinery/apis/kubedb/v1.RedisAclSpec"}, + } +} + func schema_apimachinery_apis_kubedb_v1_RedisList(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -32077,6 +32309,12 @@ func schema_apimachinery_apis_kubedb_v1_RedisSpec(ref common.ReferenceCallback) SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ + "acl": { + SchemaProps: spec.SchemaProps{ + Description: "Redis ACL Configuration", + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1.RedisAclSpec"), + }, + }, "autoOps": { SchemaProps: spec.SchemaProps{ Description: "AutoOps contains configuration of automatic ops-request-recommendation generation", @@ -32136,12 +32374,6 @@ func schema_apimachinery_apis_kubedb_v1_RedisSpec(ref common.ReferenceCallback) Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1.SecretReference"), }, }, - "acl": { - SchemaProps: spec.SchemaProps{ - Description: "Redis ACL Configuration", - Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1.RedisAclSpec"), - }, - }, "disableAuth": { SchemaProps: spec.SchemaProps{ Description: "If disable Auth true then don't create any auth secret", @@ -32167,6 +32399,11 @@ func schema_apimachinery_apis_kubedb_v1_RedisSpec(ref common.ReferenceCallback) Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), }, }, + "configuration": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1.RedisConfiguration"), + }, + }, "podTemplate": { SchemaProps: spec.SchemaProps{ Description: "PodTemplate is an optional configuration for pods used to expose database", @@ -32226,7 +32463,7 @@ func schema_apimachinery_apis_kubedb_v1_RedisSpec(ref common.ReferenceCallback) }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.AllowedConsumers", "kubedb.dev/apimachinery/apis/kubedb/v1.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.InitSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.RedisAclSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.RedisClusterSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.RedisSentinelRef", "kubedb.dev/apimachinery/apis/kubedb/v1.SecretReference"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.AllowedConsumers", "kubedb.dev/apimachinery/apis/kubedb/v1.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.InitSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.RedisAclSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.RedisClusterSpec", "kubedb.dev/apimachinery/apis/kubedb/v1.RedisConfiguration", "kubedb.dev/apimachinery/apis/kubedb/v1.RedisSentinelRef", "kubedb.dev/apimachinery/apis/kubedb/v1.SecretReference"}, } } @@ -32655,34 +32892,6 @@ func schema_apimachinery_apis_kubedb_v1_SystemUserSecretsSpec(ref common.Referen } } -func schema_apimachinery_apis_kubedb_v1_TuningResourcesOverride(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "TuningResourcesOverride allows overriding resource calculations for tuning", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "memory": { - SchemaProps: spec.SchemaProps{ - Description: "Memory overrides the total memory used for tuning calculations. Format: \"1Gi\", \"512Mi\", etc.", - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - "cpu": { - SchemaProps: spec.SchemaProps{ - Description: "CPU overrides the CPU count used for tuning calculations.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/api/resource.Quantity"}, - } -} - func schema_apimachinery_apis_kubedb_v1_elasticsearchApp(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/perconaxtradb_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/perconaxtradb_helpers.go index 8b3b4d9dc..f8656e794 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/perconaxtradb_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/perconaxtradb_helpers.go @@ -87,6 +87,10 @@ func (p PerconaXtraDB) offshootLabels(selector, override map[string]string) map[ return meta_util.FilterKeys(kubedb.GroupName, selector, meta_util.OverwriteKeys(nil, p.Labels, override)) } +func (m PerconaXtraDB) AddKeyPrefix(key string) string { + return meta_util.NameWithPrefix(kubedb.InlineConfigKeyPrefixZZ, key) +} + func (p PerconaXtraDB) ResourceFQN() string { return fmt.Sprintf("%s.%s", ResourcePluralPerconaXtraDB, kubedb.GroupName) } @@ -189,7 +193,8 @@ func (p perconaXtraDBStatsService) Path() string { } func (p perconaXtraDBStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (p perconaXtraDBStatsService) TLSConfig() *promapi.TLSConfig { @@ -228,12 +233,14 @@ func (p *PerconaXtraDB) SetDefaults(pVersion *v1alpha1.PerconaXtraDBVersion) { p.Spec.PodTemplate.Spec.ServiceAccountName = p.OffshootName() } + p.Spec.Configuration = copyConfigurationField(p.Spec.Configuration, &p.Spec.ConfigSecret) // Need to set FSGroup equal to p.Spec.PodTemplate.Spec.ContainerSecurityContext.RunAsGroup. // So that /var/pv directory have the group permission for the RunAsGroup user GID. // Otherwise, We will get write permission denied. p.setDefaultContainerSecurityContext(pVersion, &p.Spec.PodTemplate) p.setDefaultContainerResourceLimits(&p.Spec.PodTemplate) p.SetTLSDefaults() + p.Spec.Monitor.SetDefaults() if p.Spec.Monitor != nil && p.Spec.Monitor.Prometheus != nil { if p.Spec.Monitor.Prometheus.Exporter.SecurityContext.RunAsUser == nil { @@ -410,3 +417,8 @@ func (p *PerconaXtraDB) CertMountPath(alias PerconaXtraDBCertificateAlias) strin func (p *PerconaXtraDB) CertFilePath(certAlias PerconaXtraDBCertificateAlias, certFileName string) string { return filepath.Join(p.CertMountPath(certAlias), certFileName) } + +func (p *PerconaXtraDB) ConfigSecretName() string { + uid := string(p.UID) + return meta_util.NameWithSuffix(p.OffshootName(), uid[len(uid)-6:]) +} diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/perconaxtradb_types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/perconaxtradb_types.go index faed2ce8e..7cd0bf874 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/perconaxtradb_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/perconaxtradb_types.go @@ -84,6 +84,9 @@ type PerconaXtraDBSpec struct { // If specified, this file will be used as configuration file otherwise default configuration file will be used. ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + // +optional + Configuration *ConfigurationSpec `json:"configuration,omitempty"` + // PodTemplate is an optional configuration for pods used to expose database // +optional PodTemplate ofstv2.PodTemplateSpec `json:"podTemplate,omitempty"` diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/pgbouncer_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/pgbouncer_helpers.go index 9f10c5283..3613930e0 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/pgbouncer_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/pgbouncer_helpers.go @@ -145,7 +145,8 @@ func (p PgBouncer) GetPgBouncerFinalConfigSecret(kc client.Client) (*core.Secret } func (p PgBouncer) PgBouncerFinalConfigSecretName() string { - return meta_util.NameWithSuffix(p.ServiceName(), "final-config") + uid := string(p.UID) + return meta_util.NameWithSuffix(p.OffshootName(), uid[len(uid)-6:]) } type pgbouncerApp struct { @@ -189,7 +190,8 @@ func (p pgbouncerStatsService) Path() string { } func (p pgbouncerStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (p pgbouncerStatsService) TLSConfig() *promapi.TLSConfig { @@ -234,6 +236,8 @@ func (p *PgBouncer) SetDefaults(pgBouncerVersion *catalog.PgBouncerVersion, uses p.Spec.AuthSecret.Kind = kubedb.ResourceKindSecret } + p.Spec.Configuration = copyConfigurationField(p.Spec.Configuration, &p.Spec.ConfigSecret) + p.setPgBouncerContainerDefaults(&p.Spec.PodTemplate, pgBouncerVersion) p.setDefaultPodSecurityContext() diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/pgbouncer_types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/pgbouncer_types.go index ab0b0cdd5..80dca126a 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/pgbouncer_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/pgbouncer_types.go @@ -87,6 +87,9 @@ type PgBouncerSpec struct { // If specified, this file will be used as configuration file otherwise default configuration file will be used. ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + // +optional + Configuration *ConfigurationSpec `json:"configuration,omitempty"` + // Init is used to initialize database // +optional Init *InitSpec `json:"init,omitempty"` diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/postgres_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/postgres_helpers.go index b115f6778..47d519918 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/postgres_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/postgres_helpers.go @@ -179,6 +179,11 @@ func (p Postgres) OffshootDistributedGRPCSecretName() string { return meta_util.NameWithSuffix(p.OffshootName(), kubedb.DistributedGRPCSecretNameSuffix) } +func (p Postgres) ConfigSecretName() string { + uid := string(p.UID) + return meta_util.NameWithSuffix(p.OffshootName(), uid[len(uid)-6:]) +} + type postgresApp struct { *Postgres } @@ -220,7 +225,8 @@ func (p postgresStatsService) Path() string { } func (p postgresStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (p postgresStatsService) TLSConfig() *promapi.TLSConfig { @@ -302,6 +308,7 @@ func (p *Postgres) SetDefaults(postgresVersion *catalog.PostgresVersion) { } } + p.updateConfigurationFieldIfNeeded() p.SetDefaultPodSecurityContext(&p.Spec.PodTemplate, postgresVersion) p.SetPostgresContainerDefaults(&p.Spec.PodTemplate, postgresVersion) p.SetCoordinatorContainerDefaults(&p.Spec.PodTemplate, postgresVersion) @@ -349,6 +356,18 @@ func getMajorPgVersion(postgresVersion *catalog.PostgresVersion) (uint64, error) return ver.Major(), nil } +func (p *Postgres) updateConfigurationFieldIfNeeded() { + if p.Spec.Configuration == nil && p.Spec.ConfigSecret != nil { + p.Spec.Configuration = &PostgresConfiguration{ + ConfigurationSpec: ConfigurationSpec{SecretName: p.Spec.ConfigSecret.Name}, + } + p.Spec.ConfigSecret = nil + } else if p.Spec.ConfigSecret != nil && p.Spec.Configuration != nil && p.Spec.Configuration.SecretName == "" { + p.Spec.Configuration.SecretName = p.Spec.ConfigSecret.Name + p.Spec.ConfigSecret = nil + } +} + // SetDefaultReplicationMode set the default replication mode. // Replication slot will be prioritized if no WalLimitPolicy is mentioned func (p *Postgres) SetDefaultReplicationMode(postgresVersion *catalog.PostgresVersion) { diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/postgres_types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/postgres_types.go index 350b5597d..672a4401c 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/postgres_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/postgres_types.go @@ -18,7 +18,6 @@ package v1 import ( core "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" kmapi "kmodules.xyz/client-go/api/v1" mona "kmodules.xyz/monitoring-agent-api/api/v1" @@ -118,6 +117,8 @@ type PostgresSpec struct { // If specified, this file will be used as configuration file otherwise default configuration file will be used. ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + Configuration *PostgresConfiguration `json:"configuration,omitempty"` + // PodTemplate is an optional configuration for pods used to expose database // +optional PodTemplate ofstv2.PodTemplateSpec `json:"podTemplate,omitempty"` @@ -168,7 +169,10 @@ type PostgresSpec struct { // +optional Replication *PostgresReplication `json:"replication,omitempty"` +} +type PostgresConfiguration struct { + ConfigurationSpec `json:",inline,omitempty"` // +optional Tuning *PostgresTuningConfig `json:"tuning,omitempty"` } @@ -192,12 +196,12 @@ type PostgresReplication struct { // +optional MaxSlotWALKeepSizeInMegaBytes *int32 `json:"maxSlotWALKeepSize,omitempty"` - // ForceFailOverAcceptingDataLossAfter is the maximum time to wait before running a force failover process + // ForceFailoverAcceptingDataLossAfter is the maximum time to wait before running a force failover process // This is helpful for a scenario where the old primary is not available and it has the most updated wal lsn // Doing force failover may or may not end up loosing data depending on any wrtie transaction // in the range lagged lsn between the new primary and the old primary // +optional - ForceFailOverAcceptingDataLossAfter *metav1.Duration `json:"forceFailOverAcceptingDataLossAfter,omitempty"` + ForceFailoverAcceptingDataLossAfter *metav1.Duration `json:"forceFailoverAcceptingDataLossAfter,omitempty"` } type ArbiterSpec struct { @@ -398,25 +402,18 @@ const ( // PostgresTuningConfig defines configuration for PostgreSQL performance tuning type PostgresTuningConfig struct { - // TuningProfile defines a predefined tuning profile for different workload types. + // Profile defines a predefined tuning profile for different workload types. // If specified, other tuning parameters will be calculated based on this profile. - // +kubebuilder:validation:Enum=web;oltp;dw;mixed;desktop // +optional - TuningProfile *PostgresTuningProfile `json:"tuningProfile,omitempty"` + Profile *PostgresProfile `json:"profile,omitempty"` // MaxConnections defines the maximum number of concurrent connections. // If not specified, it will be calculated based on available memory and tuning profile. // +optional MaxConnections *int32 `json:"maxConnections,omitempty"` - // ResourcesOverride allows overriding resource calculations. - // If specified, these values will be used instead of pod resource limits/requests. - // +optional - ResourcesOverride *TuningResourcesOverride `json:"resourcesOverride,omitempty"` - // StorageType defines the type of storage for tuning purposes. // If not specified, it will be inferred from StorageClass or default to HDD. - // +kubebuilder:validation:Enum=ssd;hdd;san // +optional StorageType *PostgresStorageType `json:"storageType,omitempty"` @@ -426,39 +423,29 @@ type PostgresTuningConfig struct { DisableAutoTune bool `json:"disableAutoTune,omitempty"` } -// TuningResourcesOverride allows overriding resource calculations for tuning -type TuningResourcesOverride struct { - // Memory overrides the total memory used for tuning calculations. - // Format: "1Gi", "512Mi", etc. - // +optional - Memory *resource.Quantity `json:"memory,omitempty"` - - // CPU overrides the CPU count used for tuning calculations. - // +optional - CPU *int32 `json:"cpu,omitempty"` -} - -// PostgresTuningProfile defines predefined tuning profiles -type PostgresTuningProfile string +// PostgresProfile defines predefined tuning profiles +// +kubebuilder:validation:Enum=web;oltp;dw;mixed;desktop +type PostgresProfile string const ( // PostgresTuningProfileWeb optimizes for web applications with many simple queries - PostgresTuningProfileWeb PostgresTuningProfile = "web" + PostgresTuningProfileWeb PostgresProfile = "web" // PostgresTuningProfileOLTP optimizes for OLTP workloads with many short transactions - PostgresTuningProfileOLTP PostgresTuningProfile = "oltp" + PostgresTuningProfileOLTP PostgresProfile = "oltp" // PostgresTuningProfileDW optimizes for data warehousing with complex analytical queries - PostgresTuningProfileDW PostgresTuningProfile = "dw" + PostgresTuningProfileDW PostgresProfile = "dw" // PostgresTuningProfileMixed optimizes for mixed workloads - PostgresTuningProfileMixed PostgresTuningProfile = "mixed" + PostgresTuningProfileMixed PostgresProfile = "mixed" // PostgresTuningProfileDesktop optimizes for desktop or development environments - PostgresTuningProfileDesktop PostgresTuningProfile = "desktop" + PostgresTuningProfileDesktop PostgresProfile = "desktop" ) // PostgresStorageType defines storage types for tuning purposes +// +kubebuilder:validation:Enum=ssd;hdd;san type PostgresStorageType string const ( diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/proxysql_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/proxysql_helpers.go index 4cd8e44c1..53554e597 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/proxysql_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/proxysql_helpers.go @@ -113,6 +113,34 @@ func (p ProxySQL) GetAuthSecretName() string { return meta_util.NameWithSuffix(p.OffshootName(), "auth") } +func (p ProxySQL) ConfigSecretName() string { + uid := string(p.UID) + return meta_util.NameWithSuffix(p.OffshootName(), uid[len(uid)-6:]) +} + +// HasInitConfigSecretName safely checks if ps.Spec.Configuration.Init.SecretName is set +func (p *ProxySQL) HasInitConfigSecretName() bool { + return p.Spec.Configuration != nil && + p.Spec.Configuration.Init != nil && + p.Spec.Configuration.Init.SecretName != "" +} + +// GetInitConfigInline safely returns p.Spec.Configuration.Init.Inline or nil +func (p *ProxySQL) GetInitConfigInline() *ProxySQLConfiguration { + if p.Spec.Configuration != nil && p.Spec.Configuration.Init != nil { + return p.Spec.Configuration.Init.Inline + } + return nil +} + +// InitConfigSecretName safely returns p.Spec.Configuration.Init.SecretName or empty string +func (p *ProxySQL) InitConfigSecretName() string { + if !p.HasInitConfigSecretName() { + return "" + } + return p.Spec.Configuration.Init.SecretName +} + func (p ProxySQL) ServiceName() string { return p.OffshootName() } @@ -157,16 +185,13 @@ func (p proxysqlStatsService) ServiceMonitorAdditionalLabels() map[string]string return p.OffshootLabels() } -func GetConfigurationSecretName(psName string) string { - return meta_util.NameWithSuffix(psName, "configuration") -} - func (p proxysqlStatsService) Path() string { return kubedb.DefaultStatsPath } func (p proxysqlStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (p proxysqlStatsService) TLSConfig() *promapi.TLSConfig { @@ -201,6 +226,7 @@ func (p *ProxySQL) SetDefaults(psVersion *v1alpha1.ProxySQLVersion, usesAcme boo p.Spec.AuthSecret.Kind = kubedb.ResourceKindSecret } + p.copyConfigurationFields() p.setDefaultContainerSecurityContext(psVersion, &p.Spec.PodTemplate) p.Spec.Monitor.SetDefaults() @@ -333,3 +359,31 @@ func (m *ProxySQL) IsCluster() bool { r := m.Spec.Replicas return *r > 1 } + +func (p *ProxySQL) copyConfigurationFields() { + if p.Spec.ConfigSecret == nil && p.Spec.InitConfiguration == nil { + return + } + + if p.Spec.Configuration == nil { + p.Spec.Configuration = &ProxySQLConfigurationSpec{} + } + + if p.Spec.Configuration.Init == nil { + p.Spec.Configuration.Init = &ProxySQLInitConfiguration{} + } + + // Copy deprecated ConfigSecret to Configuration.Init.SecretName + if p.Spec.ConfigSecret != nil && p.Spec.Configuration.Init.SecretName == "" { + p.Spec.Configuration.Init.SecretName = p.Spec.ConfigSecret.Name + } + + // Copy deprecated InitConfiguration to Configuration.Init.Inline + if p.Spec.InitConfiguration != nil && p.Spec.Configuration.Init.Inline == nil { + p.Spec.Configuration.Init.Inline = p.Spec.InitConfiguration + } + + // Clear deprecated fields after copying + p.Spec.ConfigSecret = nil + p.Spec.InitConfiguration = nil +} diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/proxysql_types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/proxysql_types.go index 985c248f8..89e519fac 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/proxysql_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/proxysql_types.go @@ -40,6 +40,15 @@ const ( LoadBalanceModeGroupReplication LoadBalanceMode = "GroupReplication" ) +// +kubebuilder:validation:Enum=server;archiver;metrics-exporter +type ProxySQLCertificateAlias string + +const ( + ProxySQLServerCert ProxySQLCertificateAlias = "server" + ProxySQLClientCert ProxySQLCertificateAlias = "client" + ProxySQLMetricsExporterCert ProxySQLCertificateAlias = "metrics-exporter" +) + // ProxySQL defines a percona variation of Mysql database. // +genclient @@ -60,44 +69,101 @@ type ProxySQL struct { Status ProxySQLStatus `json:"status,omitempty"` } -type MySQLUser struct { - Username string `json:"username"` +type ProxySQLSpec struct { + // AutoOps contains configuration of automatic ops-request-recommendation generation + // +optional + AutoOps AutoOpsSpec `json:"autoOps,omitempty"` // +optional - Active *int `json:"active,omitempty"` + // SyncUsers is a boolean type and when enabled, operator fetches all users created in the backend server to the + // ProxySQL server. Password changes are also synced in proxysql when it is enabled. + SyncUsers bool `json:"syncUsers,omitempty"` // +optional - UseSSL int `json:"use_ssl,omitempty"` + // +kubebuilder:deprecatedversion:warning="Use spec.configuration.init.inline instead" + // InitConfiguration contains information with which the proxysql will bootstrap (only 4 tables are configurable) + InitConfiguration *ProxySQLConfiguration `json:"initConfig,omitempty"` // +optional - DefaultHostgroup int `json:"default_hostgroup,omitempty"` + // +kubebuilder:deprecatedversion:warning="Use spec.configuration.init.secretName instead" + // ConfigSecret is an optional field to provide custom configuration file for proxysql. + // Users can provide a Secret containing raw bootstrap config files for ProxySQL. + // Allowed keys: AdminVariables.cnf, MySQLVariables.cnf, MySQLUsers.cnf, MySQLQueryRules.cnf. + // Values are patched verbatim into proxysql.cnf during bootstrap. + // InitConfiguration (spec.initConfig) takes precedence than this. + // These configs are applied only once; invalid formatting may cause startup failure. + ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` // +optional - DefaultSchema string `json:"default_schema,omitempty"` + // Configuration is an optional field to provide custom configuration for ProxySQL. + // If specified, these configurations will be used with default configurations (if any). + // Configurations from this spec will override default configurations. + Configuration *ProxySQLConfigurationSpec `json:"configuration,omitempty"` + + // Version of ProxySQL to be deployed. + Version string `json:"version"` + + // Number of instances to deploy for ProxySQL. If replicas > 1, ProxySQL servers will be clustered. + Replicas *int32 `json:"replicas,omitempty"` + + // Backend refers to the AppBinding of the backend MySQL/MariaDB/Percona-XtraDB server + Backend *core.LocalObjectReference `json:"backend,omitempty"` + // ProxySQL secret containing username and password for root user and proxysql user // +optional - SchemaLocked int `json:"schema_locked,omitempty"` + AuthSecret *SecretReference `json:"authSecret,omitempty"` + // Monitor is used monitor proxysql instance // +optional - TransactionPersistent *int `json:"transaction_persistent,omitempty"` + Monitor *mona.AgentSpec `json:"monitor,omitempty"` + // PodTemplate is an optional configuration for pods used to expose proxysql // +optional - FastForward int `json:"fast_forward,omitempty"` + PodTemplate ofstv2.PodTemplateSpec `json:"podTemplate,omitempty"` + // ServiceTemplates is an optional configuration for services used to expose database // +optional - Backend *int `json:"backend,omitempty"` + ServiceTemplates []NamedServiceTemplateSpec `json:"serviceTemplates,omitempty"` + // TLS contains tls configurations for client and server. // +optional - Frontend *int `json:"frontend,omitempty"` + TLS *kmapi.TLSConfig `json:"tls,omitempty"` + // DeletionPolicy controls the delete operation for database // +optional - MaxConnections *int32 `json:"max_connections,omitempty"` + DeletionPolicy DeletionPolicy `json:"deletionPolicy,omitempty"` + // HealthChecker defines attributes of the health checker // +optional - Attributes string `json:"attributes,omitempty"` + // +kubebuilder:default={periodSeconds: 10, timeoutSeconds: 10, failureThreshold: 1} + HealthChecker kmapi.HealthCheckSpec `json:"healthChecker"` + // Indicates that the database is halted and all offshoot Kubernetes resources except PVCs are deleted. // +optional - Comment string `json:"comment,omitempty"` + Halted bool `json:"halted,omitempty"` +} + +type ProxySQLConfigurationSpec struct { + // +optional + // Init contains bootstrap-only configuration. + // This configuration is applied only once during initial deployment. + // Changes to this field after the database is initialized are ignored. + Init *ProxySQLInitConfiguration `json:"init,omitempty"` +} + +type ProxySQLInitConfiguration struct { + // +optional + // Inline contains structured bootstrap configuration. + // These values always take precedence over ConfigSecret. + Inline *ProxySQLConfiguration `json:"inline,omitempty"` + + // +optional + // a Secret containing raw bootstrap config files for ProxySQL. + // Allowed keys: AdminVariables.cnf, MySQLVariables.cnf, MySQLUsers.cnf, MySQLQueryRules.cnf. + // Values are patched verbatim into proxysql.cnf during bootstrap. + // Inline configuration (init.inline) always takes precedence. + // These configs are applied only once; invalid formatting may cause startup failure. + SecretName string `json:"secretName,omitempty"` } type ProxySQLConfiguration struct { @@ -117,77 +183,46 @@ type ProxySQLConfiguration struct { AdminVariables *runtime.RawExtension `json:"adminVariables,omitempty"` } -type ProxySQLSpec struct { - // AutoOps contains configuration of automatic ops-request-recommendation generation - // +optional - AutoOps AutoOpsSpec `json:"autoOps,omitempty"` +type MySQLUser struct { + Username string `json:"username"` // +optional - // SyncUsers is a boolean type and when enabled, operator fetches all users created in the backend server to the - // ProxySQL server . Password changes are also synced in proxysql when it is enabled. - SyncUsers bool `json:"syncUsers,omitempty"` + Active *int `json:"active,omitempty"` // +optional - // InitConfiguration contains information with which the proxysql will bootstrap (only 4 tables are configurable) - InitConfiguration *ProxySQLConfiguration `json:"initConfig,omitempty"` - - // Version of ProxySQL to be deployed. - Version string `json:"version"` - - // Number of instances to deploy for ProxySQL. Currently we support only replicas = 1. - // TODO: If replicas > 1, proxysql will be clustered - Replicas *int32 `json:"replicas,omitempty"` + UseSSL int `json:"use_ssl,omitempty"` - // Backend refers to the AppBinding of the backend MySQL/MariaDB/Percona-XtraDB server - Backend *core.LocalObjectReference `json:"backend,omitempty"` + // +optional + DefaultHostgroup int `json:"default_hostgroup,omitempty"` - // ProxySQL secret containing username and password for root user and proxysql user // +optional - AuthSecret *SecretReference `json:"authSecret,omitempty"` + DefaultSchema string `json:"default_schema,omitempty"` - // Monitor is used monitor proxysql instance // +optional - Monitor *mona.AgentSpec `json:"monitor,omitempty"` + SchemaLocked int `json:"schema_locked,omitempty"` - // ConfigSecret is an optional field to provide custom configuration file for proxysql (i.e custom-proxysql.cnf). - // If specified, this file will be used as configuration file otherwise default configuration file will be used. - ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + // +optional + TransactionPersistent *int `json:"transaction_persistent,omitempty"` - // PodTemplate is an optional configuration for pods used to expose proxysql // +optional - PodTemplate ofstv2.PodTemplateSpec `json:"podTemplate,omitempty"` + FastForward int `json:"fast_forward,omitempty"` - // ServiceTemplates is an optional configuration for services used to expose database // +optional - ServiceTemplates []NamedServiceTemplateSpec `json:"serviceTemplates,omitempty"` + Backend *int `json:"backend,omitempty"` - // TLS contains tls configurations for client and server. // +optional - TLS *kmapi.TLSConfig `json:"tls,omitempty"` + Frontend *int `json:"frontend,omitempty"` - // DeletionPolicy controls the delete operation for database // +optional - DeletionPolicy DeletionPolicy `json:"deletionPolicy,omitempty"` + MaxConnections *int32 `json:"max_connections,omitempty"` - // HealthChecker defines attributes of the health checker // +optional - // +kubebuilder:default={periodSeconds: 10, timeoutSeconds: 10, failureThreshold: 1} - HealthChecker kmapi.HealthCheckSpec `json:"healthChecker"` + Attributes string `json:"attributes,omitempty"` - // Indicates that the database is halted and all offshoot Kubernetes resources except PVCs are deleted. // +optional - Halted bool `json:"halted,omitempty"` + Comment string `json:"comment,omitempty"` } -// +kubebuilder:validation:Enum=server;archiver;metrics-exporter -type ProxySQLCertificateAlias string - -const ( - ProxySQLServerCert ProxySQLCertificateAlias = "server" - ProxySQLClientCert ProxySQLCertificateAlias = "client" - ProxySQLMetricsExporterCert ProxySQLCertificateAlias = "metrics-exporter" -) - type ProxySQLStatus struct { // Specifies the current phase of the database // +optional diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/redis_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/redis_helpers.go index f1cc1b34e..77747ffb2 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/redis_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/redis_helpers.go @@ -133,11 +133,8 @@ func (r Redis) GoverningServiceName() string { } func (r Redis) ConfigSecretName() string { - return meta_util.NameWithSuffix(r.OffshootName(), "config") -} - -func (r Redis) CustomConfigSecretName() string { - return meta_util.NameWithSuffix(r.OffshootName(), "custom-config") + uid := string(r.UID) + return meta_util.NameWithSuffix(r.OffshootName(), uid[len(uid)-6:]) } func (r Redis) BaseNameForShard() string { @@ -193,7 +190,8 @@ func (r redisStatsService) Path() string { } func (r redisStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (r redisStatsService) TLSConfig() *promapi.TLSConfig { @@ -235,6 +233,8 @@ func (r *Redis) SetDefaults(rdVersion *catalog.RedisVersion) error { r.Spec.Replicas = pointer.Int32P(1) } + r.copyRedisConfigurationField() + // perform defaulting switch r.Spec.Mode { case "": @@ -296,6 +296,27 @@ func (r *Redis) SetDefaults(rdVersion *catalog.RedisVersion) error { return nil } +func (r *Redis) copyRedisConfigurationField() { + // Skip if there are no deprecated fields to copy + if r.Spec.ConfigSecret == nil && r.Spec.Acl == nil { + return + } + + // Initialize Configuration if nil + if r.Spec.Configuration == nil { + r.Spec.Configuration = &RedisConfiguration{} + } + + // Copy deprecated ConfigSecret to Configuration.SecretName + r.Spec.Configuration.ConfigurationSpec = *copyConfigurationField(&r.Spec.Configuration.ConfigurationSpec, &r.Spec.ConfigSecret) + + // Copy deprecated Acl to Configuration.Acl + if r.Spec.Configuration.Acl == nil && r.Spec.Acl != nil { + r.Spec.Configuration.Acl = r.Spec.Acl + r.Spec.Acl = nil + } +} + func (r *Redis) SetHealthCheckerDefaults() { if r.Spec.HealthChecker.PeriodSeconds == nil { r.Spec.HealthChecker.PeriodSeconds = pointer.Int32P(10) diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/redis_sentinel_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/redis_sentinel_helpers.go index 00cced07a..07f88c8bc 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/redis_sentinel_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/redis_sentinel_helpers.go @@ -168,7 +168,8 @@ func (rs redisSentinelStatsService) Path() string { } func (r redisSentinelStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (r redisSentinelStatsService) TLSConfig() *promapi.TLSConfig { diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/redis_types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/redis_types.go index a4b47bab2..348578095 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/redis_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/redis_types.go @@ -61,6 +61,10 @@ type Redis struct { } type RedisSpec struct { + // Redis ACL Configuration + // +optional + Acl *RedisAclSpec `json:"acl,omitempty"` + // AutoOps contains configuration of automatic ops-request-recommendation generation // +optional AutoOps AutoOpsSpec `json:"autoOps,omitempty"` @@ -90,10 +94,6 @@ type RedisSpec struct { // +optional AuthSecret *SecretReference `json:"authSecret,omitempty"` - // Redis ACL Configuration - // +optional - Acl *RedisAclSpec `json:"acl,omitempty"` - // If disable Auth true then don't create any auth secret // +optional DisableAuth bool `json:"disableAuth,omitempty"` @@ -110,6 +110,9 @@ type RedisSpec struct { // If specified, this file will be used as configuration file otherwise default configuration file will be used. ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + // +optional + Configuration *RedisConfiguration `json:"configuration,omitempty"` + // PodTemplate is an optional configuration for pods used to expose database // +optional PodTemplate ofstv2.PodTemplateSpec `json:"podTemplate,omitempty"` @@ -167,6 +170,14 @@ type RedisClusterSpec struct { Announce *Announce `json:"announce,omitempty"` } +type RedisConfiguration struct { + ConfigurationSpec `json:",inline,omitempty"` + + // Redis ACL Configuration + // +optional + Acl *RedisAclSpec `json:"acl,omitempty"` +} + // +kubebuilder:validation:Enum=ip;hostname type PreferredEndpointType string diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/types.go index a359c8297..b3259f5bd 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/types.go @@ -210,6 +210,20 @@ type Age struct { LastUpdateTimestamp metav1.Time `json:"lastUpdateTimestamp,omitempty"` } +type ConfigurationSpec struct { + // SecretName is an optional field to provide custom configuration file for the database (i.e. elasticsearch.yml, mongod.conf ..). + // If specified, these configurations will be used with default configurations (if any) and applyConfig configurations (if any). + // configurations from this secret will override default configurations. + // This secret must be created by user. + // +optional + SecretName string `json:"secretName,omitempty"` + + // Inline contains key-value pairs of configurations to be applied to the database. + // These configurations will override both default configurations and configurations from the config secret (if any). + // +optional + Inline map[string]string `json:"inline,omitempty"` +} + type Archiver struct { // Pause is used to stop the archiver backup for the database // +optional diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/zz_generated.deepcopy.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/zz_generated.deepcopy.go index 67cc56c8a..e1c5a39a2 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/zz_generated.deepcopy.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1/zz_generated.deepcopy.go @@ -219,6 +219,29 @@ func (in *BrokerRack) DeepCopy() *BrokerRack { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigurationSpec) DeepCopyInto(out *ConfigurationSpec) { + *out = *in + if in.Inline != nil { + in, out := &in.Inline, &out.Inline + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigurationSpec. +func (in *ConfigurationSpec) DeepCopy() *ConfigurationSpec { + if in == nil { + return nil + } + out := new(ConfigurationSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ConnectionPoolConfig) DeepCopyInto(out *ConnectionPoolConfig) { *out = *in @@ -559,6 +582,11 @@ func (in *ElasticsearchSpec) DeepCopyInto(out *ElasticsearchSpec) { *out = new(corev1.LocalObjectReference) **out = **in } + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(ConfigurationSpec) + (*in).DeepCopyInto(*out) + } if in.SecureConfigSecret != nil { in, out := &in.SecureConfigSecret, &out.SecureConfigSecret *out = new(corev1.LocalObjectReference) @@ -878,9 +906,9 @@ func (in *KafkaClusterTopology) DeepCopy() *KafkaClusterTopology { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *KafkaCruiseControl) DeepCopyInto(out *KafkaCruiseControl) { *out = *in - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(SecretReference) + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(ConfigurationSpec) (*in).DeepCopyInto(*out) } if in.Replicas != nil { @@ -888,7 +916,6 @@ func (in *KafkaCruiseControl) DeepCopyInto(out *KafkaCruiseControl) { *out = new(int32) **out = **in } - in.Resources.DeepCopyInto(&out.Resources) in.PodTemplate.DeepCopyInto(&out.PodTemplate) if in.BrokerCapacity != nil { in, out := &in.BrokerCapacity, &out.BrokerCapacity @@ -1002,6 +1029,11 @@ func (in *KafkaSpec) DeepCopyInto(out *KafkaSpec) { *out = new(corev1.LocalObjectReference) **out = **in } + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(ConfigurationSpec) + (*in).DeepCopyInto(*out) + } if in.KeystoreCredSecret != nil { in, out := &in.KeystoreCredSecret, &out.KeystoreCredSecret *out = new(SecretReference) @@ -1219,6 +1251,11 @@ func (in *MariaDBSpec) DeepCopyInto(out *MariaDBSpec) { *out = new(corev1.LocalObjectReference) **out = **in } + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(ConfigurationSpec) + (*in).DeepCopyInto(*out) + } in.PodTemplate.DeepCopyInto(&out.PodTemplate) if in.ServiceTemplates != nil { in, out := &in.ServiceTemplates, &out.ServiceTemplates @@ -1426,6 +1463,11 @@ func (in *MemcachedSpec) DeepCopyInto(out *MemcachedSpec) { *out = new(corev1.LocalObjectReference) **out = **in } + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(ConfigurationSpec) + (*in).DeepCopyInto(*out) + } if in.AuthSecret != nil { in, out := &in.AuthSecret, &out.AuthSecret *out = new(SecretReference) @@ -1494,6 +1536,11 @@ func (in *MongoArbiterNode) DeepCopyInto(out *MongoArbiterNode) { *out = new(corev1.LocalObjectReference) **out = **in } + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(ConfigurationSpec) + (*in).DeepCopyInto(*out) + } if in.PodTemplate != nil { in, out := &in.PodTemplate, &out.PodTemplate *out = new(v2.PodTemplateSpec) @@ -1625,6 +1672,11 @@ func (in *MongoDBNode) DeepCopyInto(out *MongoDBNode) { *out = new(corev1.LocalObjectReference) **out = **in } + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(ConfigurationSpec) + (*in).DeepCopyInto(*out) + } if in.PodTemplate != nil { in, out := &in.PodTemplate, &out.PodTemplate *out = new(v2.PodTemplateSpec) @@ -1759,6 +1811,11 @@ func (in *MongoDBSpec) DeepCopyInto(out *MongoDBSpec) { *out = new(corev1.LocalObjectReference) **out = **in } + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(ConfigurationSpec) + (*in).DeepCopyInto(*out) + } if in.PodTemplate != nil { in, out := &in.PodTemplate, &out.PodTemplate *out = new(v2.PodTemplateSpec) @@ -1851,6 +1908,11 @@ func (in *MongoHiddenNode) DeepCopyInto(out *MongoHiddenNode) { *out = new(corev1.LocalObjectReference) **out = **in } + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(ConfigurationSpec) + (*in).DeepCopyInto(*out) + } if in.PodTemplate != nil { in, out := &in.PodTemplate, &out.PodTemplate *out = new(v2.PodTemplateSpec) @@ -2039,6 +2101,11 @@ func (in *MySQLSpec) DeepCopyInto(out *MySQLSpec) { *out = new(corev1.LocalObjectReference) **out = **in } + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(ConfigurationSpec) + (*in).DeepCopyInto(*out) + } in.PodTemplate.DeepCopyInto(&out.PodTemplate) if in.ServiceTemplates != nil { in, out := &in.ServiceTemplates, &out.ServiceTemplates @@ -2303,6 +2370,11 @@ func (in *PerconaXtraDBSpec) DeepCopyInto(out *PerconaXtraDBSpec) { *out = new(corev1.LocalObjectReference) **out = **in } + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(ConfigurationSpec) + (*in).DeepCopyInto(*out) + } in.PodTemplate.DeepCopyInto(&out.PodTemplate) if in.ServiceTemplates != nil { in, out := &in.ServiceTemplates, &out.ServiceTemplates @@ -2462,6 +2534,11 @@ func (in *PgBouncerSpec) DeepCopyInto(out *PgBouncerSpec) { *out = new(corev1.LocalObjectReference) **out = **in } + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(ConfigurationSpec) + (*in).DeepCopyInto(*out) + } if in.Init != nil { in, out := &in.Init, &out.Init *out = new(InitSpec) @@ -2569,6 +2646,28 @@ func (in *Postgres) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PostgresConfiguration) DeepCopyInto(out *PostgresConfiguration) { + *out = *in + in.ConfigurationSpec.DeepCopyInto(&out.ConfigurationSpec) + if in.Tuning != nil { + in, out := &in.Tuning, &out.Tuning + *out = new(PostgresTuningConfig) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgresConfiguration. +func (in *PostgresConfiguration) DeepCopy() *PostgresConfiguration { + if in == nil { + return nil + } + out := new(PostgresConfiguration) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PostgresList) DeepCopyInto(out *PostgresList) { *out = *in @@ -2620,8 +2719,8 @@ func (in *PostgresReplication) DeepCopyInto(out *PostgresReplication) { *out = new(int32) **out = **in } - if in.ForceFailOverAcceptingDataLossAfter != nil { - in, out := &in.ForceFailOverAcceptingDataLossAfter, &out.ForceFailOverAcceptingDataLossAfter + if in.ForceFailoverAcceptingDataLossAfter != nil { + in, out := &in.ForceFailoverAcceptingDataLossAfter, &out.ForceFailoverAcceptingDataLossAfter *out = new(metav1.Duration) **out = **in } @@ -2697,6 +2796,11 @@ func (in *PostgresSpec) DeepCopyInto(out *PostgresSpec) { *out = new(corev1.LocalObjectReference) **out = **in } + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(PostgresConfiguration) + (*in).DeepCopyInto(*out) + } in.PodTemplate.DeepCopyInto(&out.PodTemplate) if in.ServiceTemplates != nil { in, out := &in.ServiceTemplates, &out.ServiceTemplates @@ -2731,11 +2835,6 @@ func (in *PostgresSpec) DeepCopyInto(out *PostgresSpec) { *out = new(PostgresReplication) (*in).DeepCopyInto(*out) } - if in.Tuning != nil { - in, out := &in.Tuning, &out.Tuning - *out = new(PostgresTuningConfig) - (*in).DeepCopyInto(*out) - } return } @@ -2780,9 +2879,9 @@ func (in *PostgresStatus) DeepCopy() *PostgresStatus { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PostgresTuningConfig) DeepCopyInto(out *PostgresTuningConfig) { *out = *in - if in.TuningProfile != nil { - in, out := &in.TuningProfile, &out.TuningProfile - *out = new(PostgresTuningProfile) + if in.Profile != nil { + in, out := &in.Profile, &out.Profile + *out = new(PostgresProfile) **out = **in } if in.MaxConnections != nil { @@ -2790,11 +2889,6 @@ func (in *PostgresTuningConfig) DeepCopyInto(out *PostgresTuningConfig) { *out = new(int32) **out = **in } - if in.ResourcesOverride != nil { - in, out := &in.ResourcesOverride, &out.ResourcesOverride - *out = new(TuningResourcesOverride) - (*in).DeepCopyInto(*out) - } if in.StorageType != nil { in, out := &in.StorageType, &out.StorageType *out = new(PostgresStorageType) @@ -2885,6 +2979,48 @@ func (in *ProxySQLConfiguration) DeepCopy() *ProxySQLConfiguration { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProxySQLConfigurationSpec) DeepCopyInto(out *ProxySQLConfigurationSpec) { + *out = *in + if in.Init != nil { + in, out := &in.Init, &out.Init + *out = new(ProxySQLInitConfiguration) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxySQLConfigurationSpec. +func (in *ProxySQLConfigurationSpec) DeepCopy() *ProxySQLConfigurationSpec { + if in == nil { + return nil + } + out := new(ProxySQLConfigurationSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProxySQLInitConfiguration) DeepCopyInto(out *ProxySQLInitConfiguration) { + *out = *in + if in.Inline != nil { + in, out := &in.Inline, &out.Inline + *out = new(ProxySQLConfiguration) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxySQLInitConfiguration. +func (in *ProxySQLInitConfiguration) DeepCopy() *ProxySQLInitConfiguration { + if in == nil { + return nil + } + out := new(ProxySQLInitConfiguration) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ProxySQLList) DeepCopyInto(out *ProxySQLList) { *out = *in @@ -2927,6 +3063,16 @@ func (in *ProxySQLSpec) DeepCopyInto(out *ProxySQLSpec) { *out = new(ProxySQLConfiguration) (*in).DeepCopyInto(*out) } + if in.ConfigSecret != nil { + in, out := &in.ConfigSecret, &out.ConfigSecret + *out = new(corev1.LocalObjectReference) + **out = **in + } + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(ProxySQLConfigurationSpec) + (*in).DeepCopyInto(*out) + } if in.Replicas != nil { in, out := &in.Replicas, &out.Replicas *out = new(int32) @@ -2947,11 +3093,6 @@ func (in *ProxySQLSpec) DeepCopyInto(out *ProxySQLSpec) { *out = new(monitoringagentapiapiv1.AgentSpec) (*in).DeepCopyInto(*out) } - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(corev1.LocalObjectReference) - **out = **in - } in.PodTemplate.DeepCopyInto(&out.PodTemplate) if in.ServiceTemplates != nil { in, out := &in.ServiceTemplates, &out.ServiceTemplates @@ -3113,6 +3254,28 @@ func (in *RedisClusterSpec) DeepCopy() *RedisClusterSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RedisConfiguration) DeepCopyInto(out *RedisConfiguration) { + *out = *in + in.ConfigurationSpec.DeepCopyInto(&out.ConfigurationSpec) + if in.Acl != nil { + in, out := &in.Acl, &out.Acl + *out = new(RedisAclSpec) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RedisConfiguration. +func (in *RedisConfiguration) DeepCopy() *RedisConfiguration { + if in == nil { + return nil + } + out := new(RedisConfiguration) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RedisList) DeepCopyInto(out *RedisList) { *out = *in @@ -3305,6 +3468,11 @@ func (in *RedisSentinelStatus) DeepCopy() *RedisSentinelStatus { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RedisSpec) DeepCopyInto(out *RedisSpec) { *out = *in + if in.Acl != nil { + in, out := &in.Acl, &out.Acl + *out = new(RedisAclSpec) + (*in).DeepCopyInto(*out) + } out.AutoOps = in.AutoOps if in.Replicas != nil { in, out := &in.Replicas, &out.Replicas @@ -3331,11 +3499,6 @@ func (in *RedisSpec) DeepCopyInto(out *RedisSpec) { *out = new(SecretReference) (*in).DeepCopyInto(*out) } - if in.Acl != nil { - in, out := &in.Acl, &out.Acl - *out = new(RedisAclSpec) - (*in).DeepCopyInto(*out) - } if in.Init != nil { in, out := &in.Init, &out.Init *out = new(InitSpec) @@ -3351,6 +3514,11 @@ func (in *RedisSpec) DeepCopyInto(out *RedisSpec) { *out = new(corev1.LocalObjectReference) **out = **in } + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(RedisConfiguration) + (*in).DeepCopyInto(*out) + } in.PodTemplate.DeepCopyInto(&out.PodTemplate) if in.ServiceTemplates != nil { in, out := &in.ServiceTemplates, &out.ServiceTemplates @@ -3544,29 +3712,3 @@ func (in *SystemUserSecretsSpec) DeepCopy() *SystemUserSecretsSpec { in.DeepCopyInto(out) return out } - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *TuningResourcesOverride) DeepCopyInto(out *TuningResourcesOverride) { - *out = *in - if in.Memory != nil { - in, out := &in.Memory, &out.Memory - x := (*in).DeepCopy() - *out = &x - } - if in.CPU != nil { - in, out := &in.CPU, &out.CPU - *out = new(int32) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TuningResourcesOverride. -func (in *TuningResourcesOverride) DeepCopy() *TuningResourcesOverride { - if in == nil { - return nil - } - out := new(TuningResourcesOverride) - in.DeepCopyInto(out) - return out -} diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/cassandra_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/cassandra_helpers.go index 7c528178d..5a9d382e3 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/cassandra_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/cassandra_helpers.go @@ -165,7 +165,8 @@ func (r *Cassandra) GetAuthSecretName() string { } func (r *Cassandra) ConfigSecretName() string { - return meta_util.NameWithSuffix(r.OffshootName(), "config") + uid := string(r.UID) + return meta_util.NameWithSuffix(r.OffshootName(), uid[len(uid)-6:]) } func (r *Cassandra) DefaultUserCredSecretName(username string) string { @@ -253,7 +254,8 @@ func (ks CassandraStatsService) Path() string { } func (ks CassandraStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (r *Cassandra) StatsService() mona.StatsAccessor { diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/cassandra_types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/cassandra_types.go index c015b4e9b..b98a4c0fc 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/cassandra_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/cassandra_types.go @@ -81,10 +81,11 @@ type CassandraSpec struct { // +optional AuthSecret *SecretReference `json:"authSecret,omitempty"` - // ConfigSecret is an optional field to provide custom configuration file for database (i.e. config.properties). + // Configuration is an optional field to provide custom configuration file for database (i.e. config.properties). // If specified, this file will be used as configuration file otherwise default configuration file will be used. + // You can provide custom configurations using Secret or ApplyConfig. // +optional - ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + Configuration *ConfigurationSpec `json:"configuration,omitempty"` // Keystore encryption secret // +optional diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/clickhouse_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/clickhouse_helpers.go index bd7e85d77..f840d2560 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/clickhouse_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/clickhouse_helpers.go @@ -198,7 +198,8 @@ func (c *ClickHouse) GetAuthSecretName() string { } func (r *ClickHouse) ConfigSecretName() string { - return meta_util.NameWithSuffix(r.OffshootName(), "config") + uid := string(r.UID) + return meta_util.NameWithSuffix(r.OffshootName(), uid[len(uid)-6:]) } func (r *ClickHouse) KeeperConfigSecretName() string { @@ -304,7 +305,8 @@ func (cs ClickHouseStatsService) Path() string { } func (cs ClickHouseStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (c *ClickHouse) StatsService() mona.StatsAccessor { @@ -563,3 +565,7 @@ func (c *ClickHouse) ReplicasAreReady(lister pslister.PetSetLister) (bool, strin } return checkReplicasOfPetSet(lister.PetSets(c.Namespace), labels.SelectorFromSet(c.OffshootLabels()), expectedItems) } + +func (c *ClickHouse) ClickHouseInlineConfigSecretKey(key string) string { + return fmt.Sprintf("%s-%s", kubedb.InlineConfigKeyPrefix, key) +} diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/clickhouse_types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/clickhouse_types.go index 951b6a3ac..ae61e4dbe 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/clickhouse_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/clickhouse_types.go @@ -89,10 +89,11 @@ type ClickHouseSpec struct { // +optional AuthSecret *SecretReference `json:"authSecret,omitempty"` - // ConfigSecret is an optional field to provide custom configuration file for database (i.e config.properties). + // Configuration is an optional field to provide custom configuration file for database (i.e config.properties). // If specified, this file will be used as configuration file otherwise default configuration file will be used. + // You can provide custom configurations using Secret or ApplyConfig. // +optional - ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + Configuration *ConfigurationSpec `json:"configuration,omitempty"` // PodTemplate is an optional configuration for pods used to expose database // +optional diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/conversion.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/conversion.go index f50d57ddd..b776cb961 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/conversion.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/conversion.go @@ -91,6 +91,24 @@ func Convert_v1alpha2_CoordinatorSpec_To_Slice_v1_Container(in *CoordinatorSpec, return nil } +func Convert_v1_ConfigurationSpec_To_v1alpha2_ConfigSecretSpec(in *v1.ConfigurationSpec, out **corev1.LocalObjectReference) { + if in == nil { + return + } + *out = &corev1.LocalObjectReference{ + Name: in.SecretName, + } +} + +func Convert_v1alpha2_ConfigSecretSpec_To_v1_ConfigurationSpec(in *corev1.LocalObjectReference, out **v1.ConfigurationSpec) { + if in == nil { + return + } + *out = &v1.ConfigurationSpec{ + SecretName: in.Name, + } +} + func Convert_v1_ElasticsearchNode_To_v1alpha2_ElasticsearchNode(in *v1.ElasticsearchNode, out *ElasticsearchNode, s conversion.Scope) error { out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) out.Suffix = in.Suffix @@ -988,6 +1006,74 @@ func Convert_v1_ElasticsearchSpec_To_v1alpha2_ElasticsearchSpec(in *v1.Elasticse return nil } +func Convert_v1_KafkaSpec_To_v1alpha2_KafkaSpec(in *v1.KafkaSpec, out *KafkaSpec, s conversion.Scope) error { + if err := Convert_v1_AutoOpsSpec_To_v1alpha2_AutoOpsSpec(&in.AutoOps, &out.AutoOps, s); err != nil { + return err + } + out.Version = in.Version + out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) + if in.Topology != nil { + in, out := &in.Topology, &out.Topology + *out = new(KafkaClusterTopology) + if err := Convert_v1_KafkaClusterTopology_To_v1alpha2_KafkaClusterTopology(*in, *out, s); err != nil { + return err + } + } else { + out.Topology = nil + } + out.EnableSSL = in.EnableSSL + out.BrokerRack = (*BrokerRack)(in.BrokerRack) + out.DisableSecurity = in.DisableSecurity + out.AuthSecret = (*SecretReference)(unsafe.Pointer(in.AuthSecret)) + out.StorageType = StorageType(in.StorageType) + out.Storage = (*corev1.PersistentVolumeClaimSpec)(unsafe.Pointer(in.Storage)) + out.Monitor = (*monitoringagentapiapiv1.AgentSpec)(unsafe.Pointer(in.Monitor)) + out.ConfigSecret = (*corev1.LocalObjectReference)(unsafe.Pointer(in.ConfigSecret)) + out.CruiseControl = (*KafkaCruiseControl)(unsafe.Pointer(in.CruiseControl)) + out.PodTemplate = in.PodTemplate + out.ServiceTemplates = *(*[]NamedServiceTemplateSpec)(unsafe.Pointer(&in.ServiceTemplates)) + out.TLS = (*clientgoapiv1.TLSConfig)(unsafe.Pointer(in.TLS)) + out.Halted = in.Halted + out.DeletionPolicy = DeletionPolicy(in.DeletionPolicy) + out.HealthChecker = in.HealthChecker + return nil +} + +func Convert_v1alpha2_KafkaCruiseControl_To_v1_KafkaCruiseControl(in *KafkaCruiseControl, out *v1.KafkaCruiseControl, s conversion.Scope) error { + out.PodTemplate.Spec.Containers = core_util.UpsertContainer(out.PodTemplate.Spec.Containers, corev1.Container{ + Name: kubedb.KafkaContainerName, + Resources: in.Resources, + }) + if in.ConfigSecret != nil { + out.Configuration = &v1.ConfigurationSpec{ + SecretName: in.ConfigSecret.Name, + } + } + out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) + out.Suffix = in.Suffix + out.PodTemplate = in.PodTemplate + out.BrokerCapacity = (*v1.KafkaBrokerCapacity)(unsafe.Pointer(in.BrokerCapacity)) + + return nil +} + +func Convert_v1_KafkaCruiseControl_To_v1alpha2_KafkaCruiseControl(in *v1.KafkaCruiseControl, out *KafkaCruiseControl, s conversion.Scope) error { + container := core_util.GetContainerByName(in.PodTemplate.Spec.Containers, kubedb.KafkaContainerName) + if container != nil { + out.Resources = *(*corev1.ResourceRequirements)(unsafe.Pointer(&container.Resources)) + } + if in.Configuration != nil && in.Configuration.SecretName != "" { + out.ConfigSecret = &corev1.LocalObjectReference{ + Name: in.Configuration.SecretName, + } + } + out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) + out.Suffix = in.Suffix + out.PodTemplate = in.PodTemplate + out.BrokerCapacity = (*KafkaBrokerCapacity)(unsafe.Pointer(in.BrokerCapacity)) + return nil +} + func Convert_v1_MemcachedSpec_To_v1alpha2_MemcachedSpec(in *v1.MemcachedSpec, out *MemcachedSpec, s conversion.Scope) error { out.Version = in.Version out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/druid_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/druid_helpers.go index a095df9ef..f8c2d1a1d 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/druid_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/druid_helpers.go @@ -173,7 +173,8 @@ func (ks DruidStatsService) Path() string { } func (ks DruidStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (d *Druid) StatsService() mona.StatsAccessor { @@ -185,7 +186,8 @@ func (d *Druid) StatsServiceLabels() map[string]string { } func (d *Druid) ConfigSecretName() string { - return meta_util.NameWithSuffix(d.OffShootName(), "config") + uid := string(d.UID) + return meta_util.NameWithSuffix(d.OffShootName(), uid[len(uid)-6:]) } func (d *Druid) PetSetName(nodeRole DruidNodeRoleType) string { diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/druid_types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/druid_types.go index 5d3743972..09cd812b1 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/druid_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/druid_types.go @@ -77,10 +77,11 @@ type DruidSpec struct { // +optional Init *InitSpec `json:"init,omitempty"` - // ConfigSecret is an optional field to provide custom configuration file for database (i.e. config.properties). + // Configuration is an optional field to provide custom configuration file for database (i.e. config.properties). // If specified, this file will be used as configuration file otherwise default configuration file will be used. + // You can provide custom configurations using Secret or ApplyConfig. // +optional - ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + Configuration *ConfigurationSpec `json:"configuration,omitempty"` // To enable ssl for http layer EnableSSL bool `json:"enableSSL,omitempty"` diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/elasticsearch_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/elasticsearch_helpers.go index 1e83e7b9d..a80a11442 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/elasticsearch_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/elasticsearch_helpers.go @@ -372,7 +372,8 @@ func (e elasticsearchStatsService) Path() string { } func (e elasticsearchStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (e elasticsearchStatsService) TLSConfig() *promapi.TLSConfig { diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/etcd_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/etcd_helpers.go index 7c445e660..e0adbb5bc 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/etcd_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/etcd_helpers.go @@ -154,7 +154,8 @@ func (e etcdStatsService) Path() string { } func (e etcdStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (e etcdStatsService) TLSConfig() *promapi.TLSConfig { diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/ferretdb_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/ferretdb_helpers.go index ed4752f5a..30136639d 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/ferretdb_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/ferretdb_helpers.go @@ -28,7 +28,7 @@ import ( "github.com/Masterminds/semver/v3" "github.com/fatih/structs" - v1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + promapi "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" "gomodules.xyz/pointer" core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -418,10 +418,11 @@ func (fs FerretDBStatsService) Path() string { } func (fs FerretDBStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } -func (fs FerretDBStatsService) TLSConfig() *v1.TLSConfig { +func (fs FerretDBStatsService) TLSConfig() *promapi.TLSConfig { return nil } diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/hanadb_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/hanadb_helpers.go index dd1bd74e7..53a1494c9 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/hanadb_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/hanadb_helpers.go @@ -180,7 +180,8 @@ func (os hanadbStatsService) Path() string { } func (os hanadbStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (h *HanaDB) StatsService() mona.StatsAccessor { @@ -220,7 +221,8 @@ func (h *HanaDB) ObserverPetSetName() string { } func (h *HanaDB) ConfigSecretName() string { - return metautil.NameWithSuffix(h.OffshootName(), "config") + uid := string(h.UID) + return metautil.NameWithSuffix(h.OffshootName(), uid[len(uid)-6:]) } func (h *HanaDB) IsStandalone() bool { diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/hanadb_types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/hanadb_types.go index df347f4b3..773082117 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/hanadb_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/hanadb_types.go @@ -88,10 +88,9 @@ type HanaDBSpec struct { // +optional AuthSecret *SecretReference `json:"authSecret,omitempty"` - // ConfigSecret is an optional field to provide custom configuration file for database (i.e. config.properties) - // If specified, this file will be used as configuration file otherwise default configuration file will be used. + // Configuration holds the custom config for hanadb // +optional - ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + Configuration *ConfigurationSpec `json:"configuration,omitempty"` // PodTemplate is an optional configuration for pods used to expose database // +optional diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/hazelcast_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/hazelcast_helpers.go index 51f36c5ea..f69ad0da3 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/hazelcast_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/hazelcast_helpers.go @@ -383,7 +383,8 @@ func (h hazelcastStatsService) Path() string { } func (h hazelcastStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (h hazelcastStatsService) TLSConfig() *promapi.TLSConfig { @@ -440,6 +441,11 @@ type HazelcastBind struct { *Hazelcast } +func (h *Hazelcast) ConfigSecretName() string { + uid := string(h.UID) + return meta_util.NameWithSuffix(h.OffshootName(), uid[len(uid)-6:]) +} + var _ DBBindInterface = &HazelcastBind{} func (d *HazelcastBind) ServiceNames() (string, string) { diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/hazelcast_types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/hazelcast_types.go index be1c245e1..e203c795a 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/hazelcast_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/hazelcast_types.go @@ -81,7 +81,7 @@ type HazelcastSpec struct { DisableSecurity bool `json:"disableSecurity,omitempty"` // +optional - ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + Configuration *ConfigurationSpec `json:"configuration,omitempty"` // +optional AuthSecret *SecretReference `json:"authSecret,omitempty"` diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/helpers.go index 4b3bc1809..d13d90119 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/helpers.go @@ -180,3 +180,13 @@ func UsesAcmeIssuer(kc client.Client, ns string, issuerRef core.TypedLocalObject func IsVirtualAuthSecretReferred(authSecret *SecretReference) bool { return authSecret != nil && authSecret.APIGroup == vsecretapi.GroupName } + +func copyConfigurationField(cnf *ConfigurationSpec, sec **core.LocalObjectReference) *ConfigurationSpec { + if cnf == nil && (*sec) != nil && (*sec).Name != "" { + cnf = &ConfigurationSpec{ + SecretName: (*sec).Name, + } + } + *sec = nil + return cnf +} diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/ignite_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/ignite_helpers.go index 5e4cfb862..9d892c0c9 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/ignite_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/ignite_helpers.go @@ -275,7 +275,8 @@ func (i *Ignite) PodLabels(extraLabels ...map[string]string) map[string]string { } func (i *Ignite) ConfigSecretName() string { - return meta_util.NameWithSuffix(i.OffshootName(), "config") + uid := string(i.UID) + return meta_util.NameWithSuffix(i.OffshootName(), uid[len(uid)-6:]) } func (i *Ignite) PVCName(alias string) string { @@ -311,7 +312,8 @@ func (i igniteStatsService) Path() string { } func (i igniteStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (i igniteStatsService) TLSConfig() *promapi.TLSConfig { diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/ignite_types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/ignite_types.go index 0bd19d04f..aef524a53 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/ignite_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/ignite_types.go @@ -79,10 +79,8 @@ type IgniteSpec struct { // +optional AuthSecret *SecretReference `json:"authSecret,omitempty"` - // ConfigSecret is an optional field to provide custom configuration file for database (i.e node-configuration.xml). - // If specified, this file will be used as configuration file otherwise default configuration file will be used. // +optional - ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + Configuration *ConfigurationSpec `json:"configuration,omitempty"` // PodTemplate is an optional configuration for pods used to expose database // +optional diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/kafka_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/kafka_helpers.go index 021559c51..f6cec0eca 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/kafka_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/kafka_helpers.go @@ -171,7 +171,8 @@ func (ks kafkaStatsService) Path() string { } func (ks kafkaStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (k *Kafka) StatsService() mona.StatsAccessor { diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/kafka_types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/kafka_types.go index 9640ea34e..313544c4e 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/kafka_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/kafka_types.go @@ -190,7 +190,7 @@ type KafkaStatus struct { type KafkaCruiseControl struct { // Configuration for cruise-control // +optional - ConfigSecret *SecretReference `json:"configSecret,omitempty"` + ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` // Replicas represents number of replica for this specific type of node // +optional diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/mariadb_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/mariadb_helpers.go index e8722ea6f..e3752892d 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/mariadb_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/mariadb_helpers.go @@ -173,7 +173,8 @@ func (m mariadbStatsService) Path() string { } func (m mariadbStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (m mariadbStatsService) TLSConfig() *promapi.TLSConfig { diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/memcached_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/memcached_helpers.go index eb9ff682a..e5a6feb4d 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/memcached_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/memcached_helpers.go @@ -110,8 +110,9 @@ func (m Memcached) GoverningServiceName() string { return meta_util.NameWithSuffix(m.ServiceName(), "pods") } -func (m Memcached) ConfigSecretName() string { - return meta_util.NameWithSuffix(m.OffshootName(), "config") +func (m *Memcached) ConfigSecretName() string { + uid := string(m.UID) + return meta_util.NameWithSuffix(m.OffshootName(), uid[len(uid)-6:]) } func (m Memcached) CustomConfigSecretName() string { @@ -163,7 +164,8 @@ func (m memcachedStatsService) Path() string { } func (m memcachedStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (m memcachedStatsService) TLSConfig() *promapi.TLSConfig { diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/milvus_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/milvus_helpers.go index ef90c90fb..ca8ec801e 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/milvus_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/milvus_helpers.go @@ -109,7 +109,8 @@ func (m *Milvus) GetAuthSecretName() string { } func (m *Milvus) ConfigSecretName() string { - return meta_util.NameWithSuffix(m.OffshootName(), "config") + uid := string(m.UID) + return meta_util.NameWithSuffix(m.OffshootName(), uid[len(uid)-6:]) } func (m *Milvus) GetPersistentSecrets() []string { diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/milvus_types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/milvus_types.go index a1ce8538c..1f0731085 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/milvus_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/milvus_types.go @@ -87,10 +87,8 @@ type MilvusSpec struct { // +optional AuthSecret *SecretReference `json:"authSecret,omitempty"` - // ConfigSecret is an optional field to provide custom configuration file for database (i.e config.properties). - // If specified, this file will be used as configuration file otherwise default configuration file will be used. // +optional - ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + Configuration *ConfigurationSpec `json:"configuration,omitempty"` // ServiceTemplates is an optional configuration for services used to expose database // +optional diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/mongodb_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/mongodb_helpers.go index aaf591b52..466393ed1 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/mongodb_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/mongodb_helpers.go @@ -580,7 +580,8 @@ func (m mongoDBStatsService) Path() string { } func (m mongoDBStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (m mongoDBStatsService) TLSConfig() *promapi.TLSConfig { diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/mssqlserver_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/mssqlserver_helpers.go index 211e4886e..e29aaf3e1 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/mssqlserver_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/mssqlserver_helpers.go @@ -149,7 +149,8 @@ func (m mssqlserverStatsService) Path() string { } func (m mssqlserverStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (m mssqlserverStatsService) TLSConfig() *promapi.TLSConfig { @@ -204,8 +205,11 @@ func (m *MSSQLServer) PodLabel(podTemplate *ofst.PodTemplateSpec) map[string]str return m.offshootLabels(m.OffshootSelectors(), nil) } +// ConfigSecretName returns a secret name in the format: {db-cr-name}-{last-6-chars-of-UID}. +// This secret is used for mounting the config files in the pod. func (m *MSSQLServer) ConfigSecretName() string { - return meta_util.NameWithSuffix(m.OffshootName(), "config") + uid := string(m.UID) + return meta_util.NameWithSuffix(m.OffshootName(), uid[len(uid)-6:]) } func (m *MSSQLServer) PetSetName() string { @@ -415,6 +419,8 @@ func (m *MSSQLServer) SetDefaults(kc client.Client) { return } + m.Spec.Configuration = copyConfigurationField(m.Spec.Configuration, &m.Spec.ConfigSecret) + m.SetArbiterDefault() m.setDefaultContainerSecurityContext(&mssqlVersion, m.Spec.PodTemplate) @@ -539,7 +545,7 @@ func (m *MSSQLServer) assignDefaultContainerSecurityContext(mssqlVersion *catalo func (m *MSSQLServer) setDefaultContainerResourceLimits(podTemplate *ofst.PodTemplateSpec) { dbContainer := coreutil.GetContainerByName(podTemplate.Spec.Containers, kubedb.MSSQLContainerName) if dbContainer != nil && (dbContainer.Resources.Requests == nil && dbContainer.Resources.Limits == nil) { - apis.SetDefaultResourceLimits(&dbContainer.Resources, kubedb.DefaultResourcesMemoryIntensiveMSSQLServer) + apis.SetDefaultResourceLimits(&dbContainer.Resources, kubedb.DefaultResourcesMSSQLServer) } initContainer := coreutil.GetContainerByName(podTemplate.Spec.InitContainers, kubedb.MSSQLInitContainerName) diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/mssqlserver_types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/mssqlserver_types.go index 13a0d504d..7ad07c067 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/mssqlserver_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/mssqlserver_types.go @@ -119,6 +119,9 @@ type MSSQLServerSpec struct { // +optional ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + // +optional + Configuration *ConfigurationSpec `json:"configuration,omitempty"` + // Init is used to initialize a database // +optional Init *InitSpec `json:"init,omitempty"` diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/mysql_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/mysql_helpers.go index 160dd581b..d145bd9d1 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/mysql_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/mysql_helpers.go @@ -217,7 +217,8 @@ func (m mysqlStatsService) Path() string { } func (m mysqlStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (m mysqlStatsService) TLSConfig() *promapi.TLSConfig { diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/neo4j_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/neo4j_helpers.go index c3dc346c5..5180597cf 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/neo4j_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/neo4j_helpers.go @@ -72,7 +72,8 @@ func (r *Neo4j) OffshootSelectors(extraSelectors ...map[string]string) map[strin } func (r *Neo4j) ConfigSecretName() string { - return meta_util.NameWithSuffix(r.OffshootName(), "config") + uid := string(r.UID) + return meta_util.NameWithSuffix(r.OffshootName(), uid[len(uid)-6:]) } func (r *Neo4j) ResourceFQN() string { diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/neo4j_types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/neo4j_types.go index ea857fc3e..80c4c70a1 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/neo4j_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/neo4j_types.go @@ -70,10 +70,8 @@ type Neo4jSpec struct { // +optional AuthSecret *SecretReference `json:"authSecret,omitempty"` - // ConfigSecret references a Secret that provides a custom configuration file . - // When set, this configuration takes precedence over the operator defaults. // +optional - ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + Configuration *ConfigurationSpec `json:"configuration,omitempty"` // PodTemplate customizes the pods running Neo4j (resources, environment variables, probes, affinity, etc.). // +optional diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/openapi_generated.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/openapi_generated.go index 960e21530..32e396959 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/openapi_generated.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/openapi_generated.go @@ -538,6 +538,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ClickhouseApp": schema_apimachinery_apis_kubedb_v1alpha2_ClickhouseApp(ref), "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ClusterSpec": schema_apimachinery_apis_kubedb_v1alpha2_ClusterSpec(ref), "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ClusterTopology": schema_apimachinery_apis_kubedb_v1alpha2_ClusterTopology(ref), + "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec": schema_apimachinery_apis_kubedb_v1alpha2_ConfigurationSpec(ref), "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConnectionPoolConfig": schema_apimachinery_apis_kubedb_v1alpha2_ConnectionPoolConfig(ref), "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConsumerNamespaces": schema_apimachinery_apis_kubedb_v1alpha2_ConsumerNamespaces(ref), "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.CoordinatorSpec": schema_apimachinery_apis_kubedb_v1alpha2_CoordinatorSpec(ref), @@ -703,6 +704,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.QdrantList": schema_apimachinery_apis_kubedb_v1alpha2_QdrantList(ref), "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.QdrantSpec": schema_apimachinery_apis_kubedb_v1alpha2_QdrantSpec(ref), "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.QdrantStatus": schema_apimachinery_apis_kubedb_v1alpha2_QdrantStatus(ref), + "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.QdrantTLSConfig": schema_apimachinery_apis_kubedb_v1alpha2_QdrantTLSConfig(ref), "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.RabbitMQ": schema_apimachinery_apis_kubedb_v1alpha2_RabbitMQ(ref), "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.RabbitMQBind": schema_apimachinery_apis_kubedb_v1alpha2_RabbitMQBind(ref), "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.RabbitMQList": schema_apimachinery_apis_kubedb_v1alpha2_RabbitMQList(ref), @@ -27158,10 +27160,10 @@ func schema_apimachinery_apis_kubedb_v1alpha2_CassandraSpec(ref common.Reference Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"), }, }, - "configSecret": { + "configuration": { SchemaProps: spec.SchemaProps{ - Description: "ConfigSecret is an optional field to provide custom configuration file for database (i.e. config.properties). If specified, this file will be used as configuration file otherwise default configuration file will be used.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + Description: "Configuration is an optional field to provide custom configuration file for database (i.e. config.properties). If specified, this file will be used as configuration file otherwise default configuration file will be used. You can provide custom configurations using Secret or ApplyConfig.", + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec"), }, }, "keystoreCredSecret": { @@ -27228,7 +27230,7 @@ func schema_apimachinery_apis_kubedb_v1alpha2_CassandraSpec(ref common.Reference }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.Topology"}, + "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.Topology"}, } } @@ -27552,10 +27554,10 @@ func schema_apimachinery_apis_kubedb_v1alpha2_ClickHouseSpec(ref common.Referenc Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"), }, }, - "configSecret": { + "configuration": { SchemaProps: spec.SchemaProps{ - Description: "ConfigSecret is an optional field to provide custom configuration file for database (i.e config.properties). If specified, this file will be used as configuration file otherwise default configuration file will be used.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + Description: "Configuration is an optional field to provide custom configuration file for database (i.e config.properties). If specified, this file will be used as configuration file otherwise default configuration file will be used. You can provide custom configurations using Secret or ApplyConfig.", + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec"), }, }, "podTemplate": { @@ -27623,7 +27625,7 @@ func schema_apimachinery_apis_kubedb_v1alpha2_ClickHouseSpec(ref common.Referenc }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ClickHouseTLSConfig", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ClusterTopology", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.InitSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"}, + "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ClickHouseTLSConfig", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ClusterTopology", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.InitSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"}, } } @@ -27819,6 +27821,41 @@ func schema_apimachinery_apis_kubedb_v1alpha2_ClusterTopology(ref common.Referen } } +func schema_apimachinery_apis_kubedb_v1alpha2_ConfigurationSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "secretName": { + SchemaProps: spec.SchemaProps{ + Description: "SecretName is an optional field to provide custom configuration file for the database (i.e. mssql.conf). If specified, these configurations will be used with default configurations (if any) and applyConfig configurations (if any). Configurations from this secret will override default configurations. This secret must be created by user.", + Type: []string{"string"}, + Format: "", + }, + }, + "inline": { + SchemaProps: spec.SchemaProps{ + Description: "Inline contains key-value pairs of configurations to be applied to the database. These configurations will override both default configurations and configurations from the config secret (if any).", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + }, + }, + } +} + func schema_apimachinery_apis_kubedb_v1alpha2_ConnectionPoolConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -28632,10 +28669,10 @@ func schema_apimachinery_apis_kubedb_v1alpha2_DruidSpec(ref common.ReferenceCall Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.InitSpec"), }, }, - "configSecret": { + "configuration": { SchemaProps: spec.SchemaProps{ - Description: "ConfigSecret is an optional field to provide custom configuration file for database (i.e. config.properties). If specified, this file will be used as configuration file otherwise default configuration file will be used.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + Description: "Configuration is an optional field to provide custom configuration file for database (i.e. config.properties). If specified, this file will be used as configuration file otherwise default configuration file will be used. You can provide custom configurations using Secret or ApplyConfig.", + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec"), }, }, "enableSSL": { @@ -28721,7 +28758,7 @@ func schema_apimachinery_apis_kubedb_v1alpha2_DruidSpec(ref common.ReferenceCall }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.DeepStorageSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.DruidClusterTopology", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.InitSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.MetadataStorage", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ZookeeperRef"}, + "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.DeepStorageSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.DruidClusterTopology", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.InitSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.MetadataStorage", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ZookeeperRef"}, } } @@ -30358,10 +30395,10 @@ func schema_apimachinery_apis_kubedb_v1alpha2_HanaDBSpec(ref common.ReferenceCal Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"), }, }, - "configSecret": { + "configuration": { SchemaProps: spec.SchemaProps{ - Description: "ConfigSecret is an optional field to provide custom configuration file for database (i.e. config.properties) If specified, this file will be used as configuration file otherwise default configuration file will be used.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + Description: "Configuration holds the custom config for hanadb", + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec"), }, }, "podTemplate": { @@ -30403,7 +30440,7 @@ func schema_apimachinery_apis_kubedb_v1alpha2_HanaDBSpec(ref common.ReferenceCal }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.HanaDBTopology", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"}, + "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.HanaDBTopology", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"}, } } @@ -30673,9 +30710,9 @@ func schema_apimachinery_apis_kubedb_v1alpha2_HazelcastSpec(ref common.Reference Format: "", }, }, - "configSecret": { + "configuration": { SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec"), }, }, "authSecret": { @@ -30748,7 +30785,7 @@ func schema_apimachinery_apis_kubedb_v1alpha2_HazelcastSpec(ref common.Reference }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "k8s.io/api/core/v1.SecretReference", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "k8s.io/api/core/v1.SecretReference", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"}, } } @@ -30965,10 +31002,9 @@ func schema_apimachinery_apis_kubedb_v1alpha2_IgniteSpec(ref common.ReferenceCal Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"), }, }, - "configSecret": { + "configuration": { SchemaProps: spec.SchemaProps{ - Description: "ConfigSecret is an optional field to provide custom configuration file for database (i.e node-configuration.xml). If specified, this file will be used as configuration file otherwise default configuration file will be used.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec"), }, }, "podTemplate": { @@ -31036,7 +31072,7 @@ func schema_apimachinery_apis_kubedb_v1alpha2_IgniteSpec(ref common.ReferenceCal }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"}, + "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"}, } } @@ -31245,7 +31281,7 @@ func schema_apimachinery_apis_kubedb_v1alpha2_KafkaCruiseControl(ref common.Refe "configSecret": { SchemaProps: spec.SchemaProps{ Description: "Configuration for cruise-control", - Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"), + Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), }, }, "replicas": { @@ -31286,7 +31322,7 @@ func schema_apimachinery_apis_kubedb_v1alpha2_KafkaCruiseControl(ref common.Refe }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ResourceRequirements", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.KafkaBrokerCapacity", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.ResourceRequirements", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.KafkaBrokerCapacity"}, } } @@ -32074,6 +32110,11 @@ func schema_apimachinery_apis_kubedb_v1alpha2_MSSQLServerSpec(ref common.Referen Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), }, }, + "configuration": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec"), + }, + }, "init": { SchemaProps: spec.SchemaProps{ Description: "Init is used to initialize a database", @@ -32150,7 +32191,7 @@ func schema_apimachinery_apis_kubedb_v1alpha2_MSSQLServerSpec(ref common.Referen }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ArbiterSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.Archiver", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.InitSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.MSSQLServerTLSConfig", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.MSSQLServerTopology", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ArbiterSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.Archiver", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.InitSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.MSSQLServerTLSConfig", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.MSSQLServerTopology", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"}, } } @@ -33147,10 +33188,9 @@ func schema_apimachinery_apis_kubedb_v1alpha2_MilvusSpec(ref common.ReferenceCal Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"), }, }, - "configSecret": { + "configuration": { SchemaProps: spec.SchemaProps{ - Description: "ConfigSecret is an optional field to provide custom configuration file for database (i.e config.properties). If specified, this file will be used as configuration file otherwise default configuration file will be used.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec"), }, }, "serviceTemplates": { @@ -33193,7 +33233,7 @@ func schema_apimachinery_apis_kubedb_v1alpha2_MilvusSpec(ref common.ReferenceCal }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.MetaStorageSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.MilvusTopology", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ObjectStorageSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"}, + "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.MetaStorageSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.MilvusTopology", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ObjectStorageSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"}, } } @@ -34651,10 +34691,9 @@ func schema_apimachinery_apis_kubedb_v1alpha2_Neo4jSpec(ref common.ReferenceCall Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"), }, }, - "configSecret": { + "configuration": { SchemaProps: spec.SchemaProps{ - Description: "ConfigSecret references a Secret that provides a custom configuration file . When set, this configuration takes precedence over the operator defaults.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec"), }, }, "podTemplate": { @@ -34712,7 +34751,7 @@ func schema_apimachinery_apis_kubedb_v1alpha2_Neo4jSpec(ref common.ReferenceCall }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"}, + "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"}, } } @@ -34958,10 +34997,10 @@ func schema_apimachinery_apis_kubedb_v1alpha2_OracleSpec(ref common.ReferenceCal Ref: ref("k8s.io/api/core/v1.PersistentVolumeClaimSpec"), }, }, - "configSecret": { + "configuration": { SchemaProps: spec.SchemaProps{ - Description: "ConfigSecret is an optional field to provide custom configuration file for database (i.e config.properties). If specified, this file will be used as configuration file otherwise default configuration file will be used.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + Description: "Configuration is an optional field to provide custom configuration file for database (i.e config.properties). If specified, this file will be used as configuration file otherwise default configuration file will be used. You can provide custom configurations using Secret or ApplyConfig.", + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec"), }, }, "authSecret": { @@ -35039,7 +35078,7 @@ func schema_apimachinery_apis_kubedb_v1alpha2_OracleSpec(ref common.ReferenceCal }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.DataGuardSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ListenerSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.OracleTCPSConfig", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"}, + "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.DataGuardSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ListenerSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.OracleTCPSConfig", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"}, } } @@ -35821,10 +35860,9 @@ func schema_apimachinery_apis_kubedb_v1alpha2_PgpoolSpec(ref common.ReferenceCal Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"), }, }, - "configSecret": { + "configuration": { SchemaProps: spec.SchemaProps{ - Description: "ConfigSecret is a configuration secret which will be created with default and InitConfiguration", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec"), }, }, "init": { @@ -35839,12 +35877,6 @@ func schema_apimachinery_apis_kubedb_v1alpha2_PgpoolSpec(ref common.ReferenceCal Ref: ref("kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec"), }, }, - "initConfig": { - SchemaProps: spec.SchemaProps{ - Description: "InitConfiguration contains information with which the Pgpool will bootstrap", - Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.PgpoolConfiguration"), - }, - }, "serviceTemplates": { SchemaProps: spec.SchemaProps{ Description: "ServiceTemplates is an optional configuration for services used to expose Pgpool", @@ -35904,7 +35936,7 @@ func schema_apimachinery_apis_kubedb_v1alpha2_PgpoolSpec(ref common.ReferenceCal }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.ObjectReference", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.InitSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.PgpoolConfiguration", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"}, + "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.ObjectReference", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.InitSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"}, } } @@ -36174,9 +36206,9 @@ func schema_apimachinery_apis_kubedb_v1alpha2_PostgresReplication(ref common.Ref Format: "int32", }, }, - "forceFailOverAcceptingDataLossAfter": { + "forceFailoverAcceptingDataLossAfter": { SchemaProps: spec.SchemaProps{ - Description: "ForceFailOverAcceptingDataLossAfter is the maximum time to wait before running a force failover process This is helpful for a scenario where the old primary is not available and it has the most updated wal lsn Doing force failover may or may not end up loosing data depending on any wrtie transaction in the range lagged lsn between the new primary and the old primary", + Description: "ForceFailoverAcceptingDataLossAfter is the maximum time to wait before running a force failover process This is helpful for a scenario where the old primary is not available and it has the most updated wal lsn Doing force failover may or may not end up loosing data depending on any wrtie transaction in the range lagged lsn between the new primary and the old primary", Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), }, }, @@ -36923,10 +36955,9 @@ func schema_apimachinery_apis_kubedb_v1alpha2_QdrantSpec(ref common.ReferenceCal Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"), }, }, - "configSecret": { + "configuration": { SchemaProps: spec.SchemaProps{ - Description: "ConfigSecret is an optional field to provide custom configuration file for database (i.e node-configuration.xml). If specified, this file will be used as configuration file otherwise default configuration file will be used.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec"), }, }, "podTemplate": { @@ -36935,6 +36966,12 @@ func schema_apimachinery_apis_kubedb_v1alpha2_QdrantSpec(ref common.ReferenceCal Ref: ref("kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec"), }, }, + "tls": { + SchemaProps: spec.SchemaProps{ + Description: "TLS contains tls configurations for client and server.", + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.QdrantTLSConfig"), + }, + }, "serviceTemplates": { SchemaProps: spec.SchemaProps{ Description: "ServiceTemplates is an optional configuration for services used to expose database", @@ -36975,7 +37012,7 @@ func schema_apimachinery_apis_kubedb_v1alpha2_QdrantSpec(ref common.ReferenceCal }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"}, + "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.QdrantTLSConfig", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"}, } } @@ -37022,6 +37059,52 @@ func schema_apimachinery_apis_kubedb_v1alpha2_QdrantStatus(ref common.ReferenceC } } +func schema_apimachinery_apis_kubedb_v1alpha2_QdrantTLSConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "issuerRef": { + SchemaProps: spec.SchemaProps{ + Description: "IssuerRef is a reference to a Certificate Issuer.", + Ref: ref("k8s.io/api/core/v1.TypedLocalObjectReference"), + }, + }, + "certificates": { + SchemaProps: spec.SchemaProps{ + Description: "Certificate provides server and/or client certificate options used by application pods. These options are passed to a cert-manager Certificate object. xref: https://github.com/jetstack/cert-manager/blob/v0.16.0/pkg/apis/certmanager/v1beta1/types_certificate.go#L82-L162", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("kmodules.xyz/client-go/api/v1.CertificateSpec"), + }, + }, + }, + }, + }, + "p2p": { + SchemaProps: spec.SchemaProps{ + Type: []string{"boolean"}, + Format: "", + }, + }, + "client": { + SchemaProps: spec.SchemaProps{ + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.TypedLocalObjectReference", "kmodules.xyz/client-go/api/v1.CertificateSpec"}, + } +} + func schema_apimachinery_apis_kubedb_v1alpha2_RabbitMQ(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -37204,6 +37287,11 @@ func schema_apimachinery_apis_kubedb_v1alpha2_RabbitMQSpec(ref common.ReferenceC Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), }, }, + "configuration": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec"), + }, + }, "tls": { SchemaProps: spec.SchemaProps{ Description: "TLS contains tls configurations", @@ -37278,7 +37366,7 @@ func schema_apimachinery_apis_kubedb_v1alpha2_RabbitMQSpec(ref common.ReferenceC }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"}, } } @@ -38558,10 +38646,10 @@ func schema_apimachinery_apis_kubedb_v1alpha2_SinglestoreNode(ref common.Referen Format: "", }, }, - "configSecret": { + "configuration": { SchemaProps: spec.SchemaProps{ - Description: "ConfigSecret is an optional field to provide custom configuration file for database (i.e config.properties). If specified, this file will be used as configuration file otherwise default configuration file will be used.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + Description: "Configuration is an optional field to provide custom configuration file for database (i.e config.properties). If specified, this file will be used as configuration file otherwise default configuration file will be used.", + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec"), }, }, "storage": { @@ -38580,7 +38668,7 @@ func schema_apimachinery_apis_kubedb_v1alpha2_SinglestoreNode(ref common.Referen }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec"}, + "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec"}, } } @@ -38624,10 +38712,10 @@ func schema_apimachinery_apis_kubedb_v1alpha2_SinglestoreSpec(ref common.Referen Ref: ref("k8s.io/api/core/v1.PersistentVolumeClaimSpec"), }, }, - "configSecret": { + "configuration": { SchemaProps: spec.SchemaProps{ - Description: "ConfigSecret is an optional field to provide custom configuration file for database (i.e config.properties). If specified, this file will be used as configuration file otherwise default configuration file will be used.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + Description: "Configuration is an optional field to provide custom configuration file for database (i.e config.properties). If specified, this file will be used as configuration file otherwise default configuration file will be used. You can provide custom configurations using Secret or ApplyConfig.", + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec"), }, }, "init": { @@ -38706,7 +38794,7 @@ func schema_apimachinery_apis_kubedb_v1alpha2_SinglestoreSpec(ref common.Referen }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.InitSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SinglestoreTopology"}, + "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.InitSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SinglestoreTopology"}, } } @@ -39092,9 +39180,9 @@ func schema_apimachinery_apis_kubedb_v1alpha2_SolrSpec(ref common.ReferenceCallb Format: "", }, }, - "configSecret": { + "configuration": { SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec"), }, }, "keystoreSecret": { @@ -39168,7 +39256,7 @@ func schema_apimachinery_apis_kubedb_v1alpha2_SolrSpec(ref common.ReferenceCallb }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SolrClusterTopology", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ZookeeperRef"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SolrClusterTopology", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ZookeeperRef"}, } } @@ -39457,10 +39545,10 @@ func schema_apimachinery_apis_kubedb_v1alpha2_WeaviateSpec(ref common.ReferenceC Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"), }, }, - "configSecret": { + "configuration": { SchemaProps: spec.SchemaProps{ - Description: "ConfigSecret is an optional field to provide custom configuration file for database (i.e conf.yaml). If specified, this file will be used as configuration file otherwise default configuration file will be used.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + Description: "Configuration is an optional field to provide custom configuration file for database (i.e conf.yaml). If specified, this file will be used as configuration file otherwise default configuration file will be used. You can provide custom configurations using Secret or ApplyConfig.", + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec"), }, }, "podTemplate": { @@ -39503,7 +39591,7 @@ func schema_apimachinery_apis_kubedb_v1alpha2_WeaviateSpec(ref common.ReferenceC }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"}, + "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"}, } } @@ -39733,10 +39821,10 @@ func schema_apimachinery_apis_kubedb_v1alpha2_ZooKeeperSpec(ref common.Reference Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"), }, }, - "configSecret": { + "configuration": { SchemaProps: spec.SchemaProps{ - Description: "ConfigSecret is an optional field to provide custom configuration file for database (i.e config.properties). If specified, this file will be used as configuration file otherwise default configuration file will be used.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + Description: "Configuration is an optional field to provide custom configuration file for database (i.e config.properties). If specified, this file will be used as configuration file otherwise default configuration file will be used. You can provide custom configurations using SecretName or ApplyConfig.", + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec"), }, }, "keystoreCredSecret": { @@ -39804,7 +39892,7 @@ func schema_apimachinery_apis_kubedb_v1alpha2_ZooKeeperSpec(ref common.Reference }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"}, + "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "kmodules.xyz/client-go/api/v1.HealthCheckSpec", "kmodules.xyz/client-go/api/v1.TLSConfig", "kmodules.xyz/monitoring-agent-api/api/v1.AgentSpec", "kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.AutoOpsSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.ConfigurationSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.NamedServiceTemplateSpec", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"}, } } diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/oracle_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/oracle_helpers.go index ea72f0c12..94ee6d4c6 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/oracle_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/oracle_helpers.go @@ -218,7 +218,8 @@ func (os oracleStatsService) Path() string { } func (os oracleStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (o *Oracle) StatsService() mona.StatsAccessor { diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/oracle_types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/oracle_types.go index 86ed58c62..b5ca6b9a4 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/oracle_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/oracle_types.go @@ -128,10 +128,11 @@ type OracleSpec struct { // Storage to specify how storage shall be used. Storage *core.PersistentVolumeClaimSpec `json:"storage,omitempty"` - // ConfigSecret is an optional field to provide custom configuration file for database (i.e config.properties). + // Configuration is an optional field to provide custom configuration file for database (i.e config.properties). // If specified, this file will be used as configuration file otherwise default configuration file will be used. + // You can provide custom configurations using Secret or ApplyConfig. // +optional - ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + Configuration *ConfigurationSpec `json:"configuration,omitempty"` // Database authentication secret // +optional diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/perconaxtradb_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/perconaxtradb_helpers.go index 8e61d444f..12fe23d83 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/perconaxtradb_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/perconaxtradb_helpers.go @@ -187,7 +187,8 @@ func (p perconaXtraDBStatsService) Path() string { } func (p perconaXtraDBStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (p perconaXtraDBStatsService) TLSConfig() *promapi.TLSConfig { diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/pgbouncer_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/pgbouncer_helpers.go index 2d247ade9..4ff152536 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/pgbouncer_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/pgbouncer_helpers.go @@ -167,7 +167,8 @@ func (p pgbouncerStatsService) Path() string { } func (p pgbouncerStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (p pgbouncerStatsService) TLSConfig() *promapi.TLSConfig { diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/pgpool_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/pgpool_helpers.go index e3db8cc5b..80b6c4d0a 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/pgpool_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/pgpool_helpers.go @@ -86,7 +86,8 @@ func (p *Pgpool) ResourcePlural() string { } func (p *Pgpool) ConfigSecretName() string { - return meta_util.NameWithSuffix(p.OffshootName(), "config") + uid := string(p.UID) + return meta_util.NameWithSuffix(p.OffshootName(), uid[len(uid)-6:]) } func (p *Pgpool) TLSSecretName() string { @@ -162,7 +163,8 @@ func (p *Pgpool) GetAuthSecretName() string { } func (p *Pgpool) GetPcpConfigSecretName() string { - return meta_util.NameWithSuffix(p.OffshootName(), "pcp-config") + uid := string(p.UID) + return meta_util.NameWithSuffix(meta_util.NameWithSuffix(p.OffshootName(), "pcp"), uid[len(uid)-6:]) } func (p *Pgpool) SetHealthCheckerDefaults() { @@ -211,7 +213,8 @@ func (p PgpoolStatsService) Path() string { } func (p PgpoolStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (p PgpoolStatsService) TLSConfig() *promapi.TLSConfig { diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/pgpool_types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/pgpool_types.go index 918c84420..c74edb067 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/pgpool_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/pgpool_types.go @@ -17,7 +17,6 @@ limitations under the License. package v1alpha2 import ( - core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" kmapi "kmodules.xyz/client-go/api/v1" @@ -75,9 +74,8 @@ type PgpoolSpec struct { // +optional AuthSecret *SecretReference `json:"authSecret,omitempty"` - // ConfigSecret is a configuration secret which will be created with default and InitConfiguration // +optional - ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + Configuration *ConfigurationSpec `json:"configuration,omitempty"` // Init is used to initialize database // +optional @@ -87,10 +85,6 @@ type PgpoolSpec struct { // +optional PodTemplate *ofst.PodTemplateSpec `json:"podTemplate,omitempty"` - // InitConfiguration contains information with which the Pgpool will bootstrap - // +optional - InitConfiguration *PgpoolConfiguration `json:"initConfig,omitempty"` - // ServiceTemplates is an optional configuration for services used to expose Pgpool // +optional ServiceTemplates []NamedServiceTemplateSpec `json:"serviceTemplates,omitempty"` diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/postgres_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/postgres_helpers.go index e7943e238..3651c22cf 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/postgres_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/postgres_helpers.go @@ -170,7 +170,8 @@ func (p postgresStatsService) Path() string { } func (p postgresStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (p postgresStatsService) TLSConfig() *promapi.TLSConfig { diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/postgres_types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/postgres_types.go index 268a21da6..ad415f42f 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/postgres_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/postgres_types.go @@ -187,12 +187,12 @@ type PostgresReplication struct { // +optional MaxSlotWALKeepSizeInMegaBytes *int32 `json:"maxSlotWALKeepSize,omitempty"` - // ForceFailOverAcceptingDataLossAfter is the maximum time to wait before running a force failover process + // ForceFailoverAcceptingDataLossAfter is the maximum time to wait before running a force failover process // This is helpful for a scenario where the old primary is not available and it has the most updated wal lsn // Doing force failover may or may not end up loosing data depending on any wrtie transaction // in the range lagged lsn between the new primary and the old primary // +optional - ForceFailOverAcceptingDataLossAfter *metav1.Duration `json:"forceFailOverAcceptingDataLossAfter,omitempty"` + ForceFailoverAcceptingDataLossAfter *metav1.Duration `json:"forceFailoverAcceptingDataLossAfter,omitempty"` } // PostgreLeaderElectionConfig contains essential attributes of leader election. diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/proxysql_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/proxysql_helpers.go index aa855e943..e78f5e72a 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/proxysql_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/proxysql_helpers.go @@ -155,7 +155,8 @@ func (p proxysqlStatsService) Path() string { } func (p proxysqlStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (p proxysqlStatsService) TLSConfig() *promapi.TLSConfig { diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/qdrant_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/qdrant_helpers.go index 70ec3ed75..504c8b5e8 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/qdrant_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/qdrant_helpers.go @@ -29,6 +29,7 @@ import ( core "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + kmapi "kmodules.xyz/client-go/api/v1" "kmodules.xyz/client-go/apiextensions" coreutil "kmodules.xyz/client-go/core/v1" meta_util "kmodules.xyz/client-go/meta" @@ -148,7 +149,8 @@ func (q *Qdrant) GetAPIKey(ctx context.Context, kc client.Client) string { } func (q *Qdrant) ConfigSecretName() string { - return meta_util.NameWithSuffix(q.OffshootName(), "config") + uid := string(q.UID) + return meta_util.NameWithSuffix(q.OffshootName(), uid[len(uid)-6:]) } func (q *Qdrant) GetPersistentSecrets() []string { @@ -182,6 +184,20 @@ func (q *Qdrant) PodLabels(extraLabels ...map[string]string) map[string]string { return q.offshootLabels(meta_util.OverwriteKeys(q.OffshootSelectors(), extraLabels...), q.Spec.PodTemplate.Labels) } +func (q *Qdrant) CertificateName(alias QdrantCertificateAlias) string { + return meta_util.NameWithSuffix(q.Name, fmt.Sprintf("%s-cert", string(alias))) +} + +func (q *Qdrant) GetCertSecretName(alias QdrantCertificateAlias) string { + if q.Spec.TLS != nil { + name, ok := kmapi.GetCertificateSecretName(q.Spec.TLS.Certificates, string(alias)) + if ok { + return name + } + } + return q.CertificateName(alias) +} + func (q *Qdrant) SetDefaults(kc client.Client) { if q.Spec.Replicas == nil { q.Spec.Replicas = pointer.Int32P(1) diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/qdrant_types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/qdrant_types.go index d486d1db2..d907b8196 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/qdrant_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/qdrant_types.go @@ -38,6 +38,14 @@ const ( QdrantDistributed QdrantMode = "Distributed" ) +// +kubebuilder:validation:Enum=server;client +type QdrantCertificateAlias string + +const ( + QdrantServerCert QdrantCertificateAlias = "server" + QdrantClientCert QdrantCertificateAlias = "client" +) + // Qdrant is the Schema for the Qdrant API // +genclient @@ -86,15 +94,16 @@ type QdrantSpec struct { // +optional AuthSecret *SecretReference `json:"authSecret,omitempty"` - // ConfigSecret is an optional field to provide custom configuration file for database (i.e node-configuration.xml). - // If specified, this file will be used as configuration file otherwise default configuration file will be used. // +optional - ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + Configuration *ConfigurationSpec `json:"configuration,omitempty"` // PodTemplate is an optional configuration for pods used to expose database // +optional PodTemplate *ofst.PodTemplateSpec `json:"podTemplate,omitempty"` + // TLS contains tls configurations for client and server. + TLS *QdrantTLSConfig `json:"tls,omitempty"` + // ServiceTemplates is an optional configuration for services used to expose database // +optional ServiceTemplates []NamedServiceTemplateSpec `json:"serviceTemplates,omitempty"` @@ -113,6 +122,14 @@ type QdrantSpec struct { HealthChecker kmapi.HealthCheckSpec `json:"healthChecker"` } +type QdrantTLSConfig struct { + kmapi.TLSConfig `json:",inline"` + // +optional + P2P *bool `json:"p2p"` + // +optional + Client *bool `json:"client"` +} + // QdrantStatus defines the observed state of Qdrant. type QdrantStatus struct { // Specifies the current phase of the database diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/rabbitmq_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/rabbitmq_helpers.go index 9f1e9fbe2..fa5c68c25 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/rabbitmq_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/rabbitmq_helpers.go @@ -189,7 +189,8 @@ func (ks RabbitmqStatsService) Path() string { } func (ks RabbitmqStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (r *RabbitMQ) StatsService() mona.StatsAccessor { @@ -225,7 +226,8 @@ func (r *RabbitMQ) DefaultPodRoleBindingName() string { } func (r *RabbitMQ) ConfigSecretName() string { - return meta_util.NameWithSuffix(r.OffshootName(), "config") + uid := string(r.UID) + return meta_util.NameWithSuffix(r.OffshootName(), uid[len(uid)-6:]) } func (r *RabbitMQ) DefaultUserCredSecretName() string { @@ -315,6 +317,8 @@ func (r *RabbitMQ) SetDefaults(kc client.Client) { r.SetTLSDefaults() + r.Spec.Configuration = copyConfigurationField(r.Spec.Configuration, &r.Spec.ConfigSecret) + r.SetHealthCheckerDefaults() if r.Spec.Monitor != nil { if r.Spec.Monitor.Prometheus == nil { diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/rabbitmq_types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/rabbitmq_types.go index 50a016b0b..ff75f64c5 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/rabbitmq_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/rabbitmq_types.go @@ -87,6 +87,9 @@ type RabbitMQSpec struct { // +optional ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + // +optional + Configuration *ConfigurationSpec `json:"configuration,omitempty"` + // TLS contains tls configurations // +optional TLS *kmapi.TLSConfig `json:"tls,omitempty"` diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/redis_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/redis_helpers.go index 9ac7ebb08..3f77c3a87 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/redis_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/redis_helpers.go @@ -189,7 +189,8 @@ func (r redisStatsService) Path() string { } func (r redisStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (r redisStatsService) TLSConfig() *promapi.TLSConfig { diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/redis_sentinel_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/redis_sentinel_helpers.go index 73d2fa19b..c6005c8f1 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/redis_sentinel_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/redis_sentinel_helpers.go @@ -164,7 +164,8 @@ func (rs redisSentinelStatsService) Path() string { } func (r redisSentinelStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (r redisSentinelStatsService) TLSConfig() *promapi.TLSConfig { diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/singlestore_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/singlestore_helpers.go index d6fa1d1b2..25e344fd7 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/singlestore_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/singlestore_helpers.go @@ -116,7 +116,8 @@ func (s singlestoreStatsService) Path() string { } func (s singlestoreStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (s singlestoreStatsService) TLSConfig() *promapi.TLSConfig { @@ -249,10 +250,6 @@ func (s *Singlestore) PodLabel(podTemplate *ofst.PodTemplateSpec) map[string]str return s.offshootLabels(s.OffshootSelectors(), nil) } -func (s *Singlestore) ConfigSecretName() string { - return metautil.NameWithSuffix(s.OffshootName(), "config") -} - func (s *Singlestore) PetSetName() string { return s.OffshootName() } @@ -535,6 +532,18 @@ func (s *Singlestore) ReplicasAreReady(lister pslister.PetSetLister) (bool, stri return checkReplicasOfPetSet(lister.PetSets(s.Namespace), labels.SelectorFromSet(s.OffshootLabels()), expectedItems) } +// ConfigSecretName returns the name of the inline config secret +// it expects a suffix to differentiate between aggregator and leaf config secrets +func (s *Singlestore) ConfigSecretName(suf string) string { + secretName := metautil.NameWithSuffix(s.OffshootName(), suf) + uid := string(s.UID) + return metautil.NameWithSuffix(secretName, uid[len(uid)-6:]) +} + +func (s *Singlestore) AddKeyPrefix(key string) string { + return metautil.NameWithPrefix(kubedb.InlineConfigKeyPrefixZZ, key) +} + type SinglestoreBind struct { *Singlestore } diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/singlestore_types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/singlestore_types.go index 0c77bebb3..07012702f 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/singlestore_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/singlestore_types.go @@ -71,10 +71,11 @@ type SinglestoreSpec struct { // Storage to specify how storage shall be used. Storage *core.PersistentVolumeClaimSpec `json:"storage,omitempty"` - // ConfigSecret is an optional field to provide custom configuration file for database (i.e config.properties). + // Configuration is an optional field to provide custom configuration file for database (i.e config.properties). // If specified, this file will be used as configuration file otherwise default configuration file will be used. + // You can provide custom configurations using Secret or ApplyConfig. // +optional - ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + Configuration *ConfigurationSpec `json:"configuration,omitempty"` // Init is used to initialize database // +optional @@ -132,10 +133,10 @@ type SinglestoreNode struct { // +optional Suffix string `json:"suffix,omitempty"` - // ConfigSecret is an optional field to provide custom configuration file for database (i.e config.properties). + // Configuration is an optional field to provide custom configuration file for database (i.e config.properties). // If specified, this file will be used as configuration file otherwise default configuration file will be used. // +optional - ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + Configuration *ConfigurationSpec `json:"configuration,omitempty"` // Storage to specify how storage shall be used. // +optional diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/solr_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/solr_helpers.go index 02c69e0f8..d9720f057 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/solr_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/solr_helpers.go @@ -98,6 +98,11 @@ func (s *Solr) SolrSecretName(suffix string) string { return strings.Join([]string{s.Name, suffix}, "-") } +func (s *Solr) SolrConfigSecretName() string { + uid := string(s.UID) + return meta_util.NameWithSuffix(s.OffshootName(), uid[len(uid)-6:]) +} + func (s *Solr) GetAuthSecretName() string { if s.Spec.AuthSecret != nil && s.Spec.AuthSecret.Name != "" { return s.Spec.AuthSecret.Name @@ -109,6 +114,10 @@ func (s *Solr) SolrSecretKey() string { return kubedb.SolrSecretKey } +func (s *Solr) SolrInlineConfigSecretKey(key string) string { + return fmt.Sprintf("%s-%s", kubedb.InlineConfigKeyPrefix, key) +} + func (s *Solr) Merge(opt map[string]string) map[string]string { if len(s.Spec.SolrOpts) == 0 { return opt @@ -230,7 +239,8 @@ func (s solrStatsService) Path() string { } func (s solrStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (s solrStatsService) TLSConfig() *promapi.TLSConfig { diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/solr_types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/solr_types.go index de91cd8df..4fdc9bc84 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/solr_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/solr_types.go @@ -99,7 +99,7 @@ type SolrSpec struct { DisableSecurity bool `json:"disableSecurity,omitempty"` // +optional - ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + Configuration *ConfigurationSpec `json:"configuration,omitempty"` // +optional KeystoreSecret *core.LocalObjectReference `json:"keystoreSecret,omitempty"` diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/types.go index c4285e520..867e1cb0f 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/types.go @@ -222,6 +222,20 @@ type SecretReference struct { ExternallyManaged bool `json:"externallyManaged,omitempty"` } +type ConfigurationSpec struct { + // SecretName is an optional field to provide custom configuration file for the database (i.e. mssql.conf). + // If specified, these configurations will be used with default configurations (if any) and applyConfig configurations (if any). + // Configurations from this secret will override default configurations. + // This secret must be created by user. + // +optional + SecretName string `json:"secretName,omitempty"` + + // Inline contains key-value pairs of configurations to be applied to the database. + // These configurations will override both default configurations and configurations from the config secret (if any). + // +optional + Inline map[string]string `json:"inline,omitempty"` +} + type Age struct { // Populated by Provisioner when authSecret is created or Ops Manager when authSecret is updated. LastUpdateTimestamp metav1.Time `json:"lastUpdateTimestamp,omitempty"` diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/weaviate_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/weaviate_helpers.go index bf6728cd0..e0f20c793 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/weaviate_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/weaviate_helpers.go @@ -257,5 +257,6 @@ func (w *Weaviate) GetConnectionScheme() string { } func (w *Weaviate) ConfigSecretName() string { - return fmt.Sprintf("%s-config", w.Name) + uid := string(w.UID) + return meta_util.NameWithSuffix(w.OffshootName(), uid[len(uid)-6:]) } diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/weaviate_types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/weaviate_types.go index 3765d93ca..47bd6e311 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/weaviate_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/weaviate_types.go @@ -75,10 +75,11 @@ type WeaviateSpec struct { // +optional AuthSecret *SecretReference `json:"authSecret,omitempty"` - // ConfigSecret is an optional field to provide custom configuration file for database (i.e conf.yaml). + // Configuration is an optional field to provide custom configuration file for database (i.e conf.yaml). // If specified, this file will be used as configuration file otherwise default configuration file will be used. + // You can provide custom configurations using Secret or ApplyConfig. // +optional - ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + Configuration *ConfigurationSpec `json:"configuration,omitempty"` // PodTemplate is an optional configuration for pods used to expose database // +optional diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/zookeeper_helpers.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/zookeeper_helpers.go index 6c7452ffb..033279d35 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/zookeeper_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/zookeeper_helpers.go @@ -87,7 +87,12 @@ func (z *ZooKeeper) ServiceAccountName() string { } func (z *ZooKeeper) ConfigSecretName() string { - return meta_util.NameWithSuffix(z.OffshootName(), "config") + uid := string(z.UID) + return meta_util.NameWithSuffix(z.OffshootName(), uid[len(uid)-6:]) +} + +func (z *ZooKeeper) AddKeyPrefix(key string) string { + return meta_util.NameWithPrefix(kubedb.InlineConfigKeyPrefixZZ, key) } func (z *ZooKeeper) PVCName(alias string) string { @@ -350,7 +355,8 @@ func (z zookeeperStatsService) Path() string { } func (z zookeeperStatsService) Scheme() string { - return "" + sc := promapi.SchemeHTTP + return sc.String() } func (z zookeeperStatsService) TLSConfig() *promapi.TLSConfig { diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/zookeeper_types.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/zookeeper_types.go index 8782b326e..db8343ed0 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/zookeeper_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/zookeeper_types.go @@ -86,10 +86,11 @@ type ZooKeeperSpec struct { // +optional AuthSecret *SecretReference `json:"authSecret,omitempty"` - // ConfigSecret is an optional field to provide custom configuration file for database (i.e config.properties). + // Configuration is an optional field to provide custom configuration file for database (i.e config.properties). // If specified, this file will be used as configuration file otherwise default configuration file will be used. + // You can provide custom configurations using SecretName or ApplyConfig. // +optional - ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + Configuration *ConfigurationSpec `json:"configuration,omitempty"` // Keystore encryption secret // +optional diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/zz_generated.conversion.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/zz_generated.conversion.go index 163c01c3b..6f7b18569 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/zz_generated.conversion.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/zz_generated.conversion.go @@ -124,6 +124,16 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddGeneratedConversionFunc((*ConfigurationSpec)(nil), (*v1.ConfigurationSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_ConfigurationSpec_To_v1_ConfigurationSpec(a.(*ConfigurationSpec), b.(*v1.ConfigurationSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1.ConfigurationSpec)(nil), (*ConfigurationSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_ConfigurationSpec_To_v1alpha2_ConfigurationSpec(a.(*v1.ConfigurationSpec), b.(*ConfigurationSpec), scope) + }); err != nil { + return err + } if err := s.AddGeneratedConversionFunc((*ConnectionPoolConfig)(nil), (*v1.ConnectionPoolConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha2_ConnectionPoolConfig_To_v1_ConnectionPoolConfig(a.(*ConnectionPoolConfig), b.(*v1.ConnectionPoolConfig), scope) }); err != nil { @@ -274,16 +284,6 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*KafkaCruiseControl)(nil), (*v1.KafkaCruiseControl)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha2_KafkaCruiseControl_To_v1_KafkaCruiseControl(a.(*KafkaCruiseControl), b.(*v1.KafkaCruiseControl), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.KafkaCruiseControl)(nil), (*KafkaCruiseControl)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1_KafkaCruiseControl_To_v1alpha2_KafkaCruiseControl(a.(*v1.KafkaCruiseControl), b.(*KafkaCruiseControl), scope) - }); err != nil { - return err - } if err := s.AddGeneratedConversionFunc((*KafkaList)(nil), (*v1.KafkaList)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha2_KafkaList_To_v1_KafkaList(a.(*KafkaList), b.(*v1.KafkaList), scope) }); err != nil { @@ -299,11 +299,6 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1.KafkaSpec)(nil), (*KafkaSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1_KafkaSpec_To_v1alpha2_KafkaSpec(a.(*v1.KafkaSpec), b.(*KafkaSpec), scope) - }); err != nil { - return err - } if err := s.AddGeneratedConversionFunc((*KafkaStatus)(nil), (*v1.KafkaStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha2_KafkaStatus_To_v1_KafkaStatus(a.(*KafkaStatus), b.(*v1.KafkaStatus), scope) }); err != nil { @@ -859,11 +854,21 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddConversionFunc((*v1.KafkaCruiseControl)(nil), (*KafkaCruiseControl)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_KafkaCruiseControl_To_v1alpha2_KafkaCruiseControl(a.(*v1.KafkaCruiseControl), b.(*KafkaCruiseControl), scope) + }); err != nil { + return err + } if err := s.AddConversionFunc((*v1.KafkaNode)(nil), (*KafkaNode)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1_KafkaNode_To_v1alpha2_KafkaNode(a.(*v1.KafkaNode), b.(*KafkaNode), scope) }); err != nil { return err } + if err := s.AddConversionFunc((*v1.KafkaSpec)(nil), (*KafkaSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_KafkaSpec_To_v1alpha2_KafkaSpec(a.(*v1.KafkaSpec), b.(*KafkaSpec), scope) + }); err != nil { + return err + } if err := s.AddConversionFunc((*v1.MariaDBSpec)(nil), (*MariaDBSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1_MariaDBSpec_To_v1alpha2_MariaDBSpec(a.(*v1.MariaDBSpec), b.(*MariaDBSpec), scope) }); err != nil { @@ -959,6 +964,11 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } + if err := s.AddConversionFunc((*KafkaCruiseControl)(nil), (*v1.KafkaCruiseControl)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha2_KafkaCruiseControl_To_v1_KafkaCruiseControl(a.(*KafkaCruiseControl), b.(*v1.KafkaCruiseControl), scope) + }); err != nil { + return err + } if err := s.AddConversionFunc((*KafkaNode)(nil), (*v1.KafkaNode)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha2_KafkaNode_To_v1_KafkaNode(a.(*KafkaNode), b.(*v1.KafkaNode), scope) }); err != nil { @@ -1227,6 +1237,28 @@ func Convert_v1_BrokerRack_To_v1alpha2_BrokerRack(in *v1.BrokerRack, out *Broker return autoConvert_v1_BrokerRack_To_v1alpha2_BrokerRack(in, out, s) } +func autoConvert_v1alpha2_ConfigurationSpec_To_v1_ConfigurationSpec(in *ConfigurationSpec, out *v1.ConfigurationSpec, s conversion.Scope) error { + out.SecretName = in.SecretName + out.Inline = *(*map[string]string)(unsafe.Pointer(&in.Inline)) + return nil +} + +// Convert_v1alpha2_ConfigurationSpec_To_v1_ConfigurationSpec is an autogenerated conversion function. +func Convert_v1alpha2_ConfigurationSpec_To_v1_ConfigurationSpec(in *ConfigurationSpec, out *v1.ConfigurationSpec, s conversion.Scope) error { + return autoConvert_v1alpha2_ConfigurationSpec_To_v1_ConfigurationSpec(in, out, s) +} + +func autoConvert_v1_ConfigurationSpec_To_v1alpha2_ConfigurationSpec(in *v1.ConfigurationSpec, out *ConfigurationSpec, s conversion.Scope) error { + out.SecretName = in.SecretName + out.Inline = *(*map[string]string)(unsafe.Pointer(&in.Inline)) + return nil +} + +// Convert_v1_ConfigurationSpec_To_v1alpha2_ConfigurationSpec is an autogenerated conversion function. +func Convert_v1_ConfigurationSpec_To_v1alpha2_ConfigurationSpec(in *v1.ConfigurationSpec, out *ConfigurationSpec, s conversion.Scope) error { + return autoConvert_v1_ConfigurationSpec_To_v1alpha2_ConfigurationSpec(in, out, s) +} + func autoConvert_v1alpha2_ConnectionPoolConfig_To_v1_ConnectionPoolConfig(in *ConnectionPoolConfig, out *v1.ConnectionPoolConfig, s conversion.Scope) error { out.Port = (*int32)(unsafe.Pointer(in.Port)) out.PoolMode = in.PoolMode @@ -1696,6 +1728,7 @@ func autoConvert_v1_ElasticsearchSpec_To_v1alpha2_ElasticsearchSpec(in *v1.Elast out.Init = (*InitSpec)(unsafe.Pointer(in.Init)) out.Monitor = (*monitoringagentapiapiv1.AgentSpec)(unsafe.Pointer(in.Monitor)) out.ConfigSecret = (*corev1.LocalObjectReference)(unsafe.Pointer(in.ConfigSecret)) + // WARNING: in.Configuration requires manual conversion: does not exist in peer-type out.SecureConfigSecret = (*corev1.LocalObjectReference)(unsafe.Pointer(in.SecureConfigSecret)) if err := Convert_v2_PodTemplateSpec_To_v1_PodTemplateSpec(&in.PodTemplate, &out.PodTemplate, s); err != nil { return err @@ -1982,35 +2015,24 @@ func Convert_v1_KafkaClusterTopology_To_v1alpha2_KafkaClusterTopology(in *v1.Kaf } func autoConvert_v1alpha2_KafkaCruiseControl_To_v1_KafkaCruiseControl(in *KafkaCruiseControl, out *v1.KafkaCruiseControl, s conversion.Scope) error { - out.ConfigSecret = (*v1.SecretReference)(unsafe.Pointer(in.ConfigSecret)) + // WARNING: in.ConfigSecret requires manual conversion: does not exist in peer-type out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) out.Suffix = in.Suffix - out.Resources = in.Resources + // WARNING: in.Resources requires manual conversion: does not exist in peer-type out.PodTemplate = in.PodTemplate out.BrokerCapacity = (*v1.KafkaBrokerCapacity)(unsafe.Pointer(in.BrokerCapacity)) return nil } -// Convert_v1alpha2_KafkaCruiseControl_To_v1_KafkaCruiseControl is an autogenerated conversion function. -func Convert_v1alpha2_KafkaCruiseControl_To_v1_KafkaCruiseControl(in *KafkaCruiseControl, out *v1.KafkaCruiseControl, s conversion.Scope) error { - return autoConvert_v1alpha2_KafkaCruiseControl_To_v1_KafkaCruiseControl(in, out, s) -} - func autoConvert_v1_KafkaCruiseControl_To_v1alpha2_KafkaCruiseControl(in *v1.KafkaCruiseControl, out *KafkaCruiseControl, s conversion.Scope) error { - out.ConfigSecret = (*SecretReference)(unsafe.Pointer(in.ConfigSecret)) + // WARNING: in.Configuration requires manual conversion: does not exist in peer-type out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) out.Suffix = in.Suffix - out.Resources = in.Resources out.PodTemplate = in.PodTemplate out.BrokerCapacity = (*KafkaBrokerCapacity)(unsafe.Pointer(in.BrokerCapacity)) return nil } -// Convert_v1_KafkaCruiseControl_To_v1alpha2_KafkaCruiseControl is an autogenerated conversion function. -func Convert_v1_KafkaCruiseControl_To_v1alpha2_KafkaCruiseControl(in *v1.KafkaCruiseControl, out *KafkaCruiseControl, s conversion.Scope) error { - return autoConvert_v1_KafkaCruiseControl_To_v1alpha2_KafkaCruiseControl(in, out, s) -} - func autoConvert_v1alpha2_KafkaList_To_v1_KafkaList(in *KafkaList, out *v1.KafkaList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { @@ -2100,7 +2122,15 @@ func autoConvert_v1alpha2_KafkaSpec_To_v1_KafkaSpec(in *KafkaSpec, out *v1.Kafka out.ServiceTemplates = *(*[]v1.NamedServiceTemplateSpec)(unsafe.Pointer(&in.ServiceTemplates)) out.DeletionPolicy = v1.DeletionPolicy(in.DeletionPolicy) out.HealthChecker = in.HealthChecker - out.CruiseControl = (*v1.KafkaCruiseControl)(unsafe.Pointer(in.CruiseControl)) + if in.CruiseControl != nil { + in, out := &in.CruiseControl, &out.CruiseControl + *out = new(v1.KafkaCruiseControl) + if err := Convert_v1alpha2_KafkaCruiseControl_To_v1_KafkaCruiseControl(*in, *out, s); err != nil { + return err + } + } else { + out.CruiseControl = nil + } out.Monitor = (*monitoringagentapiapiv1.AgentSpec)(unsafe.Pointer(in.Monitor)) return nil } @@ -2132,6 +2162,7 @@ func autoConvert_v1_KafkaSpec_To_v1alpha2_KafkaSpec(in *v1.KafkaSpec, out *Kafka out.DisableSecurity = in.DisableSecurity out.AuthSecret = (*SecretReference)(unsafe.Pointer(in.AuthSecret)) out.ConfigSecret = (*corev1.LocalObjectReference)(unsafe.Pointer(in.ConfigSecret)) + // WARNING: in.Configuration requires manual conversion: does not exist in peer-type out.KeystoreCredSecret = (*SecretReference)(unsafe.Pointer(in.KeystoreCredSecret)) out.Halted = in.Halted out.TLS = (*clientgoapiv1.TLSConfig)(unsafe.Pointer(in.TLS)) @@ -2139,16 +2170,19 @@ func autoConvert_v1_KafkaSpec_To_v1alpha2_KafkaSpec(in *v1.KafkaSpec, out *Kafka out.ServiceTemplates = *(*[]NamedServiceTemplateSpec)(unsafe.Pointer(&in.ServiceTemplates)) out.DeletionPolicy = DeletionPolicy(in.DeletionPolicy) out.HealthChecker = in.HealthChecker - out.CruiseControl = (*KafkaCruiseControl)(unsafe.Pointer(in.CruiseControl)) + if in.CruiseControl != nil { + in, out := &in.CruiseControl, &out.CruiseControl + *out = new(KafkaCruiseControl) + if err := Convert_v1_KafkaCruiseControl_To_v1alpha2_KafkaCruiseControl(*in, *out, s); err != nil { + return err + } + } else { + out.CruiseControl = nil + } out.Monitor = (*monitoringagentapiapiv1.AgentSpec)(unsafe.Pointer(in.Monitor)) return nil } -// Convert_v1_KafkaSpec_To_v1alpha2_KafkaSpec is an autogenerated conversion function. -func Convert_v1_KafkaSpec_To_v1alpha2_KafkaSpec(in *v1.KafkaSpec, out *KafkaSpec, s conversion.Scope) error { - return autoConvert_v1_KafkaSpec_To_v1alpha2_KafkaSpec(in, out, s) -} - func autoConvert_v1alpha2_KafkaStatus_To_v1_KafkaStatus(in *KafkaStatus, out *v1.KafkaStatus, s conversion.Scope) error { out.Phase = v1.DatabasePhase(in.Phase) out.ObservedGeneration = in.ObservedGeneration @@ -2337,6 +2371,7 @@ func autoConvert_v1_MariaDBSpec_To_v1alpha2_MariaDBSpec(in *v1.MariaDBSpec, out out.Init = (*InitSpec)(unsafe.Pointer(in.Init)) out.Monitor = (*monitoringagentapiapiv1.AgentSpec)(unsafe.Pointer(in.Monitor)) out.ConfigSecret = (*corev1.LocalObjectReference)(unsafe.Pointer(in.ConfigSecret)) + // WARNING: in.Configuration requires manual conversion: does not exist in peer-type if err := Convert_v2_PodTemplateSpec_To_v1_PodTemplateSpec(&in.PodTemplate, &out.PodTemplate, s); err != nil { return err } @@ -2475,6 +2510,7 @@ func autoConvert_v1_MemcachedSpec_To_v1alpha2_MemcachedSpec(in *v1.MemcachedSpec out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) out.Monitor = (*monitoringagentapiapiv1.AgentSpec)(unsafe.Pointer(in.Monitor)) out.ConfigSecret = (*corev1.LocalObjectReference)(unsafe.Pointer(in.ConfigSecret)) + // WARNING: in.Configuration requires manual conversion: does not exist in peer-type // WARNING: in.AuthSecret requires manual conversion: does not exist in peer-type // WARNING: in.DisableAuth requires manual conversion: does not exist in peer-type out.DataVolume = (*corev1.VolumeSource)(unsafe.Pointer(in.DataVolume)) @@ -2521,6 +2557,7 @@ func autoConvert_v1alpha2_MongoArbiterNode_To_v1_MongoArbiterNode(in *MongoArbit func autoConvert_v1_MongoArbiterNode_To_v1alpha2_MongoArbiterNode(in *v1.MongoArbiterNode, out *MongoArbiterNode, s conversion.Scope) error { out.ConfigSecret = (*corev1.LocalObjectReference)(unsafe.Pointer(in.ConfigSecret)) + // WARNING: in.Configuration requires manual conversion: does not exist in peer-type // WARNING: in.PodTemplate requires manual conversion: inconvertible types (*kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec vs kmodules.xyz/offshoot-api/api/v1.PodTemplateSpec) return nil } @@ -2663,6 +2700,7 @@ func autoConvert_v1_MongoDBNode_To_v1alpha2_MongoDBNode(in *v1.MongoDBNode, out out.Replicas = in.Replicas out.Prefix = in.Prefix out.ConfigSecret = (*corev1.LocalObjectReference)(unsafe.Pointer(in.ConfigSecret)) + // WARNING: in.Configuration requires manual conversion: does not exist in peer-type // WARNING: in.PodTemplate requires manual conversion: inconvertible types (*kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec vs kmodules.xyz/offshoot-api/api/v1.PodTemplateSpec) return nil } @@ -2855,6 +2893,7 @@ func autoConvert_v1_MongoDBSpec_To_v1alpha2_MongoDBSpec(in *v1.MongoDBSpec, out out.Init = (*InitSpec)(unsafe.Pointer(in.Init)) out.Monitor = (*monitoringagentapiapiv1.AgentSpec)(unsafe.Pointer(in.Monitor)) out.ConfigSecret = (*corev1.LocalObjectReference)(unsafe.Pointer(in.ConfigSecret)) + // WARNING: in.Configuration requires manual conversion: does not exist in peer-type if in.PodTemplate != nil { in, out := &in.PodTemplate, &out.PodTemplate *out = new(apiv1.PodTemplateSpec) @@ -2930,6 +2969,7 @@ func autoConvert_v1alpha2_MongoHiddenNode_To_v1_MongoHiddenNode(in *MongoHiddenN func autoConvert_v1_MongoHiddenNode_To_v1alpha2_MongoHiddenNode(in *v1.MongoHiddenNode, out *MongoHiddenNode, s conversion.Scope) error { out.ConfigSecret = (*corev1.LocalObjectReference)(unsafe.Pointer(in.ConfigSecret)) + // WARNING: in.Configuration requires manual conversion: does not exist in peer-type // WARNING: in.PodTemplate requires manual conversion: inconvertible types (*kmodules.xyz/offshoot-api/api/v2.PodTemplateSpec vs kmodules.xyz/offshoot-api/api/v1.PodTemplateSpec) out.Replicas = in.Replicas out.Storage = in.Storage @@ -3150,6 +3190,7 @@ func autoConvert_v1_MySQLSpec_To_v1alpha2_MySQLSpec(in *v1.MySQLSpec, out *MySQL out.Init = (*InitSpec)(unsafe.Pointer(in.Init)) out.Monitor = (*monitoringagentapiapiv1.AgentSpec)(unsafe.Pointer(in.Monitor)) out.ConfigSecret = (*corev1.LocalObjectReference)(unsafe.Pointer(in.ConfigSecret)) + // WARNING: in.Configuration requires manual conversion: does not exist in peer-type if err := Convert_v2_PodTemplateSpec_To_v1_PodTemplateSpec(&in.PodTemplate, &out.PodTemplate, s); err != nil { return err } @@ -3415,6 +3456,7 @@ func autoConvert_v1_PerconaXtraDBSpec_To_v1alpha2_PerconaXtraDBSpec(in *v1.Perco out.Init = (*InitSpec)(unsafe.Pointer(in.Init)) out.Monitor = (*monitoringagentapiapiv1.AgentSpec)(unsafe.Pointer(in.Monitor)) out.ConfigSecret = (*corev1.LocalObjectReference)(unsafe.Pointer(in.ConfigSecret)) + // WARNING: in.Configuration requires manual conversion: does not exist in peer-type if err := Convert_v2_PodTemplateSpec_To_v1_PodTemplateSpec(&in.PodTemplate, &out.PodTemplate, s); err != nil { return err } @@ -3570,6 +3612,7 @@ func autoConvert_v1_PgBouncerSpec_To_v1alpha2_PgBouncerSpec(in *v1.PgBouncerSpec out.ConnectionPool = (*ConnectionPoolConfig)(unsafe.Pointer(in.ConnectionPool)) out.AuthSecret = (*SecretReference)(unsafe.Pointer(in.AuthSecret)) out.ConfigSecret = (*corev1.LocalObjectReference)(unsafe.Pointer(in.ConfigSecret)) + // WARNING: in.Configuration requires manual conversion: does not exist in peer-type // WARNING: in.Init requires manual conversion: does not exist in peer-type out.Monitor = (*monitoringagentapiapiv1.AgentSpec)(unsafe.Pointer(in.Monitor)) out.SSLMode = PgBouncerSSLMode(in.SSLMode) @@ -3719,7 +3762,7 @@ func autoConvert_v1alpha2_PostgresReplication_To_v1_PostgresReplication(in *Post out.WalKeepSizeInMegaBytes = (*int32)(unsafe.Pointer(in.WalKeepSizeInMegaBytes)) out.WalKeepSegment = (*int32)(unsafe.Pointer(in.WalKeepSegment)) out.MaxSlotWALKeepSizeInMegaBytes = (*int32)(unsafe.Pointer(in.MaxSlotWALKeepSizeInMegaBytes)) - out.ForceFailOverAcceptingDataLossAfter = (*metav1.Duration)(unsafe.Pointer(in.ForceFailOverAcceptingDataLossAfter)) + out.ForceFailoverAcceptingDataLossAfter = (*metav1.Duration)(unsafe.Pointer(in.ForceFailoverAcceptingDataLossAfter)) return nil } @@ -3733,7 +3776,7 @@ func autoConvert_v1_PostgresReplication_To_v1alpha2_PostgresReplication(in *v1.P out.WalKeepSizeInMegaBytes = (*int32)(unsafe.Pointer(in.WalKeepSizeInMegaBytes)) out.WalKeepSegment = (*int32)(unsafe.Pointer(in.WalKeepSegment)) out.MaxSlotWALKeepSizeInMegaBytes = (*int32)(unsafe.Pointer(in.MaxSlotWALKeepSizeInMegaBytes)) - out.ForceFailOverAcceptingDataLossAfter = (*metav1.Duration)(unsafe.Pointer(in.ForceFailOverAcceptingDataLossAfter)) + out.ForceFailoverAcceptingDataLossAfter = (*metav1.Duration)(unsafe.Pointer(in.ForceFailoverAcceptingDataLossAfter)) return nil } @@ -3798,6 +3841,7 @@ func autoConvert_v1_PostgresSpec_To_v1alpha2_PostgresSpec(in *v1.PostgresSpec, o out.Init = (*InitSpec)(unsafe.Pointer(in.Init)) out.Monitor = (*monitoringagentapiapiv1.AgentSpec)(unsafe.Pointer(in.Monitor)) out.ConfigSecret = (*corev1.LocalObjectReference)(unsafe.Pointer(in.ConfigSecret)) + // WARNING: in.Configuration requires manual conversion: does not exist in peer-type if err := Convert_v2_PodTemplateSpec_To_v1_PodTemplateSpec(&in.PodTemplate, &out.PodTemplate, s); err != nil { return err } @@ -3811,7 +3855,6 @@ func autoConvert_v1_PostgresSpec_To_v1alpha2_PostgresSpec(in *v1.PostgresSpec, o out.Archiver = (*Archiver)(unsafe.Pointer(in.Archiver)) out.Arbiter = (*ArbiterSpec)(unsafe.Pointer(in.Arbiter)) out.Replication = (*PostgresReplication)(unsafe.Pointer(in.Replication)) - // WARNING: in.Tuning requires manual conversion: does not exist in peer-type return nil } @@ -3970,12 +4013,13 @@ func autoConvert_v1_ProxySQLSpec_To_v1alpha2_ProxySQLSpec(in *v1.ProxySQLSpec, o } out.SyncUsers = in.SyncUsers out.InitConfiguration = (*ProxySQLConfiguration)(unsafe.Pointer(in.InitConfiguration)) + out.ConfigSecret = (*corev1.LocalObjectReference)(unsafe.Pointer(in.ConfigSecret)) + // WARNING: in.Configuration requires manual conversion: does not exist in peer-type out.Version = in.Version out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) out.Backend = (*corev1.LocalObjectReference)(unsafe.Pointer(in.Backend)) out.AuthSecret = (*SecretReference)(unsafe.Pointer(in.AuthSecret)) out.Monitor = (*monitoringagentapiapiv1.AgentSpec)(unsafe.Pointer(in.Monitor)) - out.ConfigSecret = (*corev1.LocalObjectReference)(unsafe.Pointer(in.ConfigSecret)) if err := Convert_v2_PodTemplateSpec_To_v1_PodTemplateSpec(&in.PodTemplate, &out.PodTemplate, s); err != nil { return err } @@ -4331,6 +4375,7 @@ func autoConvert_v1alpha2_RedisSpec_To_v1_RedisSpec(in *RedisSpec, out *v1.Redis } func autoConvert_v1_RedisSpec_To_v1alpha2_RedisSpec(in *v1.RedisSpec, out *RedisSpec, s conversion.Scope) error { + // WARNING: in.Acl requires manual conversion: does not exist in peer-type if err := Convert_v1_AutoOpsSpec_To_v1alpha2_AutoOpsSpec(&in.AutoOps, &out.AutoOps, s); err != nil { return err } @@ -4350,11 +4395,11 @@ func autoConvert_v1_RedisSpec_To_v1alpha2_RedisSpec(in *v1.RedisSpec, out *Redis out.StorageType = StorageType(in.StorageType) out.Storage = (*corev1.PersistentVolumeClaimSpec)(unsafe.Pointer(in.Storage)) out.AuthSecret = (*SecretReference)(unsafe.Pointer(in.AuthSecret)) - // WARNING: in.Acl requires manual conversion: does not exist in peer-type out.DisableAuth = in.DisableAuth out.Init = (*InitSpec)(unsafe.Pointer(in.Init)) out.Monitor = (*monitoringagentapiapiv1.AgentSpec)(unsafe.Pointer(in.Monitor)) out.ConfigSecret = (*corev1.LocalObjectReference)(unsafe.Pointer(in.ConfigSecret)) + // WARNING: in.Configuration requires manual conversion: does not exist in peer-type if err := Convert_v2_PodTemplateSpec_To_v1_PodTemplateSpec(&in.PodTemplate, &out.PodTemplate, s); err != nil { return err } diff --git a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/zz_generated.deepcopy.go b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/zz_generated.deepcopy.go index 802cb1cfe..5894b7b84 100644 --- a/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/zz_generated.deepcopy.go +++ b/vendor/kubedb.dev/apimachinery/apis/kubedb/v1alpha2/zz_generated.deepcopy.go @@ -326,10 +326,10 @@ func (in *CassandraSpec) DeepCopyInto(out *CassandraSpec) { *out = new(SecretReference) (*in).DeepCopyInto(*out) } - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(corev1.LocalObjectReference) - **out = **in + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(ConfigurationSpec) + (*in).DeepCopyInto(*out) } if in.KeystoreCredSecret != nil { in, out := &in.KeystoreCredSecret, &out.KeystoreCredSecret @@ -584,10 +584,10 @@ func (in *ClickHouseSpec) DeepCopyInto(out *ClickHouseSpec) { *out = new(SecretReference) (*in).DeepCopyInto(*out) } - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(corev1.LocalObjectReference) - **out = **in + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(ConfigurationSpec) + (*in).DeepCopyInto(*out) } if in.PodTemplate != nil { in, out := &in.PodTemplate, &out.PodTemplate @@ -772,6 +772,29 @@ func (in *ClusterTopology) DeepCopy() *ClusterTopology { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigurationSpec) DeepCopyInto(out *ConfigurationSpec) { + *out = *in + if in.Inline != nil { + in, out := &in.Inline, &out.Inline + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigurationSpec. +func (in *ConfigurationSpec) DeepCopy() *ConfigurationSpec { + if in == nil { + return nil + } + out := new(ConfigurationSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ConnectionPoolConfig) DeepCopyInto(out *ConnectionPoolConfig) { *out = *in @@ -1300,10 +1323,10 @@ func (in *DruidSpec) DeepCopyInto(out *DruidSpec) { *out = new(InitSpec) (*in).DeepCopyInto(*out) } - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(corev1.LocalObjectReference) - **out = **in + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(ConfigurationSpec) + (*in).DeepCopyInto(*out) } if in.KeystoreCredSecret != nil { in, out := &in.KeystoreCredSecret, &out.KeystoreCredSecret @@ -2335,10 +2358,10 @@ func (in *HanaDBSpec) DeepCopyInto(out *HanaDBSpec) { *out = new(SecretReference) (*in).DeepCopyInto(*out) } - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(corev1.LocalObjectReference) - **out = **in + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(ConfigurationSpec) + (*in).DeepCopyInto(*out) } if in.PodTemplate != nil { in, out := &in.PodTemplate, &out.PodTemplate @@ -2537,10 +2560,10 @@ func (in *HazelcastSpec) DeepCopyInto(out *HazelcastSpec) { *out = make([]string, len(*in)) copy(*out, *in) } - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(corev1.LocalObjectReference) - **out = **in + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(ConfigurationSpec) + (*in).DeepCopyInto(*out) } if in.AuthSecret != nil { in, out := &in.AuthSecret, &out.AuthSecret @@ -2708,10 +2731,10 @@ func (in *IgniteSpec) DeepCopyInto(out *IgniteSpec) { *out = new(SecretReference) (*in).DeepCopyInto(*out) } - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(corev1.LocalObjectReference) - **out = **in + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(ConfigurationSpec) + (*in).DeepCopyInto(*out) } in.PodTemplate.DeepCopyInto(&out.PodTemplate) if in.ServiceTemplates != nil { @@ -2895,8 +2918,8 @@ func (in *KafkaCruiseControl) DeepCopyInto(out *KafkaCruiseControl) { *out = *in if in.ConfigSecret != nil { in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(SecretReference) - (*in).DeepCopyInto(*out) + *out = new(corev1.LocalObjectReference) + **out = **in } if in.Replicas != nil { in, out := &in.Replicas, &out.Replicas @@ -3357,6 +3380,11 @@ func (in *MSSQLServerSpec) DeepCopyInto(out *MSSQLServerSpec) { *out = new(corev1.LocalObjectReference) **out = **in } + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(ConfigurationSpec) + (*in).DeepCopyInto(*out) + } if in.Init != nil { in, out := &in.Init, &out.Init *out = new(InitSpec) @@ -3999,10 +4027,10 @@ func (in *MilvusSpec) DeepCopyInto(out *MilvusSpec) { *out = new(SecretReference) (*in).DeepCopyInto(*out) } - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(corev1.LocalObjectReference) - **out = **in + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(ConfigurationSpec) + (*in).DeepCopyInto(*out) } if in.ServiceTemplates != nil { in, out := &in.ServiceTemplates, &out.ServiceTemplates @@ -4876,10 +4904,10 @@ func (in *Neo4jSpec) DeepCopyInto(out *Neo4jSpec) { *out = new(SecretReference) (*in).DeepCopyInto(*out) } - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(corev1.LocalObjectReference) - **out = **in + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(ConfigurationSpec) + (*in).DeepCopyInto(*out) } in.PodTemplate.DeepCopyInto(&out.PodTemplate) if in.ServiceTemplates != nil { @@ -5053,10 +5081,10 @@ func (in *OracleSpec) DeepCopyInto(out *OracleSpec) { *out = new(corev1.PersistentVolumeClaimSpec) (*in).DeepCopyInto(*out) } - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(corev1.LocalObjectReference) - **out = **in + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(ConfigurationSpec) + (*in).DeepCopyInto(*out) } if in.AuthSecret != nil { in, out := &in.AuthSecret, &out.AuthSecret @@ -5561,10 +5589,10 @@ func (in *PgpoolSpec) DeepCopyInto(out *PgpoolSpec) { *out = new(SecretReference) (*in).DeepCopyInto(*out) } - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(corev1.LocalObjectReference) - **out = **in + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(ConfigurationSpec) + (*in).DeepCopyInto(*out) } if in.Init != nil { in, out := &in.Init, &out.Init @@ -5576,11 +5604,6 @@ func (in *PgpoolSpec) DeepCopyInto(out *PgpoolSpec) { *out = new(v2.PodTemplateSpec) (*in).DeepCopyInto(*out) } - if in.InitConfiguration != nil { - in, out := &in.InitConfiguration, &out.InitConfiguration - *out = new(PgpoolConfiguration) - (*in).DeepCopyInto(*out) - } if in.ServiceTemplates != nil { in, out := &in.ServiceTemplates, &out.ServiceTemplates *out = make([]NamedServiceTemplateSpec, len(*in)) @@ -5762,8 +5785,8 @@ func (in *PostgresReplication) DeepCopyInto(out *PostgresReplication) { *out = new(int32) **out = **in } - if in.ForceFailOverAcceptingDataLossAfter != nil { - in, out := &in.ForceFailOverAcceptingDataLossAfter, &out.ForceFailOverAcceptingDataLossAfter + if in.ForceFailoverAcceptingDataLossAfter != nil { + in, out := &in.ForceFailoverAcceptingDataLossAfter, &out.ForceFailoverAcceptingDataLossAfter *out = new(v1.Duration) **out = **in } @@ -6209,16 +6232,21 @@ func (in *QdrantSpec) DeepCopyInto(out *QdrantSpec) { *out = new(SecretReference) (*in).DeepCopyInto(*out) } - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(corev1.LocalObjectReference) - **out = **in + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(ConfigurationSpec) + (*in).DeepCopyInto(*out) } if in.PodTemplate != nil { in, out := &in.PodTemplate, &out.PodTemplate *out = new(v2.PodTemplateSpec) (*in).DeepCopyInto(*out) } + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(QdrantTLSConfig) + (*in).DeepCopyInto(*out) + } if in.ServiceTemplates != nil { in, out := &in.ServiceTemplates, &out.ServiceTemplates *out = make([]NamedServiceTemplateSpec, len(*in)) @@ -6263,6 +6291,33 @@ func (in *QdrantStatus) DeepCopy() *QdrantStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QdrantTLSConfig) DeepCopyInto(out *QdrantTLSConfig) { + *out = *in + in.TLSConfig.DeepCopyInto(&out.TLSConfig) + if in.P2P != nil { + in, out := &in.P2P, &out.P2P + *out = new(bool) + **out = **in + } + if in.Client != nil { + in, out := &in.Client, &out.Client + *out = new(bool) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QdrantTLSConfig. +func (in *QdrantTLSConfig) DeepCopy() *QdrantTLSConfig { + if in == nil { + return nil + } + out := new(QdrantTLSConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RabbitMQ) DeepCopyInto(out *RabbitMQ) { *out = *in @@ -6369,6 +6424,11 @@ func (in *RabbitMQSpec) DeepCopyInto(out *RabbitMQSpec) { *out = new(corev1.LocalObjectReference) **out = **in } + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(ConfigurationSpec) + (*in).DeepCopyInto(*out) + } if in.TLS != nil { in, out := &in.TLS, &out.TLS *out = new(apiv1.TLSConfig) @@ -7074,10 +7134,10 @@ func (in *SinglestoreNode) DeepCopyInto(out *SinglestoreNode) { *out = new(int32) **out = **in } - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(corev1.LocalObjectReference) - **out = **in + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(ConfigurationSpec) + (*in).DeepCopyInto(*out) } if in.Storage != nil { in, out := &in.Storage, &out.Storage @@ -7116,10 +7176,10 @@ func (in *SinglestoreSpec) DeepCopyInto(out *SinglestoreSpec) { *out = new(corev1.PersistentVolumeClaimSpec) (*in).DeepCopyInto(*out) } - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(corev1.LocalObjectReference) - **out = **in + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(ConfigurationSpec) + (*in).DeepCopyInto(*out) } if in.Init != nil { in, out := &in.Init, &out.Init @@ -7421,10 +7481,10 @@ func (in *SolrSpec) DeepCopyInto(out *SolrSpec) { *out = new(apiv1.TLSConfig) (*in).DeepCopyInto(*out) } - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(corev1.LocalObjectReference) - **out = **in + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(ConfigurationSpec) + (*in).DeepCopyInto(*out) } if in.KeystoreSecret != nil { in, out := &in.KeystoreSecret, &out.KeystoreSecret @@ -7671,10 +7731,10 @@ func (in *WeaviateSpec) DeepCopyInto(out *WeaviateSpec) { *out = new(SecretReference) (*in).DeepCopyInto(*out) } - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(corev1.LocalObjectReference) - **out = **in + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(ConfigurationSpec) + (*in).DeepCopyInto(*out) } in.PodTemplate.DeepCopyInto(&out.PodTemplate) if in.ServiceTemplates != nil { @@ -7822,10 +7882,10 @@ func (in *ZooKeeperSpec) DeepCopyInto(out *ZooKeeperSpec) { *out = new(SecretReference) (*in).DeepCopyInto(*out) } - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(corev1.LocalObjectReference) - **out = **in + if in.Configuration != nil { + in, out := &in.Configuration, &out.Configuration + *out = new(ConfigurationSpec) + (*in).DeepCopyInto(*out) } if in.KeystoreCredSecret != nil { in, out := &in.KeystoreCredSecret, &out.KeystoreCredSecret diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/cassandra_ops-types.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/cassandra_ops-types.go index 3e3bf3f23..3f8f222a8 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/cassandra_ops-types.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/cassandra_ops-types.go @@ -54,7 +54,7 @@ type CassandraOpsRequest struct { // CassandraOpsRequestSpec is the spec for CassandraOpsRequest type CassandraOpsRequestSpec struct { // Specifies information necessary for custom configuration of Cassandra - Configuration *CassandraCustomConfigurationSpec `json:"configuration,omitempty"` + Configuration *ReconfigurationSpec `json:"configuration,omitempty"` // Specifies the Cassandra reference DatabaseRef core.LocalObjectReference `json:"databaseRef"` // Specifies the ops request type: UpdateVersion, HorizontalScaling, VerticalScaling etc. diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/cassandra_ops_helpers.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/cassandra_ops_helpers.go index 8650f7240..afcf9c54f 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/cassandra_ops_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/cassandra_ops_helpers.go @@ -63,8 +63,8 @@ func (r *CassandraOpsRequest) GetDBRefName() string { return r.Spec.DatabaseRef.Name } -func (r *CassandraOpsRequest) GetRequestType() any { - return r.Spec.Type +func (r *CassandraOpsRequest) GetRequestType() string { + return string(r.Spec.Type) } func (r *CassandraOpsRequest) GetStatus() OpsRequestStatus { diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/clickhouse_ops-types.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/clickhouse_ops-types.go index a3943ef15..5245d3282 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/clickhouse_ops-types.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/clickhouse_ops-types.go @@ -70,7 +70,7 @@ type ClickHouseOpsRequestSpec struct { // Specifies information necessary for volume expansion VolumeExpansion *ClickHouseVolumeExpansionSpec `json:"volumeExpansion,omitempty"` // Specifies information necessary for custom configuration of clickhouse - Configuration *ClickHouseCustomConfigurationSpec `json:"configuration,omitempty"` + Configuration *ReconfigurationSpec `json:"configuration,omitempty"` // Timeout for each step of the ops request in second. If a step doesn't finish within the specified timeout, the ops request will result in failure. Timeout *metav1.Duration `json:"timeout,omitempty"` // Specifies information necessary for configuring TLS @@ -99,27 +99,6 @@ type ClickHouseVolumeExpansionSpec struct { Node *resource.Quantity `json:"node,omitempty"` } -// ClickHouseCustomConfigurationSpec is the spec for Reconfiguring the clickhouse Settings -type ClickHouseCustomConfigurationSpec struct { - // ConfigSecret is an optional field to provide custom configuration file for database. - // +optional - ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` - // ApplyConfig is an optional field to provide clickhouse configuration. - // Provided configuration will be applied to config files stored in ConfigSecret. - // If the ConfigSecret is missing, the operator will create a new k8s secret by the - // following naming convention: {db-name}-user-config . - // Expected input format: - // applyConfig: - // file-name.yml: | - // key: value - // +optional - ApplyConfig map[string]string `json:"applyConfig,omitempty"` - // If set to "true", the user provided configuration will be removed. - // The clickhouse cluster will start will default configuration that is generated by the operator. - // +optional - RemoveCustomConfig bool `json:"removeCustomConfig,omitempty"` -} - // ClickHouseTLSSpec contains necessary information for configuring TLS type ClickHouseTLSSpec struct { // SSLVerificationMode specifies how server certificates should be verified diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/clickhouse_ops_helpers.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/clickhouse_ops_helpers.go index 6089779ff..8c7d77537 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/clickhouse_ops_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/clickhouse_ops_helpers.go @@ -63,8 +63,8 @@ func (r *ClickHouseOpsRequest) GetDBRefName() string { return r.Spec.DatabaseRef.Name } -func (r *ClickHouseOpsRequest) GetRequestType() any { - return r.Spec.Type +func (r *ClickHouseOpsRequest) GetRequestType() string { + return string(r.Spec.Type) } func (r *ClickHouseOpsRequest) GetStatus() OpsRequestStatus { diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/constant.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/constant.go index 23426c632..4b77fd998 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/constant.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/constant.go @@ -215,6 +215,11 @@ const ( UpdateCombinedNodePVCs = "UpdateCombinedNodePVCs" ) +// MSSQLServer Constants +const ( + PrepareApplyConfig = "PrepareApplyConfig" +) + // Singlestore Constants const ( ScaleUpAggregator = "ScaleUpAggregator" diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/druid_ops_helpers.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/druid_ops_helpers.go index 854599873..bc2cefbf5 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/druid_ops_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/druid_ops_helpers.go @@ -63,8 +63,8 @@ func (d *DruidOpsRequest) GetDBRefName() string { return d.Spec.DatabaseRef.Name } -func (d *DruidOpsRequest) GetRequestType() any { - return d.Spec.Type +func (d *DruidOpsRequest) GetRequestType() string { + return string(d.Spec.Type) } func (d *DruidOpsRequest) GetStatus() OpsRequestStatus { diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/druid_ops_types.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/druid_ops_types.go index f697d0b03..095e903cc 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/druid_ops_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/druid_ops_types.go @@ -68,7 +68,7 @@ type DruidOpsRequestSpec struct { // Specifies information necessary for upgrading Druid UpdateVersion *DruidUpdateVersionSpec `json:"updateVersion,omitempty"` // Specifies information necessary for custom configuration of Druid - Configuration *DruidCustomConfigurationSpec `json:"configuration,omitempty"` + Configuration *ReconfigurationSpec `json:"configuration,omitempty"` // Specifies information necessary for configuring TLS TLS *TLSSpec `json:"tls,omitempty"` // Timeout for each step of the ops request in second. If a step doesn't finish within the specified timeout, the ops request will result in failure. @@ -131,29 +131,6 @@ type DruidUpdateVersionSpec struct { TargetVersion string `json:"targetVersion,omitempty"` } -// DruidCustomConfigurationSpec is the spec for Reconfiguring the Druid Settings -type DruidCustomConfigurationSpec struct { - // ConfigSecret is an optional field to provide custom configuration file for database. - // +optional - ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` - // ApplyConfig is an optional field to provide Druid configuration. - // Provided configuration will be applied to config files stored in ConfigSecret. - // If the ConfigSecret is missing, the operator will create a new k8s secret by the - // following naming convention: {db-name}-user-config . - // Expected input format: - // applyConfig: - // file-name.properties: | - // key=value - // server.properties: | - // log.retention.ms=10000 - // +optional - ApplyConfig map[string]string `json:"applyConfig,omitempty"` - // If set to "true", the user provided configuration will be removed. - // The Druid cluster will start will default configuration that is generated by the operator. - // +optional - RemoveCustomConfig bool `json:"removeCustomConfig,omitempty"` -} - // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // DruidOpsRequestList is a list of DruidOpsRequests diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/elasticsearch_ops_helpers.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/elasticsearch_ops_helpers.go index 0b139685e..266bc6ac2 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/elasticsearch_ops_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/elasticsearch_ops_helpers.go @@ -67,8 +67,8 @@ func (e *ElasticsearchOpsRequest) GetDBRefName() string { return e.Spec.DatabaseRef.Name } -func (e *ElasticsearchOpsRequest) GetRequestType() any { - return e.Spec.Type +func (e *ElasticsearchOpsRequest) GetRequestType() string { + return string(e.Spec.Type) } func (e *ElasticsearchOpsRequest) GetStatus() OpsRequestStatus { diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/elasticsearch_ops_types.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/elasticsearch_ops_types.go index b81c61037..75230e348 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/elasticsearch_ops_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/elasticsearch_ops_types.go @@ -64,7 +64,7 @@ type ElasticsearchOpsRequestSpec struct { // Specifies information necessary for volume expansion VolumeExpansion *ElasticsearchVolumeExpansionSpec `json:"volumeExpansion,omitempty"` // Specifies information necessary for custom configuration of Elasticsearch - Configuration *ElasticsearchCustomConfigurationSpec `json:"configuration,omitempty"` + Configuration *ElasticsearchReconfigurationSpec `json:"configuration,omitempty"` // Specifies information necessary for configuring TLS TLS *TLSSpec `json:"tls,omitempty"` // Specifies information necessary for configuring authSecret of the database @@ -158,8 +158,8 @@ type ElasticsearchVolumeExpansionSpec struct { Coordinating *resource.Quantity `json:"coordinating,omitempty"` } -// ElasticsearchCustomConfigurationSpec is the spec for Reconfiguring the Elasticsearch Settings -type ElasticsearchCustomConfigurationSpec struct { +// ElasticsearchReconfigurationSpecis the spec for Reconfiguring the Elasticsearch Settings +type ElasticsearchReconfigurationSpec struct { // ConfigSecret is an optional field to provide custom configuration file for database. // +optional ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` @@ -189,6 +189,14 @@ type ElasticsearchCustomConfigurationSpec struct { // The elasticsearch.keystore will start will default password (i.e. ""). // +optional RemoveSecureCustomConfig bool `json:"removeSecureCustomConfig,omitempty"` + + // Restart controls whether to restart the database during reconfiguration. + // - auto (default): Operator determines if restart is needed based on configuration changes. + // - true: Restart the database during reconfiguration. + // - false: Don't restart the database during reconfiguration. + // +optional + // +kubebuilder:default=auto + Restart ReconfigureRestartType `json:"restart,omitempty"` } type ElasticsearchCustomConfiguration struct { diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/etcd_ops_helpers.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/etcd_ops_helpers.go index 6e6ea3252..1d7290a03 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/etcd_ops_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/etcd_ops_helpers.go @@ -67,8 +67,8 @@ func (e *EtcdOpsRequest) GetDBRefName() string { return e.Spec.DatabaseRef.Name } -func (e *EtcdOpsRequest) GetRequestType() any { - return e.Spec.Type +func (e *EtcdOpsRequest) GetRequestType() string { + return string(e.Spec.Type) } func (e *EtcdOpsRequest) GetStatus() OpsRequestStatus { diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/ferretdb_ops_helpers.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/ferretdb_ops_helpers.go index abdc3c76f..6218c0fe2 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/ferretdb_ops_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/ferretdb_ops_helpers.go @@ -63,8 +63,8 @@ func (r *FerretDBOpsRequest) GetDBRefName() string { return r.Spec.DatabaseRef.Name } -func (r *FerretDBOpsRequest) GetRequestType() any { - return r.Spec.Type +func (r *FerretDBOpsRequest) GetRequestType() string { + return string(r.Spec.Type) } func (r *FerretDBOpsRequest) GetStatus() OpsRequestStatus { diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/hazelcast_ops_helpers.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/hazelcast_ops_helpers.go index 22380f431..ef7dd1a1b 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/hazelcast_ops_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/hazelcast_ops_helpers.go @@ -63,8 +63,8 @@ func (h *HazelcastOpsRequest) GetDBRefName() string { return h.Spec.DatabaseRef.Name } -func (h *HazelcastOpsRequest) GetRequestType() any { - return h.Spec.Type +func (h *HazelcastOpsRequest) GetRequestType() string { + return string(h.Spec.Type) } func (h *HazelcastOpsRequest) GetStatus() OpsRequestStatus { diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/hazelcast_ops_types.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/hazelcast_ops_types.go index b73038f3a..c9df6eeb2 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/hazelcast_ops_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/hazelcast_ops_types.go @@ -70,7 +70,7 @@ type HazelcastOpsRequestSpec struct { // Specifies information necessary for restarting database Restart *RestartSpec `json:"restart,omitempty"` // Specifies information necessary for custom configuration of hazelcast - Configuration *HazelcastCustomConfigurationSpec `json:"configuration,omitempty"` + Configuration *ReconfigurationSpec `json:"configuration,omitempty"` // Specifies information necessary for configuring TLS TLS *TLSSpec `json:"tls,omitempty"` // Specifies information necessary for configuring authSecret of the database @@ -105,27 +105,6 @@ type HazelcastHorizontalScalingSpec struct { Hazelcast *int32 `json:"hazelcast,omitempty"` } -// HazelcastCustomConfigurationSpec is the spec for Reconfiguring the hazelcast Settings -type HazelcastCustomConfigurationSpec struct { - // ConfigSecret is an optional field to provide custom configuration file for database. - // +optional - ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` - // ApplyConfig is an optional field to provide hazelcast configuration. - // Provided configuration will be applied to config files stored in ConfigSecret. - // If the ConfigSecret is missing, the operator will create a new k8s secret by the - // following naming convention: {db-name}-user-config . - // Expected input format: - // applyConfig: - // hazelcast.xml: | - // key=value - // +optional - ApplyConfig map[string]string `json:"applyConfig,omitempty"` - // If set to "true", the user provided configuration will be removed. - // The hazelcast cluster will start will default configuration that is generated by the operator. - // +optional - RemoveCustomConfig bool `json:"removeCustomConfig,omitempty"` -} - // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // HazelcastOpsRequestList is a list of HazelcastOpsRequests diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/ignite_ops_helpers.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/ignite_ops_helpers.go index 099319703..d16431bc2 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/ignite_ops_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/ignite_ops_helpers.go @@ -63,8 +63,8 @@ func (r *IgniteOpsRequest) GetDBRefName() string { return r.Spec.DatabaseRef.Name } -func (r *IgniteOpsRequest) GetRequestType() any { - return r.Spec.Type +func (r *IgniteOpsRequest) GetRequestType() string { + return string(r.Spec.Type) } func (r *IgniteOpsRequest) GetStatus() OpsRequestStatus { diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/ignite_ops_types.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/ignite_ops_types.go index 2fe4f2e4f..14ccbf930 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/ignite_ops_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/ignite_ops_types.go @@ -64,7 +64,7 @@ type IgniteOpsRequestSpec struct { // Specifies information necessary for volume expansion VolumeExpansion *IgniteVolumeExpansionSpec `json:"volumeExpansion,omitempty"` // Specifies information necessary for custom configuration of ignite - Configuration *IgniteCustomConfigurationSpec `json:"configuration,omitempty"` + Configuration *ReconfigurationSpec `json:"configuration,omitempty"` // Specifies information necessary for configuring TLS TLS *TLSSpec `json:"tls,omitempty"` // Specifies information necessary for configuring authSecret of the database @@ -109,27 +109,6 @@ type IgniteVolumeExpansionSpec struct { Ignite *resource.Quantity `json:"node,omitempty"` } -// IgniteCustomConfigurationSpec is the spec for Reconfiguring the ignite Settings -type IgniteCustomConfigurationSpec struct { - // ConfigSecret is an optional field to provide custom configuration file for database. - // +optional - ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` - // ApplyConfig is an optional field to provide ignite configuration. - // Provided configuration will be applied to config files stored in ConfigSecret. - // If the ConfigSecret is missing, the operator will create a new k8s secret by the - // following naming convention: {db-name}-user-config . - // Expected input format: - // applyConfig: - // node-configuration.xml: | - // key=value - // +optional - ApplyConfig map[string]string `json:"applyConfig,omitempty"` - // If set to "true", the user provided configuration will be removed. - // The ignite cluster will start will default configuration that is generated by the operator. - // +optional - RemoveCustomConfig bool `json:"removeCustomConfig,omitempty"` -} - // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // IgniteOpsRequestList is a list of IgniteOpsRequests diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/kafka_ops_helpers.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/kafka_ops_helpers.go index 280d3ba5e..deaf6593c 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/kafka_ops_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/kafka_ops_helpers.go @@ -63,8 +63,8 @@ func (k *KafkaOpsRequest) GetDBRefName() string { return k.Spec.DatabaseRef.Name } -func (k *KafkaOpsRequest) GetRequestType() any { - return k.Spec.Type +func (k *KafkaOpsRequest) GetRequestType() string { + return string(k.Spec.Type) } func (k *KafkaOpsRequest) GetStatus() OpsRequestStatus { diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/kafka_ops_types.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/kafka_ops_types.go index 34590260f..fb10b6515 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/kafka_ops_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/kafka_ops_types.go @@ -64,7 +64,7 @@ type KafkaOpsRequestSpec struct { // Specifies information necessary for volume expansion VolumeExpansion *KafkaVolumeExpansionSpec `json:"volumeExpansion,omitempty"` // Specifies information necessary for custom configuration of Kafka - Configuration *KafkaCustomConfigurationSpec `json:"configuration,omitempty"` + Configuration *ReconfigurationSpec `json:"configuration,omitempty"` // Specifies information necessary for configuring TLS TLS *TLSSpec `json:"tls,omitempty"` // Specifies information necessary for configuring authSecret of the database @@ -131,29 +131,6 @@ type KafkaVolumeExpansionSpec struct { Controller *resource.Quantity `json:"controller,omitempty"` } -// KafkaCustomConfigurationSpec is the spec for Reconfiguring the Kafka Settings -type KafkaCustomConfigurationSpec struct { - // ConfigSecret is an optional field to provide custom configuration file for database. - // +optional - ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` - // ApplyConfig is an optional field to provide Kafka configuration. - // Provided configuration will be applied to config files stored in ConfigSecret. - // If the ConfigSecret is missing, the operator will create a new k8s secret by the - // following naming convention: {db-name}-user-config . - // Expected input format: - // applyConfig: - // file-name.properties: | - // key=value - // server.properties: | - // log.retention.ms=10000 - // +optional - ApplyConfig map[string]string `json:"applyConfig,omitempty"` - // If set to "true", the user provided configuration will be removed. - // The Kafka cluster will start will default configuration that is generated by the operator. - // +optional - RemoveCustomConfig bool `json:"removeCustomConfig,omitempty"` -} - // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // KafkaOpsRequestList is a list of KafkaOpsRequests diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/mariadb_ops_helpers.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/mariadb_ops_helpers.go index 67e6f9e14..836451d99 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/mariadb_ops_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/mariadb_ops_helpers.go @@ -88,8 +88,8 @@ func (m *MariaDBOpsRequest) GetDBRefName() string { return m.Spec.DatabaseRef.Name } -func (m *MariaDBOpsRequest) GetRequestType() any { - return m.Spec.Type +func (m *MariaDBOpsRequest) GetRequestType() string { + return string(m.Spec.Type) } func (m *MariaDBOpsRequest) GetStatus() OpsRequestStatus { diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/mariadb_ops_types.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/mariadb_ops_types.go index 6b676d50f..1988cf34f 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/mariadb_ops_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/mariadb_ops_types.go @@ -64,7 +64,7 @@ type MariaDBOpsRequestSpec struct { // Specifies information necessary for volume expansion VolumeExpansion *MariaDBVolumeExpansionSpec `json:"volumeExpansion,omitempty"` // Specifies information necessary for custom configuration of MariaDB - Configuration *MariaDBCustomConfigurationSpec `json:"configuration,omitempty"` + Configuration *ReconfigurationSpec `json:"configuration,omitempty"` // Specifies information necessary for configuring TLS TLS *MariaDBTLSSpec `json:"tls,omitempty"` // Specifies information necessary for configuring authSecret of the database @@ -115,29 +115,6 @@ type MariaDBVolumeExpansionSpec struct { MaxScale *resource.Quantity `json:"maxscale,omitempty"` Mode VolumeExpansionMode `json:"mode"` } - -type MariaDBCustomConfigurationSpec struct { - // ConfigSecret is an optional field to provide custom configuration file for database. - // +optional - ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` - // If set to "true", the user provided configuration will be removed. - // MariaDB will start will default configuration that is generated by the operator. - // +optional - RemoveCustomConfig bool `json:"removeCustomConfig,omitempty"` - // ApplyConfig is an optional field to provide MariaDB configuration. - // Provided configuration will be applied to config files stored in ConfigSecret. - // If the ConfigSecret is missing, the operator will create a new k8s secret by the - // following naming convention: {db-name}-user-config . - // Expected input format: - // applyConfig: - // file-name.cnf: | - // [mysqld] - // key1: value1 - // key2: value2 - // +optional - ApplyConfig map[string]string `json:"applyConfig,omitempty"` -} - type MariaDBCustomConfiguration struct { ConfigMap *core.LocalObjectReference `json:"configMap,omitempty"` Data map[string]string `json:"data,omitempty"` diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/memcached_ops_helpers.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/memcached_ops_helpers.go index 6da18b26e..bd606474b 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/memcached_ops_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/memcached_ops_helpers.go @@ -67,8 +67,8 @@ func (m *MemcachedOpsRequest) GetDBRefName() string { return m.Spec.DatabaseRef.Name } -func (m *MemcachedOpsRequest) GetRequestType() any { - return m.Spec.Type +func (m *MemcachedOpsRequest) GetRequestType() string { + return string(m.Spec.Type) } func (m *MemcachedOpsRequest) GetStatus() OpsRequestStatus { diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/memcached_ops_types.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/memcached_ops_types.go index 1b7143fb5..edaa7513e 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/memcached_ops_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/memcached_ops_types.go @@ -63,7 +63,7 @@ type MemcachedOpsRequestSpec struct { // Specifies information necessary for volume expansion VolumeExpansion *MemcachedVolumeExpansionSpec `json:"volumeExpansion,omitempty"` // Specifies information necessary for custom configuration of Memcached - Configuration *MemcachedCustomConfigurationSpec `json:"configuration,omitempty"` + Configuration *ReconfigurationSpec `json:"configuration,omitempty"` // Specifies information necessary for configuring TLS TLS *TLSSpec `json:"tls,omitempty"` // Specifies information necessary for configuring authSecret of the database diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/mongodb_ops_helpers.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/mongodb_ops_helpers.go index 843875d43..984c29f33 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/mongodb_ops_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/mongodb_ops_helpers.go @@ -67,8 +67,8 @@ func (m *MongoDBOpsRequest) GetDBRefName() string { return m.Spec.DatabaseRef.Name } -func (m *MongoDBOpsRequest) GetRequestType() any { - return m.Spec.Type +func (m *MongoDBOpsRequest) GetRequestType() string { + return string(m.Spec.Type) } func (m *MongoDBOpsRequest) GetStatus() OpsRequestStatus { diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/mongodb_ops_types.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/mongodb_ops_types.go index 23dcc7c7c..6ba803b4b 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/mongodb_ops_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/mongodb_ops_types.go @@ -64,7 +64,7 @@ type MongoDBOpsRequestSpec struct { // Specifies information necessary for volume expansion VolumeExpansion *MongoDBVolumeExpansionSpec `json:"volumeExpansion,omitempty"` // Specifies information necessary for custom configuration of MongoDB - Configuration *MongoDBCustomConfigurationSpec `json:"configuration,omitempty"` + Configuration *MongoDBReconfigurationSpec `json:"configuration,omitempty"` // Specifies information necessary for configuring TLS TLS *TLSSpec `json:"tls,omitempty"` // Specifies information necessary for configuring authSecret of the database @@ -160,20 +160,14 @@ type MongoDBVolumeExpansionSpec struct { Hidden *resource.Quantity `json:"hidden,omitempty"` } -type MongoDBCustomConfigurationSpec struct { - Standalone *MongoDBCustomConfiguration `json:"standalone,omitempty"` - ReplicaSet *MongoDBCustomConfiguration `json:"replicaSet,omitempty"` - Mongos *MongoDBCustomConfiguration `json:"mongos,omitempty"` - ConfigServer *MongoDBCustomConfiguration `json:"configServer,omitempty"` - Shard *MongoDBCustomConfiguration `json:"shard,omitempty"` - Arbiter *MongoDBCustomConfiguration `json:"arbiter,omitempty"` - Hidden *MongoDBCustomConfiguration `json:"hidden,omitempty"` -} - -type MongoDBCustomConfiguration struct { - ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` - ApplyConfig map[string]string `json:"applyConfig,omitempty"` - RemoveCustomConfig bool `json:"removeCustomConfig,omitempty"` +type MongoDBReconfigurationSpec struct { + Standalone *ReconfigurationSpec `json:"standalone,omitempty"` + ReplicaSet *ReconfigurationSpec `json:"replicaSet,omitempty"` + Mongos *ReconfigurationSpec `json:"mongos,omitempty"` + ConfigServer *ReconfigurationSpec `json:"configServer,omitempty"` + Shard *ReconfigurationSpec `json:"shard,omitempty"` + Arbiter *ReconfigurationSpec `json:"arbiter,omitempty"` + Hidden *ReconfigurationSpec `json:"hidden,omitempty"` } type Horizons struct { diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/mssqlserver_ops_helpers.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/mssqlserver_ops_helpers.go index 21a2b3533..8c7f1069a 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/mssqlserver_ops_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/mssqlserver_ops_helpers.go @@ -63,8 +63,8 @@ func (r *MSSQLServerOpsRequest) GetDBRefName() string { return r.Spec.DatabaseRef.Name } -func (r *MSSQLServerOpsRequest) GetRequestType() any { - return r.Spec.Type +func (r *MSSQLServerOpsRequest) GetRequestType() string { + return string(r.Spec.Type) } func (r *MSSQLServerOpsRequest) GetStatus() OpsRequestStatus { diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/mssqlserver_ops_types.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/mssqlserver_ops_types.go index 98150ccca..8e38a168e 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/mssqlserver_ops_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/mssqlserver_ops_types.go @@ -66,7 +66,7 @@ type MSSQLServerOpsRequestSpec struct { // Specifies information necessary for volume expansion VolumeExpansion *MSSQLServerVolumeExpansionSpec `json:"volumeExpansion,omitempty"` // Specifies information necessary for custom configuration of MSSQLServer - Configuration *MSSQLServerCustomConfigurationSpec `json:"configuration,omitempty"` + Configuration *ReconfigurationSpec `json:"configuration,omitempty"` // Specifies information necessary for configuring TLS TLS *MSSQLServerTLSSpec `json:"tls,omitempty"` // Specifies information necessary for configuring authSecret of the database @@ -116,13 +116,6 @@ type MSSQLServerVolumeExpansionSpec struct { Mode VolumeExpansionMode `json:"mode"` } -// MSSQLServerCustomConfigurationSpec is the spec for Reconfiguring the MSSQLServer -type MSSQLServerCustomConfigurationSpec struct { - ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` - ApplyConfig map[string]string `json:"applyConfig,omitempty"` - RemoveCustomConfig bool `json:"removeCustomConfig,omitempty"` -} - type MSSQLServerTLSSpec struct { // SQLServerTLSSpec contains updated tls configurations for client and server. // +optional diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/mysql_ops_helpers.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/mysql_ops_helpers.go index 96df7fdd5..90fa3a6fa 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/mysql_ops_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/mysql_ops_helpers.go @@ -68,8 +68,8 @@ func (m *MySQLOpsRequest) GetDBRefName() string { return m.Spec.DatabaseRef.Name } -func (m *MySQLOpsRequest) GetRequestType() any { - return m.Spec.Type +func (m *MySQLOpsRequest) GetRequestType() string { + return string(m.Spec.Type) } func (m *MySQLOpsRequest) GetStatus() OpsRequestStatus { diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/mysql_ops_types.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/mysql_ops_types.go index 431d8b7ea..dd0c8b34f 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/mysql_ops_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/mysql_ops_types.go @@ -67,7 +67,7 @@ type MySQLOpsRequestSpec struct { // Specifies information necessary for volume expansion VolumeExpansion *MySQLVolumeExpansionSpec `json:"volumeExpansion,omitempty"` // Specifies information necessary for custom configuration of MySQL - Configuration *MySQLCustomConfigurationSpec `json:"configuration,omitempty"` + Configuration *ReconfigurationSpec `json:"configuration,omitempty"` // Specifies information necessary for configuring TLS TLS *MySQLTLSSpec `json:"tls,omitempty"` // Specifies information necessary for configuring authSecret of the database @@ -137,12 +137,6 @@ type MySQLVolumeExpansionSpec struct { Mode VolumeExpansionMode `json:"mode"` } -type MySQLCustomConfigurationSpec struct { - ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` - ApplyConfig map[string]string `json:"applyConfig,omitempty"` - RemoveCustomConfig bool `json:"removeCustomConfig,omitempty"` -} - type MySQLTLSSpec struct { TLSSpec `json:",inline,omitempty"` diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/openapi_generated.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/openapi_generated.go index 0854d438e..be7d8e28a 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/openapi_generated.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/openapi_generated.go @@ -523,7 +523,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/ops/v1alpha1.CassandraUpdateVersionSpec": schema_apimachinery_apis_ops_v1alpha1_CassandraUpdateVersionSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.CassandraVerticalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_CassandraVerticalScalingSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.CassandraVolumeExpansionSpec": schema_apimachinery_apis_ops_v1alpha1_CassandraVolumeExpansionSpec(ref), - "kubedb.dev/apimachinery/apis/ops/v1alpha1.ClickHouseCustomConfigurationSpec": schema_apimachinery_apis_ops_v1alpha1_ClickHouseCustomConfigurationSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.ClickHouseHorizontalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_ClickHouseHorizontalScalingSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.ClickHouseOpsRequest": schema_apimachinery_apis_ops_v1alpha1_ClickHouseOpsRequest(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.ClickHouseOpsRequestList": schema_apimachinery_apis_ops_v1alpha1_ClickHouseOpsRequestList(ref), @@ -534,7 +533,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/ops/v1alpha1.ClickHouseVolumeExpansionSpec": schema_apimachinery_apis_ops_v1alpha1_ClickHouseVolumeExpansionSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.ConfigNode": schema_apimachinery_apis_ops_v1alpha1_ConfigNode(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.ContainerResources": schema_apimachinery_apis_ops_v1alpha1_ContainerResources(ref), - "kubedb.dev/apimachinery/apis/ops/v1alpha1.DruidCustomConfigurationSpec": schema_apimachinery_apis_ops_v1alpha1_DruidCustomConfigurationSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.DruidHorizontalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_DruidHorizontalScalingSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.DruidHorizontalScalingTopologySpec": schema_apimachinery_apis_ops_v1alpha1_DruidHorizontalScalingTopologySpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.DruidOpsRequest": schema_apimachinery_apis_ops_v1alpha1_DruidOpsRequest(ref), @@ -544,12 +542,12 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/ops/v1alpha1.DruidVerticalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_DruidVerticalScalingSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.DruidVolumeExpansionSpec": schema_apimachinery_apis_ops_v1alpha1_DruidVolumeExpansionSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.ElasticsearchCustomConfiguration": schema_apimachinery_apis_ops_v1alpha1_ElasticsearchCustomConfiguration(ref), - "kubedb.dev/apimachinery/apis/ops/v1alpha1.ElasticsearchCustomConfigurationSpec": schema_apimachinery_apis_ops_v1alpha1_ElasticsearchCustomConfigurationSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.ElasticsearchHorizontalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_ElasticsearchHorizontalScalingSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.ElasticsearchHorizontalScalingTopologySpec": schema_apimachinery_apis_ops_v1alpha1_ElasticsearchHorizontalScalingTopologySpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.ElasticsearchOpsRequest": schema_apimachinery_apis_ops_v1alpha1_ElasticsearchOpsRequest(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.ElasticsearchOpsRequestList": schema_apimachinery_apis_ops_v1alpha1_ElasticsearchOpsRequestList(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.ElasticsearchOpsRequestSpec": schema_apimachinery_apis_ops_v1alpha1_ElasticsearchOpsRequestSpec(ref), + "kubedb.dev/apimachinery/apis/ops/v1alpha1.ElasticsearchReconfigurationSpec": schema_apimachinery_apis_ops_v1alpha1_ElasticsearchReconfigurationSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.ElasticsearchReplicaReadinessCriteria": schema_apimachinery_apis_ops_v1alpha1_ElasticsearchReplicaReadinessCriteria(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.ElasticsearchUpdateVersionSpec": schema_apimachinery_apis_ops_v1alpha1_ElasticsearchUpdateVersionSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.ElasticsearchVerticalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_ElasticsearchVerticalScalingSpec(ref), @@ -572,7 +570,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/ops/v1alpha1.FerretDBTLSSpec": schema_apimachinery_apis_ops_v1alpha1_FerretDBTLSSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.FerretDBUpdateVersionSpec": schema_apimachinery_apis_ops_v1alpha1_FerretDBUpdateVersionSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.FerretDBVerticalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_FerretDBVerticalScalingSpec(ref), - "kubedb.dev/apimachinery/apis/ops/v1alpha1.HazelcastCustomConfigurationSpec": schema_apimachinery_apis_ops_v1alpha1_HazelcastCustomConfigurationSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.HazelcastHorizontalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_HazelcastHorizontalScalingSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.HazelcastOpsRequest": schema_apimachinery_apis_ops_v1alpha1_HazelcastOpsRequest(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.HazelcastOpsRequestList": schema_apimachinery_apis_ops_v1alpha1_HazelcastOpsRequestList(ref), @@ -582,7 +579,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/ops/v1alpha1.HazelcastVolumeExpansionSpec": schema_apimachinery_apis_ops_v1alpha1_HazelcastVolumeExpansionSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.HiddenNode": schema_apimachinery_apis_ops_v1alpha1_HiddenNode(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.Horizons": schema_apimachinery_apis_ops_v1alpha1_Horizons(ref), - "kubedb.dev/apimachinery/apis/ops/v1alpha1.IgniteCustomConfigurationSpec": schema_apimachinery_apis_ops_v1alpha1_IgniteCustomConfigurationSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.IgniteHorizontalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_IgniteHorizontalScalingSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.IgniteOpsRequest": schema_apimachinery_apis_ops_v1alpha1_IgniteOpsRequest(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.IgniteOpsRequestList": schema_apimachinery_apis_ops_v1alpha1_IgniteOpsRequestList(ref), @@ -590,7 +586,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/ops/v1alpha1.IgniteUpdateVersionSpec": schema_apimachinery_apis_ops_v1alpha1_IgniteUpdateVersionSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.IgniteVerticalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_IgniteVerticalScalingSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.IgniteVolumeExpansionSpec": schema_apimachinery_apis_ops_v1alpha1_IgniteVolumeExpansionSpec(ref), - "kubedb.dev/apimachinery/apis/ops/v1alpha1.KafkaCustomConfigurationSpec": schema_apimachinery_apis_ops_v1alpha1_KafkaCustomConfigurationSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.KafkaHorizontalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_KafkaHorizontalScalingSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.KafkaHorizontalScalingTopologySpec": schema_apimachinery_apis_ops_v1alpha1_KafkaHorizontalScalingTopologySpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.KafkaOpsRequest": schema_apimachinery_apis_ops_v1alpha1_KafkaOpsRequest(ref), @@ -600,7 +595,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/ops/v1alpha1.KafkaUpdateVersionSpec": schema_apimachinery_apis_ops_v1alpha1_KafkaUpdateVersionSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.KafkaVerticalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_KafkaVerticalScalingSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.KafkaVolumeExpansionSpec": schema_apimachinery_apis_ops_v1alpha1_KafkaVolumeExpansionSpec(ref), - "kubedb.dev/apimachinery/apis/ops/v1alpha1.MSSQLServerCustomConfigurationSpec": schema_apimachinery_apis_ops_v1alpha1_MSSQLServerCustomConfigurationSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.MSSQLServerHorizontalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_MSSQLServerHorizontalScalingSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.MSSQLServerOpsRequest": schema_apimachinery_apis_ops_v1alpha1_MSSQLServerOpsRequest(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.MSSQLServerOpsRequestList": schema_apimachinery_apis_ops_v1alpha1_MSSQLServerOpsRequestList(ref), @@ -611,7 +605,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/ops/v1alpha1.MSSQLServerVerticalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_MSSQLServerVerticalScalingSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.MSSQLServerVolumeExpansionSpec": schema_apimachinery_apis_ops_v1alpha1_MSSQLServerVolumeExpansionSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.MariaDBCustomConfiguration": schema_apimachinery_apis_ops_v1alpha1_MariaDBCustomConfiguration(ref), - "kubedb.dev/apimachinery/apis/ops/v1alpha1.MariaDBCustomConfigurationSpec": schema_apimachinery_apis_ops_v1alpha1_MariaDBCustomConfigurationSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.MariaDBHorizontalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_MariaDBHorizontalScalingSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.MariaDBOpsRequest": schema_apimachinery_apis_ops_v1alpha1_MariaDBOpsRequest(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.MariaDBOpsRequestList": schema_apimachinery_apis_ops_v1alpha1_MariaDBOpsRequestList(ref), @@ -631,19 +624,17 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/ops/v1alpha1.MemcachedUpdateVersionSpec": schema_apimachinery_apis_ops_v1alpha1_MemcachedUpdateVersionSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.MemcachedVerticalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_MemcachedVerticalScalingSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.MemcachedVolumeExpansionSpec": schema_apimachinery_apis_ops_v1alpha1_MemcachedVolumeExpansionSpec(ref), - "kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBCustomConfiguration": schema_apimachinery_apis_ops_v1alpha1_MongoDBCustomConfiguration(ref), - "kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBCustomConfigurationSpec": schema_apimachinery_apis_ops_v1alpha1_MongoDBCustomConfigurationSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBHorizontalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_MongoDBHorizontalScalingSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBOpsRequest": schema_apimachinery_apis_ops_v1alpha1_MongoDBOpsRequest(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBOpsRequestList": schema_apimachinery_apis_ops_v1alpha1_MongoDBOpsRequestList(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBOpsRequestSpec": schema_apimachinery_apis_ops_v1alpha1_MongoDBOpsRequestSpec(ref), + "kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBReconfigurationSpec": schema_apimachinery_apis_ops_v1alpha1_MongoDBReconfigurationSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBReplicaReadinessCriteria": schema_apimachinery_apis_ops_v1alpha1_MongoDBReplicaReadinessCriteria(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBShardNode": schema_apimachinery_apis_ops_v1alpha1_MongoDBShardNode(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBUpdateVersionSpec": schema_apimachinery_apis_ops_v1alpha1_MongoDBUpdateVersionSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBVerticalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_MongoDBVerticalScalingSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBVolumeExpansionSpec": schema_apimachinery_apis_ops_v1alpha1_MongoDBVolumeExpansionSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.MongosNode": schema_apimachinery_apis_ops_v1alpha1_MongosNode(ref), - "kubedb.dev/apimachinery/apis/ops/v1alpha1.MySQLCustomConfigurationSpec": schema_apimachinery_apis_ops_v1alpha1_MySQLCustomConfigurationSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.MySQLHorizontalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_MySQLHorizontalScalingSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.MySQLMigrationSpec": schema_apimachinery_apis_ops_v1alpha1_MySQLMigrationSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.MySQLOpsRequest": schema_apimachinery_apis_ops_v1alpha1_MySQLOpsRequest(ref), @@ -668,8 +659,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/ops/v1alpha1.PerconaXtraDBUpdateVersionSpec": schema_apimachinery_apis_ops_v1alpha1_PerconaXtraDBUpdateVersionSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.PerconaXtraDBVerticalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_PerconaXtraDBVerticalScalingSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.PerconaXtraDBVolumeExpansionSpec": schema_apimachinery_apis_ops_v1alpha1_PerconaXtraDBVolumeExpansionSpec(ref), - "kubedb.dev/apimachinery/apis/ops/v1alpha1.PgBouncerCustomConfiguration": schema_apimachinery_apis_ops_v1alpha1_PgBouncerCustomConfiguration(ref), - "kubedb.dev/apimachinery/apis/ops/v1alpha1.PgBouncerCustomConfigurationSpec": schema_apimachinery_apis_ops_v1alpha1_PgBouncerCustomConfigurationSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.PgBouncerHorizontalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_PgBouncerHorizontalScalingSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.PgBouncerOpsRequest": schema_apimachinery_apis_ops_v1alpha1_PgBouncerOpsRequest(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.PgBouncerOpsRequestList": schema_apimachinery_apis_ops_v1alpha1_PgBouncerOpsRequestList(ref), @@ -677,7 +666,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/ops/v1alpha1.PgBouncerTLSSpec": schema_apimachinery_apis_ops_v1alpha1_PgBouncerTLSSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.PgBouncerUpdateVersionSpec": schema_apimachinery_apis_ops_v1alpha1_PgBouncerUpdateVersionSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.PgBouncerVerticalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_PgBouncerVerticalScalingSpec(ref), - "kubedb.dev/apimachinery/apis/ops/v1alpha1.PgpoolCustomConfigurationSpec": schema_apimachinery_apis_ops_v1alpha1_PgpoolCustomConfigurationSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.PgpoolHorizontalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_PgpoolHorizontalScalingSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.PgpoolOpsRequest": schema_apimachinery_apis_ops_v1alpha1_PgpoolOpsRequest(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.PgpoolOpsRequestList": schema_apimachinery_apis_ops_v1alpha1_PgpoolOpsRequestList(ref), @@ -697,19 +685,22 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresReconnectStandby": schema_apimachinery_apis_ops_v1alpha1_PostgresReconnectStandby(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresSetRaftKeyPair": schema_apimachinery_apis_ops_v1alpha1_PostgresSetRaftKeyPair(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresTLSSpec": schema_apimachinery_apis_ops_v1alpha1_PostgresTLSSpec(ref), + "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresTuningConfig": schema_apimachinery_apis_ops_v1alpha1_PostgresTuningConfig(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresUpdateVersionSpec": schema_apimachinery_apis_ops_v1alpha1_PostgresUpdateVersionSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresVerticalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_PostgresVerticalScalingSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresVolumeExpansionSpec": schema_apimachinery_apis_ops_v1alpha1_PostgresVolumeExpansionSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.ProxySQLCustomConfiguration": schema_apimachinery_apis_ops_v1alpha1_ProxySQLCustomConfiguration(ref), - "kubedb.dev/apimachinery/apis/ops/v1alpha1.ProxySQLCustomConfigurationSpec": schema_apimachinery_apis_ops_v1alpha1_ProxySQLCustomConfigurationSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.ProxySQLHorizontalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_ProxySQLHorizontalScalingSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.ProxySQLOpsRequest": schema_apimachinery_apis_ops_v1alpha1_ProxySQLOpsRequest(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.ProxySQLOpsRequestList": schema_apimachinery_apis_ops_v1alpha1_ProxySQLOpsRequestList(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.ProxySQLOpsRequestSpec": schema_apimachinery_apis_ops_v1alpha1_ProxySQLOpsRequestSpec(ref), + "kubedb.dev/apimachinery/apis/ops/v1alpha1.ProxySQLReconfigurationSpec": schema_apimachinery_apis_ops_v1alpha1_ProxySQLReconfigurationSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.ProxySQLReplicaReadinessCriteria": schema_apimachinery_apis_ops_v1alpha1_ProxySQLReplicaReadinessCriteria(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.ProxySQLUpdateVersionSpec": schema_apimachinery_apis_ops_v1alpha1_ProxySQLUpdateVersionSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.ProxySQLVerticalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_ProxySQLVerticalScalingSpec(ref), - "kubedb.dev/apimachinery/apis/ops/v1alpha1.RabbitMQCustomConfigurationSpec": schema_apimachinery_apis_ops_v1alpha1_RabbitMQCustomConfigurationSpec(ref), + "kubedb.dev/apimachinery/apis/ops/v1alpha1.QdrantOpsRequest": schema_apimachinery_apis_ops_v1alpha1_QdrantOpsRequest(ref), + "kubedb.dev/apimachinery/apis/ops/v1alpha1.QdrantOpsRequestList": schema_apimachinery_apis_ops_v1alpha1_QdrantOpsRequestList(ref), + "kubedb.dev/apimachinery/apis/ops/v1alpha1.QdrantOpsRequestSpec": schema_apimachinery_apis_ops_v1alpha1_QdrantOpsRequestSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.RabbitMQHorizontalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_RabbitMQHorizontalScalingSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.RabbitMQOpsRequest": schema_apimachinery_apis_ops_v1alpha1_RabbitMQOpsRequest(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.RabbitMQOpsRequestList": schema_apimachinery_apis_ops_v1alpha1_RabbitMQOpsRequestList(ref), @@ -718,6 +709,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/ops/v1alpha1.RabbitMQUpdateVersionSpec": schema_apimachinery_apis_ops_v1alpha1_RabbitMQUpdateVersionSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.RabbitMQVerticalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_RabbitMQVerticalScalingSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.RabbitMQVolumeExpansionSpec": schema_apimachinery_apis_ops_v1alpha1_RabbitMQVolumeExpansionSpec(ref), + "kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec": schema_apimachinery_apis_ops_v1alpha1_ReconfigurationSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.RedisAclSpec": schema_apimachinery_apis_ops_v1alpha1_RedisAclSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.RedisCustomConfigurationSpec": schema_apimachinery_apis_ops_v1alpha1_RedisCustomConfigurationSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.RedisHorizontalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_RedisHorizontalScalingSpec(ref), @@ -752,7 +744,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/ops/v1alpha1.SinglestoreUpdateVersionSpec": schema_apimachinery_apis_ops_v1alpha1_SinglestoreUpdateVersionSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.SinglestoreVerticalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_SinglestoreVerticalScalingSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.SinglestoreVolumeExpansionSpec": schema_apimachinery_apis_ops_v1alpha1_SinglestoreVolumeExpansionSpec(ref), - "kubedb.dev/apimachinery/apis/ops/v1alpha1.SolrCustomConfigurationSpec": schema_apimachinery_apis_ops_v1alpha1_SolrCustomConfigurationSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.SolrHorizontalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_SolrHorizontalScalingSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.SolrOpsRequest": schema_apimachinery_apis_ops_v1alpha1_SolrOpsRequest(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.SolrOpsRequestList": schema_apimachinery_apis_ops_v1alpha1_SolrOpsRequestList(ref), @@ -762,7 +753,6 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "kubedb.dev/apimachinery/apis/ops/v1alpha1.SolrVolumeExpansionSpec": schema_apimachinery_apis_ops_v1alpha1_SolrVolumeExpansionSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.TLSSpec": schema_apimachinery_apis_ops_v1alpha1_TLSSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.Topology": schema_apimachinery_apis_ops_v1alpha1_Topology(ref), - "kubedb.dev/apimachinery/apis/ops/v1alpha1.ZooKeeperCustomConfigurationSpec": schema_apimachinery_apis_ops_v1alpha1_ZooKeeperCustomConfigurationSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.ZooKeeperHorizontalScalingSpec": schema_apimachinery_apis_ops_v1alpha1_ZooKeeperHorizontalScalingSpec(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.ZooKeeperOpsRequest": schema_apimachinery_apis_ops_v1alpha1_ZooKeeperOpsRequest(ref), "kubedb.dev/apimachinery/apis/ops/v1alpha1.ZooKeeperOpsRequestList": schema_apimachinery_apis_ops_v1alpha1_ZooKeeperOpsRequestList(ref), @@ -26958,7 +26948,7 @@ func schema_apimachinery_apis_ops_v1alpha1_CassandraOpsRequestSpec(ref common.Re "configuration": { SchemaProps: spec.SchemaProps{ Description: "Specifies information necessary for custom configuration of Cassandra", - Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.CassandraCustomConfigurationSpec"), + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec"), }, }, "databaseRef": { @@ -27048,7 +27038,7 @@ func schema_apimachinery_apis_ops_v1alpha1_CassandraOpsRequestSpec(ref common.Re }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.CassandraCustomConfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.CassandraHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.CassandraUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.CassandraVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.CassandraVolumeExpansionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.TLSSpec"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.CassandraHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.CassandraUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.CassandraVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.CassandraVolumeExpansionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.TLSSpec"}, } } @@ -27122,50 +27112,6 @@ func schema_apimachinery_apis_ops_v1alpha1_CassandraVolumeExpansionSpec(ref comm } } -func schema_apimachinery_apis_ops_v1alpha1_ClickHouseCustomConfigurationSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ClickHouseCustomConfigurationSpec is the spec for Reconfiguring the clickhouse Settings", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "configSecret": { - SchemaProps: spec.SchemaProps{ - Description: "ConfigSecret is an optional field to provide custom configuration file for database.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - "applyConfig": { - SchemaProps: spec.SchemaProps{ - Description: "ApplyConfig is an optional field to provide clickhouse configuration. Provided configuration will be applied to config files stored in ConfigSecret. If the ConfigSecret is missing, the operator will create a new k8s secret by the following naming convention: {db-name}-user-config . Expected input format:\n\tapplyConfig:\n\t\tfile-name.yml: |\n\t\t\tkey: value", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "removeCustomConfig": { - SchemaProps: spec.SchemaProps{ - Description: "If set to \"true\", the user provided configuration will be removed. The clickhouse cluster will start will default configuration that is generated by the operator.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, - } -} - func schema_apimachinery_apis_ops_v1alpha1_ClickHouseHorizontalScalingSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -27342,7 +27288,7 @@ func schema_apimachinery_apis_ops_v1alpha1_ClickHouseOpsRequestSpec(ref common.R "configuration": { SchemaProps: spec.SchemaProps{ Description: "Specifies information necessary for custom configuration of clickhouse", - Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.ClickHouseCustomConfigurationSpec"), + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec"), }, }, "timeout": { @@ -27375,7 +27321,7 @@ func schema_apimachinery_apis_ops_v1alpha1_ClickHouseOpsRequestSpec(ref common.R }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ClickHouseCustomConfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ClickHouseHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ClickHouseTLSSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ClickHouseUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ClickHouseVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ClickHouseVolumeExpansionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ClickHouseHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ClickHouseTLSSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ClickHouseUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ClickHouseVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ClickHouseVolumeExpansionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec"}, } } @@ -27545,50 +27491,6 @@ func schema_apimachinery_apis_ops_v1alpha1_ContainerResources(ref common.Referen } } -func schema_apimachinery_apis_ops_v1alpha1_DruidCustomConfigurationSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "DruidCustomConfigurationSpec is the spec for Reconfiguring the Druid Settings", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "configSecret": { - SchemaProps: spec.SchemaProps{ - Description: "ConfigSecret is an optional field to provide custom configuration file for database.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - "applyConfig": { - SchemaProps: spec.SchemaProps{ - Description: "ApplyConfig is an optional field to provide Druid configuration. Provided configuration will be applied to config files stored in ConfigSecret. If the ConfigSecret is missing, the operator will create a new k8s secret by the following naming convention: {db-name}-user-config . Expected input format:\n\tapplyConfig:\n\t\tfile-name.properties: |\n\t\t\tkey=value\n\t\tserver.properties: |\n\t\t\tlog.retention.ms=10000", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "removeCustomConfig": { - SchemaProps: spec.SchemaProps{ - Description: "If set to \"true\", the user provided configuration will be removed. The Druid cluster will start will default configuration that is generated by the operator.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, - } -} - func schema_apimachinery_apis_ops_v1alpha1_DruidHorizontalScalingSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -27821,7 +27723,7 @@ func schema_apimachinery_apis_ops_v1alpha1_DruidOpsRequestSpec(ref common.Refere "configuration": { SchemaProps: spec.SchemaProps{ Description: "Specifies information necessary for custom configuration of Druid", - Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.DruidCustomConfigurationSpec"), + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec"), }, }, "tls": { @@ -27854,7 +27756,7 @@ func schema_apimachinery_apis_ops_v1alpha1_DruidOpsRequestSpec(ref common.Refere }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.DruidCustomConfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.DruidHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.DruidUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.DruidVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.DruidVolumeExpansionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.TLSSpec"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.DruidHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.DruidUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.DruidVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.DruidVolumeExpansionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.TLSSpec"}, } } @@ -27998,63 +27900,6 @@ func schema_apimachinery_apis_ops_v1alpha1_ElasticsearchCustomConfiguration(ref } } -func schema_apimachinery_apis_ops_v1alpha1_ElasticsearchCustomConfigurationSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ElasticsearchCustomConfigurationSpec is the spec for Reconfiguring the Elasticsearch Settings", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "configSecret": { - SchemaProps: spec.SchemaProps{ - Description: "ConfigSecret is an optional field to provide custom configuration file for database.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - "secureConfigSecret": { - SchemaProps: spec.SchemaProps{ - Description: "SecureConfigSecret is an optional field to provide secure settings for database.\n\t- Ref: https://www.elastic.co/guide/en/elasticsearch/reference/7.14/secure-settings.html", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - "applyConfig": { - SchemaProps: spec.SchemaProps{ - Description: "ApplyConfig is an optional field to provide Elasticsearch configuration. Provided configuration will be applied to config files stored in ConfigSecret. If the ConfigSecret is missing, the operator will create a new k8s secret by the following naming convention: {db-name}-user-config . Expected input format:\n\tapplyConfig:\n\t\tfile-name.yml: |\n\t\t\tkey: value\n\t\telasticsearch.yml: |\n\t\t\tthread_pool:\n\t\t\t\twrite:\n\t\t\t\t\tsize: 30", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "removeCustomConfig": { - SchemaProps: spec.SchemaProps{ - Description: "If set to \"true\", the user provided configuration will be removed. The Elasticsearch cluster will start will default configuration that is generated by the operator.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "removeSecureCustomConfig": { - SchemaProps: spec.SchemaProps{ - Description: "If set to \"true\", the user provided secure settings will be removed. The elasticsearch.keystore will start will default password (i.e. \"\").", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, - } -} - func schema_apimachinery_apis_ops_v1alpha1_ElasticsearchHorizontalScalingSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -28309,7 +28154,7 @@ func schema_apimachinery_apis_ops_v1alpha1_ElasticsearchOpsRequestSpec(ref commo "configuration": { SchemaProps: spec.SchemaProps{ Description: "Specifies information necessary for custom configuration of Elasticsearch", - Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.ElasticsearchCustomConfigurationSpec"), + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.ElasticsearchReconfigurationSpec"), }, }, "tls": { @@ -28354,7 +28199,71 @@ func schema_apimachinery_apis_ops_v1alpha1_ElasticsearchOpsRequestSpec(ref commo }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ElasticsearchCustomConfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ElasticsearchHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ElasticsearchUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ElasticsearchVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ElasticsearchVolumeExpansionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.TLSSpec"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ElasticsearchHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ElasticsearchReconfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ElasticsearchUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ElasticsearchVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ElasticsearchVolumeExpansionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.TLSSpec"}, + } +} + +func schema_apimachinery_apis_ops_v1alpha1_ElasticsearchReconfigurationSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ElasticsearchReconfigurationSpecis the spec for Reconfiguring the Elasticsearch Settings", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "configSecret": { + SchemaProps: spec.SchemaProps{ + Description: "ConfigSecret is an optional field to provide custom configuration file for database.", + Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + }, + }, + "secureConfigSecret": { + SchemaProps: spec.SchemaProps{ + Description: "SecureConfigSecret is an optional field to provide secure settings for database.\n\t- Ref: https://www.elastic.co/guide/en/elasticsearch/reference/7.14/secure-settings.html", + Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + }, + }, + "applyConfig": { + SchemaProps: spec.SchemaProps{ + Description: "ApplyConfig is an optional field to provide Elasticsearch configuration. Provided configuration will be applied to config files stored in ConfigSecret. If the ConfigSecret is missing, the operator will create a new k8s secret by the following naming convention: {db-name}-user-config . Expected input format:\n\tapplyConfig:\n\t\tfile-name.yml: |\n\t\t\tkey: value\n\t\telasticsearch.yml: |\n\t\t\tthread_pool:\n\t\t\t\twrite:\n\t\t\t\t\tsize: 30", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "removeCustomConfig": { + SchemaProps: spec.SchemaProps{ + Description: "If set to \"true\", the user provided configuration will be removed. The Elasticsearch cluster will start will default configuration that is generated by the operator.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "removeSecureCustomConfig": { + SchemaProps: spec.SchemaProps{ + Description: "If set to \"true\", the user provided secure settings will be removed. The elasticsearch.keystore will start will default password (i.e. \"\").", + Type: []string{"boolean"}, + Format: "", + }, + }, + "restart": { + SchemaProps: spec.SchemaProps{ + Description: "Restart controls whether to restart the database during reconfiguration. - auto (default): Operator determines if restart is needed based on configuration changes. - true: Restart the database during reconfiguration. - false: Don't restart the database during reconfiguration.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.LocalObjectReference"}, } } @@ -29204,50 +29113,6 @@ func schema_apimachinery_apis_ops_v1alpha1_FerretDBVerticalScalingSpec(ref commo } } -func schema_apimachinery_apis_ops_v1alpha1_HazelcastCustomConfigurationSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "HazelcastCustomConfigurationSpec is the spec for Reconfiguring the hazelcast Settings", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "configSecret": { - SchemaProps: spec.SchemaProps{ - Description: "ConfigSecret is an optional field to provide custom configuration file for database.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - "applyConfig": { - SchemaProps: spec.SchemaProps{ - Description: "ApplyConfig is an optional field to provide hazelcast configuration. Provided configuration will be applied to config files stored in ConfigSecret. If the ConfigSecret is missing, the operator will create a new k8s secret by the following naming convention: {db-name}-user-config . Expected input format:\n\tapplyConfig:\n\t\thazelcast.xml: |\n\t\t\tkey=value", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "removeCustomConfig": { - SchemaProps: spec.SchemaProps{ - Description: "If set to \"true\", the user provided configuration will be removed. The hazelcast cluster will start will default configuration that is generated by the operator.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, - } -} - func schema_apimachinery_apis_ops_v1alpha1_HazelcastHorizontalScalingSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -29417,7 +29282,7 @@ func schema_apimachinery_apis_ops_v1alpha1_HazelcastOpsRequestSpec(ref common.Re "configuration": { SchemaProps: spec.SchemaProps{ Description: "Specifies information necessary for custom configuration of hazelcast", - Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.HazelcastCustomConfigurationSpec"), + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec"), }, }, "tls": { @@ -29456,7 +29321,7 @@ func schema_apimachinery_apis_ops_v1alpha1_HazelcastOpsRequestSpec(ref common.Re }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.HazelcastCustomConfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.HazelcastHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.HazelcastUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.HazelcastVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.HazelcastVolumeExpansionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.TLSSpec"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.HazelcastHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.HazelcastUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.HazelcastVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.HazelcastVolumeExpansionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.TLSSpec"}, } } @@ -29580,50 +29445,6 @@ func schema_apimachinery_apis_ops_v1alpha1_Horizons(ref common.ReferenceCallback } } -func schema_apimachinery_apis_ops_v1alpha1_IgniteCustomConfigurationSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "IgniteCustomConfigurationSpec is the spec for Reconfiguring the ignite Settings", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "configSecret": { - SchemaProps: spec.SchemaProps{ - Description: "ConfigSecret is an optional field to provide custom configuration file for database.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - "applyConfig": { - SchemaProps: spec.SchemaProps{ - Description: "ApplyConfig is an optional field to provide ignite configuration. Provided configuration will be applied to config files stored in ConfigSecret. If the ConfigSecret is missing, the operator will create a new k8s secret by the following naming convention: {db-name}-user-config . Expected input format:\n\tapplyConfig:\n\t\tnode-configuration.xml: |\n\t\t\tkey=value", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "removeCustomConfig": { - SchemaProps: spec.SchemaProps{ - Description: "If set to \"true\", the user provided configuration will be removed. The ignite cluster will start will default configuration that is generated by the operator.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, - } -} - func schema_apimachinery_apis_ops_v1alpha1_IgniteHorizontalScalingSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -29788,7 +29609,7 @@ func schema_apimachinery_apis_ops_v1alpha1_IgniteOpsRequestSpec(ref common.Refer "configuration": { SchemaProps: spec.SchemaProps{ Description: "Specifies information necessary for custom configuration of ignite", - Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.IgniteCustomConfigurationSpec"), + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec"), }, }, "tls": { @@ -29833,7 +29654,7 @@ func schema_apimachinery_apis_ops_v1alpha1_IgniteOpsRequestSpec(ref common.Refer }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.IgniteCustomConfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.IgniteHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.IgniteUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.IgniteVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.IgniteVolumeExpansionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.TLSSpec"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.IgniteHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.IgniteUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.IgniteVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.IgniteVolumeExpansionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.TLSSpec"}, } } @@ -29907,50 +29728,6 @@ func schema_apimachinery_apis_ops_v1alpha1_IgniteVolumeExpansionSpec(ref common. } } -func schema_apimachinery_apis_ops_v1alpha1_KafkaCustomConfigurationSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "KafkaCustomConfigurationSpec is the spec for Reconfiguring the Kafka Settings", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "configSecret": { - SchemaProps: spec.SchemaProps{ - Description: "ConfigSecret is an optional field to provide custom configuration file for database.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - "applyConfig": { - SchemaProps: spec.SchemaProps{ - Description: "ApplyConfig is an optional field to provide Kafka configuration. Provided configuration will be applied to config files stored in ConfigSecret. If the ConfigSecret is missing, the operator will create a new k8s secret by the following naming convention: {db-name}-user-config . Expected input format:\n\tapplyConfig:\n\t\tfile-name.properties: |\n\t\t\tkey=value\n\t\tserver.properties: |\n\t\t\tlog.retention.ms=10000", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "removeCustomConfig": { - SchemaProps: spec.SchemaProps{ - Description: "If set to \"true\", the user provided configuration will be removed. The Kafka cluster will start will default configuration that is generated by the operator.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, - } -} - func schema_apimachinery_apis_ops_v1alpha1_KafkaHorizontalScalingSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -30150,7 +29927,7 @@ func schema_apimachinery_apis_ops_v1alpha1_KafkaOpsRequestSpec(ref common.Refere "configuration": { SchemaProps: spec.SchemaProps{ Description: "Specifies information necessary for custom configuration of Kafka", - Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.KafkaCustomConfigurationSpec"), + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec"), }, }, "tls": { @@ -30195,7 +29972,7 @@ func schema_apimachinery_apis_ops_v1alpha1_KafkaOpsRequestSpec(ref common.Refere }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.KafkaCustomConfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.KafkaHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.KafkaUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.KafkaVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.KafkaVolumeExpansionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.TLSSpec"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.KafkaHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.KafkaUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.KafkaVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.KafkaVolumeExpansionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.TLSSpec"}, } } @@ -30304,47 +30081,6 @@ func schema_apimachinery_apis_ops_v1alpha1_KafkaVolumeExpansionSpec(ref common.R } } -func schema_apimachinery_apis_ops_v1alpha1_MSSQLServerCustomConfigurationSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "MSSQLServerCustomConfigurationSpec is the spec for Reconfiguring the MSSQLServer", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "configSecret": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - "applyConfig": { - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "removeCustomConfig": { - SchemaProps: spec.SchemaProps{ - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, - } -} - func schema_apimachinery_apis_ops_v1alpha1_MSSQLServerHorizontalScalingSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -30509,7 +30245,7 @@ func schema_apimachinery_apis_ops_v1alpha1_MSSQLServerOpsRequestSpec(ref common. "configuration": { SchemaProps: spec.SchemaProps{ Description: "Specifies information necessary for custom configuration of MSSQLServer", - Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.MSSQLServerCustomConfigurationSpec"), + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec"), }, }, "tls": { @@ -30554,7 +30290,7 @@ func schema_apimachinery_apis_ops_v1alpha1_MSSQLServerOpsRequestSpec(ref common. }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MSSQLServerCustomConfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MSSQLServerHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MSSQLServerTLSSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MSSQLServerUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MSSQLServerVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MSSQLServerVolumeExpansionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MSSQLServerHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MSSQLServerTLSSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MSSQLServerUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MSSQLServerVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MSSQLServerVolumeExpansionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec"}, } } @@ -30742,49 +30478,6 @@ func schema_apimachinery_apis_ops_v1alpha1_MariaDBCustomConfiguration(ref common } } -func schema_apimachinery_apis_ops_v1alpha1_MariaDBCustomConfigurationSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "configSecret": { - SchemaProps: spec.SchemaProps{ - Description: "ConfigSecret is an optional field to provide custom configuration file for database.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - "removeCustomConfig": { - SchemaProps: spec.SchemaProps{ - Description: "If set to \"true\", the user provided configuration will be removed. MariaDB will start will default configuration that is generated by the operator.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "applyConfig": { - SchemaProps: spec.SchemaProps{ - Description: "ApplyConfig is an optional field to provide MariaDB configuration. Provided configuration will be applied to config files stored in ConfigSecret. If the ConfigSecret is missing, the operator will create a new k8s secret by the following naming convention: {db-name}-user-config . Expected input format:\n\tapplyConfig:\n\t\tfile-name.cnf: |\n\t\t\t[mysqld]\n\t\t\tkey1: value1\n\t\t\tkey2: value2", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, - } -} - func schema_apimachinery_apis_ops_v1alpha1_MariaDBHorizontalScalingSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -30962,7 +30655,7 @@ func schema_apimachinery_apis_ops_v1alpha1_MariaDBOpsRequestSpec(ref common.Refe "configuration": { SchemaProps: spec.SchemaProps{ Description: "Specifies information necessary for custom configuration of MariaDB", - Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.MariaDBCustomConfigurationSpec"), + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec"), }, }, "tls": { @@ -31007,7 +30700,7 @@ func schema_apimachinery_apis_ops_v1alpha1_MariaDBOpsRequestSpec(ref common.Refe }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MariaDBCustomConfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MariaDBHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MariaDBTLSSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MariaDBUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MariaDBVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MariaDBVolumeExpansionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MariaDBHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MariaDBTLSSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MariaDBUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MariaDBVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MariaDBVolumeExpansionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec"}, } } @@ -31407,7 +31100,7 @@ func schema_apimachinery_apis_ops_v1alpha1_MemcachedOpsRequestSpec(ref common.Re "configuration": { SchemaProps: spec.SchemaProps{ Description: "Specifies information necessary for custom configuration of Memcached", - Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.MemcachedCustomConfigurationSpec"), + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec"), }, }, "tls": { @@ -31452,7 +31145,7 @@ func schema_apimachinery_apis_ops_v1alpha1_MemcachedOpsRequestSpec(ref common.Re }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MemcachedCustomConfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MemcachedHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MemcachedUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MemcachedVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MemcachedVolumeExpansionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.TLSSpec"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MemcachedHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MemcachedUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MemcachedVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MemcachedVolumeExpansionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.TLSSpec"}, } } @@ -31534,95 +31227,6 @@ func schema_apimachinery_apis_ops_v1alpha1_MemcachedVolumeExpansionSpec(ref comm } } -func schema_apimachinery_apis_ops_v1alpha1_MongoDBCustomConfiguration(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "configSecret": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - "applyConfig": { - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "removeCustomConfig": { - SchemaProps: spec.SchemaProps{ - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, - } -} - -func schema_apimachinery_apis_ops_v1alpha1_MongoDBCustomConfigurationSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "standalone": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBCustomConfiguration"), - }, - }, - "replicaSet": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBCustomConfiguration"), - }, - }, - "mongos": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBCustomConfiguration"), - }, - }, - "configServer": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBCustomConfiguration"), - }, - }, - "shard": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBCustomConfiguration"), - }, - }, - "arbiter": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBCustomConfiguration"), - }, - }, - "hidden": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBCustomConfiguration"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBCustomConfiguration"}, - } -} - func schema_apimachinery_apis_ops_v1alpha1_MongoDBHorizontalScalingSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -31808,7 +31412,7 @@ func schema_apimachinery_apis_ops_v1alpha1_MongoDBOpsRequestSpec(ref common.Refe "configuration": { SchemaProps: spec.SchemaProps{ Description: "Specifies information necessary for custom configuration of MongoDB", - Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBCustomConfigurationSpec"), + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBReconfigurationSpec"), }, }, "tls": { @@ -31877,7 +31481,56 @@ func schema_apimachinery_apis_ops_v1alpha1_MongoDBOpsRequestSpec(ref common.Refe }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ArchiverOptions", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.Horizons", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBCustomConfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBReplicaReadinessCriteria", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBVolumeExpansionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.Reprovision", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.TLSSpec"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ArchiverOptions", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.Horizons", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBReconfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBReplicaReadinessCriteria", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MongoDBVolumeExpansionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.Reprovision", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.TLSSpec"}, + } +} + +func schema_apimachinery_apis_ops_v1alpha1_MongoDBReconfigurationSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "standalone": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec"), + }, + }, + "replicaSet": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec"), + }, + }, + "mongos": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec"), + }, + }, + "configServer": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec"), + }, + }, + "shard": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec"), + }, + }, + "arbiter": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec"), + }, + }, + "hidden": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec"}, } } @@ -32077,46 +31730,6 @@ func schema_apimachinery_apis_ops_v1alpha1_MongosNode(ref common.ReferenceCallba } } -func schema_apimachinery_apis_ops_v1alpha1_MySQLCustomConfigurationSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "configSecret": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - "applyConfig": { - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "removeCustomConfig": { - SchemaProps: spec.SchemaProps{ - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, - } -} - func schema_apimachinery_apis_ops_v1alpha1_MySQLHorizontalScalingSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -32307,7 +31920,7 @@ func schema_apimachinery_apis_ops_v1alpha1_MySQLOpsRequestSpec(ref common.Refere "configuration": { SchemaProps: spec.SchemaProps{ Description: "Specifies information necessary for custom configuration of MySQL", - Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.MySQLCustomConfigurationSpec"), + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec"), }, }, "tls": { @@ -32364,7 +31977,7 @@ func schema_apimachinery_apis_ops_v1alpha1_MySQLOpsRequestSpec(ref common.Refere }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MySQLCustomConfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MySQLHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MySQLMigrationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MySQLReplicationModeTransformSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MySQLTLSSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MySQLUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MySQLVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MySQLVolumeExpansionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MySQLHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MySQLMigrationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MySQLReplicationModeTransformSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MySQLTLSSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MySQLUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MySQLVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MySQLVolumeExpansionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec"}, } } @@ -32904,7 +32517,7 @@ func schema_apimachinery_apis_ops_v1alpha1_PerconaXtraDBOpsRequestSpec(ref commo "configuration": { SchemaProps: spec.SchemaProps{ Description: "Specifies information necessary for custom configuration of PerconaXtraDB", - Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.PerconaXtraDBCustomConfigurationSpec"), + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec"), }, }, "tls": { @@ -32949,7 +32562,7 @@ func schema_apimachinery_apis_ops_v1alpha1_PerconaXtraDBOpsRequestSpec(ref commo }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PerconaXtraDBCustomConfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PerconaXtraDBHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PerconaXtraDBTLSSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PerconaXtraDBUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PerconaXtraDBVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PerconaXtraDBVolumeExpansionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PerconaXtraDBHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PerconaXtraDBTLSSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PerconaXtraDBUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PerconaXtraDBVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PerconaXtraDBVolumeExpansionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec"}, } } @@ -33096,66 +32709,6 @@ func schema_apimachinery_apis_ops_v1alpha1_PerconaXtraDBVolumeExpansionSpec(ref } } -func schema_apimachinery_apis_ops_v1alpha1_PgBouncerCustomConfiguration(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "configSecret": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - "applyConfig": { - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "removeCustomConfig": { - SchemaProps: spec.SchemaProps{ - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, - } -} - -func schema_apimachinery_apis_ops_v1alpha1_PgBouncerCustomConfigurationSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "pgbouncer": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.PgBouncerCustomConfiguration"), - }, - }, - }, - Required: []string{"pgbouncer"}, - }, - }, - Dependencies: []string{ - "kubedb.dev/apimachinery/apis/ops/v1alpha1.PgBouncerCustomConfiguration"}, - } -} - func schema_apimachinery_apis_ops_v1alpha1_PgBouncerHorizontalScalingSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -33313,7 +32866,7 @@ func schema_apimachinery_apis_ops_v1alpha1_PgBouncerOpsRequestSpec(ref common.Re "configuration": { SchemaProps: spec.SchemaProps{ Description: "Specifies information necessary for custom configuration of PgBouncer", - Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.PgBouncerCustomConfigurationSpec"), + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec"), }, }, "tls": { @@ -33358,7 +32911,7 @@ func schema_apimachinery_apis_ops_v1alpha1_PgBouncerOpsRequestSpec(ref common.Re }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PgBouncerCustomConfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PgBouncerHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PgBouncerTLSSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PgBouncerUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PgBouncerVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PgBouncerHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PgBouncerTLSSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PgBouncerUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PgBouncerVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec"}, } } @@ -33468,50 +33021,6 @@ func schema_apimachinery_apis_ops_v1alpha1_PgBouncerVerticalScalingSpec(ref comm } } -func schema_apimachinery_apis_ops_v1alpha1_PgpoolCustomConfigurationSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "PgpoolCustomConfigurationSpec is the spec for Reconfiguring the Pgpool Settings", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "configSecret": { - SchemaProps: spec.SchemaProps{ - Description: "ConfigSecret is an optional field to provide custom configuration file for Pgpool.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - "applyConfig": { - SchemaProps: spec.SchemaProps{ - Description: "ApplyConfig is an optional field to provide Pgpool configuration. Provided configuration will be applied to config files stored in ConfigSecret. If the ConfigSecret is missing, the operator will create a new k8s secret by the following naming convention: {db-name}-config or use the previous init config if it exists. Expected input format: applyConfig:\n pgpool.conf: |-\n memory_cache_enabled = off", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "removeCustomConfig": { - SchemaProps: spec.SchemaProps{ - Description: "If set to \"true\", the user provided configuration via custom config and init config will be removed. Then Pgpool will start with default configuration that is generated by the operator.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, - } -} - func schema_apimachinery_apis_ops_v1alpha1_PgpoolHorizontalScalingSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -33670,7 +33179,7 @@ func schema_apimachinery_apis_ops_v1alpha1_PgpoolOpsRequestSpec(ref common.Refer "configuration": { SchemaProps: spec.SchemaProps{ Description: "Specifies information necessary for custom configuration of Pgpool", - Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.PgpoolCustomConfigurationSpec"), + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec"), }, }, "tls": { @@ -33715,7 +33224,7 @@ func schema_apimachinery_apis_ops_v1alpha1_PgpoolOpsRequestSpec(ref common.Refer }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PgpoolCustomConfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PgpoolHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PgpoolTLSSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PgpoolUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PgpoolVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PgpoolHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PgpoolTLSSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PgpoolUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PgpoolVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec"}, } } @@ -33901,14 +33410,21 @@ func schema_apimachinery_apis_ops_v1alpha1_PostgresCustomConfigurationSpec(ref c SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ + "tuning": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresTuningConfig"), + }, + }, "configSecret": { SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + Description: "ConfigSecret is an optional field to provide custom configuration file for the database (i.e. mssql.conf, mongod.conf). If specified, these configurations will be used with default configurations (if any) and applyConfig configurations (if any). Configurations from this secret will override default configurations.", + Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), }, }, "applyConfig": { SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, + Description: "ApplyConfig contains key-value pairs of configurations to be applied to the database. These configurations will override both default configurations and configurations from the config secret (if any).", + Type: []string{"object"}, AdditionalProperties: &spec.SchemaOrBool{ Allows: true, Schema: &spec.Schema{ @@ -33923,15 +33439,23 @@ func schema_apimachinery_apis_ops_v1alpha1_PostgresCustomConfigurationSpec(ref c }, "removeCustomConfig": { SchemaProps: spec.SchemaProps{ - Type: []string{"boolean"}, - Format: "", + Description: "RemoveCustomConfig when set to true, removes any previous custom configuration (config secret and apply configs) and uses only current configurations (if provided) and the default configurations.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "restart": { + SchemaProps: spec.SchemaProps{ + Description: "Restart controls whether to restart the database during reconfiguration. - auto (default): Operator determines if restart is needed based on configuration changes. - true: Restart the database during reconfiguration. - false: Don't restart the database during reconfiguration.", + Type: []string{"string"}, + Format: "", }, }, }, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, + "k8s.io/api/core/v1.LocalObjectReference", "kubedb.dev/apimachinery/apis/ops/v1alpha1.PostgresTuningConfig"}, } } @@ -34347,6 +33871,47 @@ func schema_apimachinery_apis_ops_v1alpha1_PostgresTLSSpec(ref common.ReferenceC } } +func schema_apimachinery_apis_ops_v1alpha1_PostgresTuningConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "PostgresTuningConfig defines configuration for PostgreSQL performance tuning", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "profile": { + SchemaProps: spec.SchemaProps{ + Description: "Profile defines a predefined tuning profile for different workload types. If specified, other tuning parameters will be calculated based on this profile.", + Type: []string{"string"}, + Format: "", + }, + }, + "maxConnections": { + SchemaProps: spec.SchemaProps{ + Description: "MaxConnections defines the maximum number of concurrent connections. If not specified, it will be calculated based on available memory and tuning profile.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "storageType": { + SchemaProps: spec.SchemaProps{ + Description: "StorageType defines the type of storage for tuning purposes. If not specified, it will be inferred from StorageClass or default to HDD.", + Type: []string{"string"}, + Format: "", + }, + }, + "disableAutoTune": { + SchemaProps: spec.SchemaProps{ + Description: "DisableAutoTune disables automatic tuning entirely. If set to true, no tuning will be applied.", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + }, + }, + } +} + func schema_apimachinery_apis_ops_v1alpha1_PostgresUpdateVersionSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -34475,40 +34040,6 @@ func schema_apimachinery_apis_ops_v1alpha1_ProxySQLCustomConfiguration(ref commo } } -func schema_apimachinery_apis_ops_v1alpha1_ProxySQLCustomConfigurationSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "mysqlUsers": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.MySQLUsers"), - }, - }, - "mysqlQueryRules": { - SchemaProps: spec.SchemaProps{ - Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.MySQLQueryRules"), - }, - }, - "adminVariables": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), - }, - }, - "mysqlVariables": { - SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/runtime.RawExtension", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MySQLQueryRules", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MySQLUsers"}, - } -} - func schema_apimachinery_apis_ops_v1alpha1_ProxySQLHorizontalScalingSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -34667,7 +34198,7 @@ func schema_apimachinery_apis_ops_v1alpha1_ProxySQLOpsRequestSpec(ref common.Ref "configuration": { SchemaProps: spec.SchemaProps{ Description: "Specifies information necessary for custom configuration of ProxySQL", - Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.ProxySQLCustomConfigurationSpec"), + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.ProxySQLReconfigurationSpec"), }, }, "tls": { @@ -34712,7 +34243,41 @@ func schema_apimachinery_apis_ops_v1alpha1_ProxySQLOpsRequestSpec(ref common.Ref }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ProxySQLCustomConfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ProxySQLHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ProxySQLUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ProxySQLVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.TLSSpec"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ProxySQLHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ProxySQLReconfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ProxySQLUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ProxySQLVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.TLSSpec"}, + } +} + +func schema_apimachinery_apis_ops_v1alpha1_ProxySQLReconfigurationSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "mysqlUsers": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.MySQLUsers"), + }, + }, + "mysqlQueryRules": { + SchemaProps: spec.SchemaProps{ + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.MySQLQueryRules"), + }, + }, + "adminVariables": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), + }, + }, + "mysqlVariables": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/runtime.RawExtension", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MySQLQueryRules", "kubedb.dev/apimachinery/apis/ops/v1alpha1.MySQLUsers"}, } } @@ -34773,47 +34338,119 @@ func schema_apimachinery_apis_ops_v1alpha1_ProxySQLVerticalScalingSpec(ref commo } } -func schema_apimachinery_apis_ops_v1alpha1_RabbitMQCustomConfigurationSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_apimachinery_apis_ops_v1alpha1_QdrantOpsRequest(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "RabbitMQCustomConfigurationSpec is the spec for Reconfiguring the rabbitmq Settings", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.QdrantOpsRequestSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.OpsRequestStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "kubedb.dev/apimachinery/apis/ops/v1alpha1.OpsRequestStatus", "kubedb.dev/apimachinery/apis/ops/v1alpha1.QdrantOpsRequestSpec"}, + } +} + +func schema_apimachinery_apis_ops_v1alpha1_QdrantOpsRequestList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "QdrantOpsRequestList is a list of QdrantOpsRequests", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "configSecret": { + "kind": { SchemaProps: spec.SchemaProps{ - Description: "ConfigSecret is an optional field to provide custom configuration file for database.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", }, }, - "applyConfig": { + "apiVersion": { SchemaProps: spec.SchemaProps{ - Description: "ApplyConfig is an optional field to provide rabbitmq configuration. Provided configuration will be applied to config files stored in ConfigSecret. If the ConfigSecret is missing, the operator will create a new k8s secret by the following naming convention: {db-name}-user-config . Expected input format:\n\tapplyConfig:\n\t\trabbitmq.conf: |\n\t\t\tkey=value", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Description: "Items is a list of QdrantOpsRequest CRD objects", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Default: map[string]interface{}{}, + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.QdrantOpsRequest"), }, }, }, }, }, - "removeCustomConfig": { + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "kubedb.dev/apimachinery/apis/ops/v1alpha1.QdrantOpsRequest"}, + } +} + +func schema_apimachinery_apis_ops_v1alpha1_QdrantOpsRequestSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "QdrantOpsRequestSpec is the spec for QdrantOpsRequest", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "tls": { SchemaProps: spec.SchemaProps{ - Description: "If set to \"true\", the user provided configuration will be removed. The rabbitmq cluster will start will default configuration that is generated by the operator.", - Type: []string{"boolean"}, - Format: "", + Description: "Specifies information necessary for configuring TLS", + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.TLSSpec"), }, }, }, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, + "kubedb.dev/apimachinery/apis/ops/v1alpha1.TLSSpec"}, } } @@ -34981,7 +34618,7 @@ func schema_apimachinery_apis_ops_v1alpha1_RabbitMQOpsRequestSpec(ref common.Ref "configuration": { SchemaProps: spec.SchemaProps{ Description: "Specifies information necessary for custom configuration of rabbitmq", - Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.RabbitMQCustomConfigurationSpec"), + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec"), }, }, "tls": { @@ -35026,7 +34663,7 @@ func schema_apimachinery_apis_ops_v1alpha1_RabbitMQOpsRequestSpec(ref common.Ref }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RabbitMQCustomConfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RabbitMQHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RabbitMQUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RabbitMQVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RabbitMQVolumeExpansionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.TLSSpec"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RabbitMQHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RabbitMQUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RabbitMQVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RabbitMQVolumeExpansionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.TLSSpec"}, } } @@ -35111,6 +34748,57 @@ func schema_apimachinery_apis_ops_v1alpha1_RabbitMQVolumeExpansionSpec(ref commo } } +func schema_apimachinery_apis_ops_v1alpha1_ReconfigurationSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ReconfigurationSpec is the spec for Reconfiguring the Database", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "configSecret": { + SchemaProps: spec.SchemaProps{ + Description: "ConfigSecret is an optional field to provide custom configuration file for the database (i.e. mssql.conf, mongod.conf). If specified, these configurations will be used with default configurations (if any) and applyConfig configurations (if any). Configurations from this secret will override default configurations.", + Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + }, + }, + "applyConfig": { + SchemaProps: spec.SchemaProps{ + Description: "ApplyConfig contains key-value pairs of configurations to be applied to the database. These configurations will override both default configurations and configurations from the config secret (if any).", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "removeCustomConfig": { + SchemaProps: spec.SchemaProps{ + Description: "RemoveCustomConfig when set to true, removes any previous custom configuration (config secret and apply configs) and uses only current configurations (if provided) and the default configurations.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "restart": { + SchemaProps: spec.SchemaProps{ + Description: "Restart controls whether to restart the database during reconfiguration. - auto (default): Operator determines if restart is needed based on configuration changes. - true: Restart the database during reconfiguration. - false: Don't restart the database during reconfiguration.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.LocalObjectReference"}, + } +} + func schema_apimachinery_apis_ops_v1alpha1_RedisAclSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -35169,12 +34857,14 @@ func schema_apimachinery_apis_ops_v1alpha1_RedisCustomConfigurationSpec(ref comm Properties: map[string]spec.Schema{ "configSecret": { SchemaProps: spec.SchemaProps{ - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + Description: "ConfigSecret is an optional field to provide custom configuration file for the database (i.e. mssql.conf, mongod.conf). If specified, these configurations will be used with default configurations (if any) and applyConfig configurations (if any). Configurations from this secret will override default configurations.", + Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), }, }, "applyConfig": { SchemaProps: spec.SchemaProps{ - Type: []string{"object"}, + Description: "ApplyConfig contains key-value pairs of configurations to be applied to the database. These configurations will override both default configurations and configurations from the config secret (if any).", + Type: []string{"object"}, AdditionalProperties: &spec.SchemaOrBool{ Allows: true, Schema: &spec.Schema{ @@ -35189,8 +34879,16 @@ func schema_apimachinery_apis_ops_v1alpha1_RedisCustomConfigurationSpec(ref comm }, "removeCustomConfig": { SchemaProps: spec.SchemaProps{ - Type: []string{"boolean"}, - Format: "", + Description: "RemoveCustomConfig when set to true, removes any previous custom configuration (config secret and apply configs) and uses only current configurations (if provided) and the default configurations.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "restart": { + SchemaProps: spec.SchemaProps{ + Description: "Restart controls whether to restart the database during reconfiguration. - auto (default): Operator determines if restart is needed based on configuration changes. - true: Restart the database during reconfiguration. - false: Don't restart the database during reconfiguration.", + Type: []string{"string"}, + Format: "", }, }, "auth": { @@ -36080,26 +35778,26 @@ func schema_apimachinery_apis_ops_v1alpha1_SinglestoreCustomConfigurationSpec(re "node": { SchemaProps: spec.SchemaProps{ Description: "Custom Configuration specification for standalone", - Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.SinglestoreCustomConfiguration"), + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec"), }, }, "aggregator": { SchemaProps: spec.SchemaProps{ Description: "Custom Configuration specification for Aggregator", - Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.SinglestoreCustomConfiguration"), + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec"), }, }, "leaf": { SchemaProps: spec.SchemaProps{ Description: "Custom Configuration specification for Leaf", - Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.SinglestoreCustomConfiguration"), + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec"), }, }, }, }, }, Dependencies: []string{ - "kubedb.dev/apimachinery/apis/ops/v1alpha1.SinglestoreCustomConfiguration"}, + "kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec"}, } } @@ -36423,50 +36121,6 @@ func schema_apimachinery_apis_ops_v1alpha1_SinglestoreVolumeExpansionSpec(ref co } } -func schema_apimachinery_apis_ops_v1alpha1_SolrCustomConfigurationSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "SolrCustomConfigurationSpec is the spec for Reconfiguring the solr Settings", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "configSecret": { - SchemaProps: spec.SchemaProps{ - Description: "ConfigSecret is an optional field to provide custom configuration file for database.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - "applyConfig": { - SchemaProps: spec.SchemaProps{ - Description: "ApplyConfig is an optional field to provide solr configuration. Provided configuration will be applied to config files stored in ConfigSecret. If the ConfigSecret is missing, the operator will create a new k8s secret by the following naming convention: {db-name}-user-config . Expected input format:\n\tapplyConfig:\n\t\tsolr.xml: |\n\t\t\tkey=value", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "removeCustomConfig": { - SchemaProps: spec.SchemaProps{ - Description: "If set to \"true\", the user provided configuration will be removed. The solr cluster will start will default configuration that is generated by the operator.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, - } -} - func schema_apimachinery_apis_ops_v1alpha1_SolrHorizontalScalingSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -36657,7 +36311,7 @@ func schema_apimachinery_apis_ops_v1alpha1_SolrOpsRequestSpec(ref common.Referen "configuration": { SchemaProps: spec.SchemaProps{ Description: "Specifies information necessary for custom configuration of solr", - Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.SolrCustomConfigurationSpec"), + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec"), }, }, "tls": { @@ -36696,7 +36350,7 @@ func schema_apimachinery_apis_ops_v1alpha1_SolrOpsRequestSpec(ref common.Referen }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.SolrCustomConfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.SolrHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.SolrUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.SolrVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.SolrVolumeExpansionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.TLSSpec"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.SolrHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.SolrUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.SolrVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.SolrVolumeExpansionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.TLSSpec"}, } } @@ -36879,50 +36533,6 @@ func schema_apimachinery_apis_ops_v1alpha1_Topology(ref common.ReferenceCallback } } -func schema_apimachinery_apis_ops_v1alpha1_ZooKeeperCustomConfigurationSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ZooKeeperCustomConfigurationSpec is the spec for Reconfiguring the zookeeper Settings", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "configSecret": { - SchemaProps: spec.SchemaProps{ - Description: "ConfigSecret is an optional field to provide custom configuration file for database.", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), - }, - }, - "applyConfig": { - SchemaProps: spec.SchemaProps{ - Description: "ApplyConfig is an optional field to provide zookeeper configuration. Provided configuration will be applied to config files stored in ConfigSecret. If the ConfigSecret is missing, the operator will create a new k8s secret by the following naming convention: {db-name}-user-config . Expected input format:\n\tapplyConfig:\n\t\tzookeeper.conf: |\n\t\t\tkey=value", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "removeCustomConfig": { - SchemaProps: spec.SchemaProps{ - Description: "If set to \"true\", the user provided configuration will be removed. The zookeeper cluster will start will default configuration that is generated by the operator.", - Type: []string{"boolean"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference"}, - } -} - func schema_apimachinery_apis_ops_v1alpha1_ZooKeeperHorizontalScalingSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -37087,7 +36697,7 @@ func schema_apimachinery_apis_ops_v1alpha1_ZooKeeperOpsRequestSpec(ref common.Re "configuration": { SchemaProps: spec.SchemaProps{ Description: "Specifies information necessary for custom configuration of zookeeper", - Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.ZooKeeperCustomConfigurationSpec"), + Ref: ref("kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec"), }, }, "authentication": { @@ -37132,7 +36742,7 @@ func schema_apimachinery_apis_ops_v1alpha1_ZooKeeperOpsRequestSpec(ref common.Re }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.TLSSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ZooKeeperCustomConfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ZooKeeperHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ZooKeeperUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ZooKeeperVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ZooKeeperVolumeExpansionSpec"}, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "kubedb.dev/apimachinery/apis/ops/v1alpha1.AuthSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ReconfigurationSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.RestartSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.TLSSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ZooKeeperHorizontalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ZooKeeperUpdateVersionSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ZooKeeperVerticalScalingSpec", "kubedb.dev/apimachinery/apis/ops/v1alpha1.ZooKeeperVolumeExpansionSpec"}, } } diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/perconaxtradb_ops_helpers.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/perconaxtradb_ops_helpers.go index 82467401f..49c914cae 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/perconaxtradb_ops_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/perconaxtradb_ops_helpers.go @@ -67,8 +67,8 @@ func (p *PerconaXtraDBOpsRequest) GetDBRefName() string { return p.Spec.DatabaseRef.Name } -func (p *PerconaXtraDBOpsRequest) GetRequestType() any { - return p.Spec.Type +func (p *PerconaXtraDBOpsRequest) GetRequestType() string { + return string(p.Spec.Type) } func (p *PerconaXtraDBOpsRequest) GetStatus() OpsRequestStatus { diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/perconaxtradb_ops_types.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/perconaxtradb_ops_types.go index 9451259e0..dda3abf3a 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/perconaxtradb_ops_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/perconaxtradb_ops_types.go @@ -64,7 +64,7 @@ type PerconaXtraDBOpsRequestSpec struct { // Specifies information necessary for volume expansion VolumeExpansion *PerconaXtraDBVolumeExpansionSpec `json:"volumeExpansion,omitempty"` // Specifies information necessary for custom configuration of PerconaXtraDB - Configuration *PerconaXtraDBCustomConfigurationSpec `json:"configuration,omitempty"` + Configuration *ReconfigurationSpec `json:"configuration,omitempty"` // Specifies information necessary for configuring TLS TLS *PerconaXtraDBTLSSpec `json:"tls,omitempty"` // Specifies information necessary for configuring authSecret of the database diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/pgbouncer_ops_helpers.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/pgbouncer_ops_helpers.go index 0734cbd3a..673ac2b81 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/pgbouncer_ops_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/pgbouncer_ops_helpers.go @@ -67,8 +67,8 @@ func (p *PgBouncerOpsRequest) GetDBRefName() string { return p.Spec.DatabaseRef.Name } -func (p *PgBouncerOpsRequest) GetRequestType() any { - return p.Spec.Type +func (p *PgBouncerOpsRequest) GetRequestType() string { + return string(p.Spec.Type) } func (p *PgBouncerOpsRequest) GetStatus() OpsRequestStatus { diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/pgbouncer_ops_types.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/pgbouncer_ops_types.go index 2d596ca52..8e24dda63 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/pgbouncer_ops_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/pgbouncer_ops_types.go @@ -63,7 +63,7 @@ type PgBouncerOpsRequestSpec struct { // Specifies information necessary for vertical scaling VerticalScaling *PgBouncerVerticalScalingSpec `json:"verticalScaling,omitempty"` // Specifies information necessary for custom configuration of PgBouncer - Configuration *PgBouncerCustomConfigurationSpec `json:"configuration,omitempty"` + Configuration *ReconfigurationSpec `json:"configuration,omitempty"` // Specifies information necessary for configuring TLS TLS *PgBouncerTLSSpec `json:"tls,omitempty"` // Specifies information necessary for configuring authSecret of the database @@ -99,16 +99,6 @@ type PgBouncerVerticalScalingSpec struct { Exporter *ContainerResources `json:"exporter,omitempty"` } -type PgBouncerCustomConfigurationSpec struct { - PgBouncer *PgBouncerCustomConfiguration `json:"pgbouncer"` -} - -type PgBouncerCustomConfiguration struct { - ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` - ApplyConfig map[string]string `json:"applyConfig,omitempty"` - RemoveCustomConfig bool `json:"removeCustomConfig,omitempty"` -} - type PgBouncerTLSSpec struct { TLSSpec `json:",inline,omitempty"` diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/pgpool_ops_helpers.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/pgpool_ops_helpers.go index 169582d1b..c29613e1c 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/pgpool_ops_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/pgpool_ops_helpers.go @@ -63,8 +63,8 @@ func (r *PgpoolOpsRequest) GetDBRefName() string { return r.Spec.DatabaseRef.Name } -func (r *PgpoolOpsRequest) GetRequestType() any { - return r.Spec.Type +func (r *PgpoolOpsRequest) GetRequestType() string { + return string(r.Spec.Type) } func (r *PgpoolOpsRequest) GetStatus() OpsRequestStatus { diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/pgpool_ops_types.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/pgpool_ops_types.go index c4787fee0..f62685495 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/pgpool_ops_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/pgpool_ops_types.go @@ -63,7 +63,7 @@ type PgpoolOpsRequestSpec struct { // Specifies information necessary for vertical scaling VerticalScaling *PgpoolVerticalScalingSpec `json:"verticalScaling,omitempty"` // Specifies information necessary for custom configuration of Pgpool - Configuration *PgpoolCustomConfigurationSpec `json:"configuration,omitempty"` + Configuration *ReconfigurationSpec `json:"configuration,omitempty"` // Specifies information necessary for configuring TLS TLS *PgpoolTLSSpec `json:"tls,omitempty"` // Specifies information necessary for configuring authSecret of the database @@ -113,27 +113,6 @@ type PgpoolVerticalScalingSpec struct { Node *PodResources `json:"node,omitempty"` } -// PgpoolCustomConfigurationSpec is the spec for Reconfiguring the Pgpool Settings -type PgpoolCustomConfigurationSpec struct { - // ConfigSecret is an optional field to provide custom configuration file for Pgpool. - // +optional - ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` - // ApplyConfig is an optional field to provide Pgpool configuration. - // Provided configuration will be applied to config files stored in ConfigSecret. - // If the ConfigSecret is missing, the operator will create a new k8s secret by the - // following naming convention: {db-name}-config or use the previous init config if it exists. - // Expected input format: - // applyConfig: - // pgpool.conf: |- - // memory_cache_enabled = off - // +optional - ApplyConfig map[string]string `json:"applyConfig,omitempty"` - // If set to "true", the user provided configuration via custom config and init config will be removed. - // Then Pgpool will start with default configuration that is generated by the operator. - // +optional - RemoveCustomConfig bool `json:"removeCustomConfig,omitempty"` -} - // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // PgpoolOpsRequestList is a list of PgpoolOpsRequests diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/postgres_ops_helpers.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/postgres_ops_helpers.go index 930727ed3..26af195c6 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/postgres_ops_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/postgres_ops_helpers.go @@ -67,8 +67,8 @@ func (p *PostgresOpsRequest) GetDBRefName() string { return p.Spec.DatabaseRef.Name } -func (p *PostgresOpsRequest) GetRequestType() any { - return p.Spec.Type +func (p *PostgresOpsRequest) GetRequestType() string { + return string(p.Spec.Type) } func (p *PostgresOpsRequest) GetStatus() OpsRequestStatus { diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/postgres_ops_types.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/postgres_ops_types.go index 317bc0193..24eac2051 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/postgres_ops_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/postgres_ops_types.go @@ -162,9 +162,8 @@ type PostgresVolumeExpansionSpec struct { } type PostgresCustomConfigurationSpec struct { - ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` - ApplyConfig map[string]string `json:"applyConfig,omitempty"` - RemoveCustomConfig bool `json:"removeCustomConfig,omitempty"` + Tuning *PostgresTuningConfig `json:"tuning,omitempty"` + ReconfigurationSpec `json:",inline,omitempty"` } type PostgresCustomConfiguration struct { @@ -187,6 +186,60 @@ type PostgresSetRaftKeyPair struct { KeyPair map[string]string `json:"keyPair,omitempty"` } +// PostgresTuningConfig defines configuration for PostgreSQL performance tuning +type PostgresTuningConfig struct { + // Profile defines a predefined tuning profile for different workload types. + // If specified, other tuning parameters will be calculated based on this profile. + // +optional + Profile *PostgresProfile `json:"profile,omitempty"` + + // MaxConnections defines the maximum number of concurrent connections. + // If not specified, it will be calculated based on available memory and tuning profile. + // +optional + MaxConnections *int32 `json:"maxConnections,omitempty"` + + // StorageType defines the type of storage for tuning purposes. + // If not specified, it will be inferred from StorageClass or default to HDD. + // +optional + StorageType *PostgresStorageType `json:"storageType,omitempty"` + + // DisableAutoTune disables automatic tuning entirely. + // If set to true, no tuning will be applied. + // +optional + DisableAutoTune bool `json:"disableAutoTune,omitempty"` +} + +// PostgresProfile defines predefined tuning profiles +// +kubebuilder:validation:Enum=web;oltp;dw;mixed;desktop +type PostgresProfile string + +const ( + // PostgresTuningProfileWeb optimizes for web applications with many simple queries + PostgresTuningProfileWeb PostgresProfile = "web" + + // PostgresTuningProfileOLTP optimizes for OLTP workloads with many short transactions + PostgresTuningProfileOLTP PostgresProfile = "oltp" + + // PostgresTuningProfileDW optimizes for data warehousing with complex analytical queries + PostgresTuningProfileDW PostgresProfile = "dw" + + // PostgresTuningProfileMixed optimizes for mixed workloads + PostgresTuningProfileMixed PostgresProfile = "mixed" + + // PostgresTuningProfileDesktop optimizes for desktop or development environments + PostgresTuningProfileDesktop PostgresProfile = "desktop" +) + +// PostgresStorageType defines storage types for tuning purposes +// +kubebuilder:validation:Enum=ssd;hdd;san +type PostgresStorageType string + +const ( + PostgresStorageTypeSSD PostgresStorageType = "ssd" + PostgresStorageTypeHDD PostgresStorageType = "hdd" + PostgresStorageTypeSAN PostgresStorageType = "san" +) + // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // PostgresOpsRequestList is a list of PostgresOpsRequests diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/proxysql_ops_helpers.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/proxysql_ops_helpers.go index 1bf2a091e..a9dac9bbd 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/proxysql_ops_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/proxysql_ops_helpers.go @@ -63,8 +63,8 @@ func (p *ProxySQLOpsRequest) GetDBRefName() string { return p.Spec.ProxyRef.Name } -func (p *ProxySQLOpsRequest) GetRequestType() any { - return p.Spec.Type +func (p *ProxySQLOpsRequest) GetRequestType() string { + return string(p.Spec.Type) } func (p *ProxySQLOpsRequest) GetStatus() OpsRequestStatus { diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/proxysql_ops_types.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/proxysql_ops_types.go index 63ec18af5..98c29ae70 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/proxysql_ops_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/proxysql_ops_types.go @@ -64,7 +64,7 @@ type ProxySQLOpsRequestSpec struct { // Specifies information necessary for vertical scaling VerticalScaling *ProxySQLVerticalScalingSpec `json:"verticalScaling,omitempty"` // Specifies information necessary for custom configuration of ProxySQL - Configuration *ProxySQLCustomConfigurationSpec `json:"configuration,omitempty"` + Configuration *ProxySQLReconfigurationSpec `json:"configuration,omitempty"` // Specifies information necessary for configuring TLS TLS *TLSSpec `json:"tls,omitempty"` // Specifies information necessary for configuring authSecret of the database @@ -123,7 +123,7 @@ type ProxySQLOpsRequestList struct { Items []ProxySQLOpsRequest `json:"items,omitempty"` } -type ProxySQLCustomConfigurationSpec struct { +type ProxySQLReconfigurationSpec struct { //+optional MySQLUsers *MySQLUsers `json:"mysqlUsers,omitempty"` diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/qdrant_ops_types.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/qdrant_ops_types.go new file mode 100644 index 000000000..f03e3e89a --- /dev/null +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/qdrant_ops_types.go @@ -0,0 +1,64 @@ +/* +Copyright AppsCode Inc. and Contributors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +//go:generate go-enum --mustparse --names --values +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +const ( + ResourceCodeQdrantOpsRequest = "qdops" + ResourceKindQdrantOpsRequest = "QdrantOpsRequest" + ResourceSingularQdrantOpsRequest = "qdrantopsrequest" + ResourcePluralQdrantOpsRequest = "qdrantopsrequests" +) + +// QdrantDBOpsRequest defines a Qdrant DBA operation. + +// +genclient +// +k8s:openapi-gen=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=qdrantopsrequests,singular=qdrantopsrequest,shortName=qdops,categories={ops,kubedb,appscode} +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Type",type="string",JSONPath=".spec.type" +// +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.phase" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" +type QdrantOpsRequest struct { + metav1.TypeMeta `json:",inline,omitempty"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec QdrantOpsRequestSpec `json:"spec,omitempty"` + Status OpsRequestStatus `json:"status,omitempty"` +} + +// QdrantOpsRequestSpec is the spec for QdrantOpsRequest +type QdrantOpsRequestSpec struct { + // Specifies information necessary for configuring TLS + TLS *TLSSpec `json:"tls,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// QdrantOpsRequestList is a list of QdrantOpsRequests +type QdrantOpsRequestList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + // Items is a list of QdrantOpsRequest CRD objects + Items []QdrantOpsRequest `json:"items,omitempty"` +} diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/rabbitmq_ops_helpers.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/rabbitmq_ops_helpers.go index 5aae68e58..4f766cda7 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/rabbitmq_ops_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/rabbitmq_ops_helpers.go @@ -63,8 +63,8 @@ func (r *RabbitMQOpsRequest) GetDBRefName() string { return r.Spec.DatabaseRef.Name } -func (r *RabbitMQOpsRequest) GetRequestType() any { - return r.Spec.Type +func (r *RabbitMQOpsRequest) GetRequestType() string { + return string(r.Spec.Type) } func (r *RabbitMQOpsRequest) GetStatus() OpsRequestStatus { diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/rabbitmq_ops_types.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/rabbitmq_ops_types.go index 7f135c201..32055da67 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/rabbitmq_ops_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/rabbitmq_ops_types.go @@ -64,7 +64,7 @@ type RabbitMQOpsRequestSpec struct { // Specifies information necessary for volume expansion VolumeExpansion *RabbitMQVolumeExpansionSpec `json:"volumeExpansion,omitempty"` // Specifies information necessary for custom configuration of rabbitmq - Configuration *RabbitMQCustomConfigurationSpec `json:"configuration,omitempty"` + Configuration *ReconfigurationSpec `json:"configuration,omitempty"` // Specifies information necessary for configuring TLS TLS *TLSSpec `json:"tls,omitempty"` // Specifies information necessary for configuring authSecret of the database @@ -113,27 +113,6 @@ type RabbitMQVolumeExpansionSpec struct { Node *resource.Quantity `json:"node,omitempty"` } -// RabbitMQCustomConfigurationSpec is the spec for Reconfiguring the rabbitmq Settings -type RabbitMQCustomConfigurationSpec struct { - // ConfigSecret is an optional field to provide custom configuration file for database. - // +optional - ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` - // ApplyConfig is an optional field to provide rabbitmq configuration. - // Provided configuration will be applied to config files stored in ConfigSecret. - // If the ConfigSecret is missing, the operator will create a new k8s secret by the - // following naming convention: {db-name}-user-config . - // Expected input format: - // applyConfig: - // rabbitmq.conf: | - // key=value - // +optional - ApplyConfig map[string]string `json:"applyConfig,omitempty"` - // If set to "true", the user provided configuration will be removed. - // The rabbitmq cluster will start will default configuration that is generated by the operator. - // +optional - RemoveCustomConfig bool `json:"removeCustomConfig,omitempty"` -} - // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // RabbitMQOpsRequestList is a list of RabbitMQOpsRequests diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/redis_ops_helpers.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/redis_ops_helpers.go index b2c7183e6..c80685d06 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/redis_ops_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/redis_ops_helpers.go @@ -67,8 +67,8 @@ func (r *RedisOpsRequest) GetDBRefName() string { return r.Spec.DatabaseRef.Name } -func (r *RedisOpsRequest) GetRequestType() any { - return r.Spec.Type +func (r *RedisOpsRequest) GetRequestType() string { + return string(r.Spec.Type) } func (r *RedisOpsRequest) GetStatus() OpsRequestStatus { diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/redis_ops_types.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/redis_ops_types.go index 332bc91a1..3f6ecb74c 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/redis_ops_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/redis_ops_types.go @@ -166,10 +166,8 @@ type RedisVolumeExpansionSpec struct { } type RedisCustomConfigurationSpec struct { - ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` - ApplyConfig map[string]string `json:"applyConfig,omitempty"` - RemoveCustomConfig bool `json:"removeCustomConfig,omitempty"` - Auth *RedisAclSpec `json:"auth,omitempty"` + ReconfigurationSpec `json:",inline,omitempty"` + Auth *RedisAclSpec `json:"auth,omitempty"` } // +kubebuilder:validation:Enum=ip;hostname diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/redis_sentinel_ops_helpers.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/redis_sentinel_ops_helpers.go index 776c67b85..b0d333843 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/redis_sentinel_ops_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/redis_sentinel_ops_helpers.go @@ -67,8 +67,8 @@ func (r *RedisSentinelOpsRequest) GetDBRefName() string { return r.Spec.DatabaseRef.Name } -func (r *RedisSentinelOpsRequest) GetRequestType() any { - return r.Spec.Type +func (r *RedisSentinelOpsRequest) GetRequestType() string { + return string(r.Spec.Type) } func (r *RedisSentinelOpsRequest) GetStatus() OpsRequestStatus { diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/register.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/register.go index 0cd4bfda5..13f55fc21 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/register.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/register.go @@ -92,6 +92,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &PostgresOpsRequestList{}, &ProxySQLOpsRequest{}, &ProxySQLOpsRequestList{}, + &QdrantOpsRequest{}, + &QdrantOpsRequestList{}, &RabbitMQOpsRequest{}, &RabbitMQOpsRequestList{}, &RedisOpsRequest{}, diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/singlestore_ops_helpers.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/singlestore_ops_helpers.go index 653d1a1a5..004c158b5 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/singlestore_ops_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/singlestore_ops_helpers.go @@ -63,8 +63,8 @@ func (r *SinglestoreOpsRequest) GetDBRefName() string { return r.Spec.DatabaseRef.Name } -func (r *SinglestoreOpsRequest) GetRequestType() any { - return r.Spec.Type +func (r *SinglestoreOpsRequest) GetRequestType() string { + return string(r.Spec.Type) } func (r *SinglestoreOpsRequest) GetStatus() OpsRequestStatus { diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/singlestore_ops_types.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/singlestore_ops_types.go index 7c58b567d..c6f29842d 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/singlestore_ops_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/singlestore_ops_types.go @@ -124,11 +124,11 @@ type SinglestoreVolumeExpansionSpec struct { // SinglestoreCustomConfigurationSpec is the spec for Singlestore reconfiguration type SinglestoreCustomConfigurationSpec struct { // Custom Configuration specification for standalone - Node *SinglestoreCustomConfiguration `json:"node,omitempty"` + Node *ReconfigurationSpec `json:"node,omitempty"` // Custom Configuration specification for Aggregator - Aggregator *SinglestoreCustomConfiguration `json:"aggregator,omitempty"` + Aggregator *ReconfigurationSpec `json:"aggregator,omitempty"` // Custom Configuration specification for Leaf - Leaf *SinglestoreCustomConfiguration `json:"leaf,omitempty"` + Leaf *ReconfigurationSpec `json:"leaf,omitempty"` } type SinglestoreCustomConfiguration struct { diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/solr_ops_helpers.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/solr_ops_helpers.go index 8b461cd06..5ec696776 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/solr_ops_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/solr_ops_helpers.go @@ -63,8 +63,8 @@ func (s *SolrOpsRequest) GetDBRefName() string { return s.Spec.DatabaseRef.Name } -func (s *SolrOpsRequest) GetRequestType() any { - return s.Spec.Type +func (s *SolrOpsRequest) GetRequestType() string { + return string(s.Spec.Type) } func (s *SolrOpsRequest) GetStatus() OpsRequestStatus { diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/solr_ops_types.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/solr_ops_types.go index 103591df5..3c5991d39 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/solr_ops_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/solr_ops_types.go @@ -70,7 +70,7 @@ type SolrOpsRequestSpec struct { // Specifies information necessary for restarting database Restart *RestartSpec `json:"restart,omitempty"` // Specifies information necessary for custom configuration of solr - Configuration *SolrCustomConfigurationSpec `json:"configuration,omitempty"` + Configuration *ReconfigurationSpec `json:"configuration,omitempty"` // Specifies information necessary for configuring TLS TLS *TLSSpec `json:"tls,omitempty"` // Specifies information necessary for configuring authSecret of the database @@ -123,27 +123,6 @@ type SolrHorizontalScalingSpec struct { Data *int32 `json:"data,omitempty"` } -// SolrCustomConfigurationSpec is the spec for Reconfiguring the solr Settings -type SolrCustomConfigurationSpec struct { - // ConfigSecret is an optional field to provide custom configuration file for database. - // +optional - ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` - // ApplyConfig is an optional field to provide solr configuration. - // Provided configuration will be applied to config files stored in ConfigSecret. - // If the ConfigSecret is missing, the operator will create a new k8s secret by the - // following naming convention: {db-name}-user-config . - // Expected input format: - // applyConfig: - // solr.xml: | - // key=value - // +optional - ApplyConfig map[string]string `json:"applyConfig,omitempty"` - // If set to "true", the user provided configuration will be removed. - // The solr cluster will start will default configuration that is generated by the operator. - // +optional - RemoveCustomConfig bool `json:"removeCustomConfig,omitempty"` -} - // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // SolrOpsRequestList is a list of DruidOpsRequests diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/type.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/type.go index 224d0739e..30e0488cb 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/type.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/type.go @@ -22,8 +22,47 @@ import ( kmapi "kmodules.xyz/client-go/api/v1" appcat "kmodules.xyz/custom-resources/apis/appcatalog/v1alpha1" nodemeta "kmodules.xyz/resource-metadata/apis/node/v1alpha1" + "sigs.k8s.io/controller-runtime/pkg/client" ) +// ReconfigureRestartType defines restart behavior during reconfiguration. +// +kubebuilder:validation:Enum="auto";"true";"false" +type ReconfigureRestartType string + +const ( + // ReconfigureRestartAuto indicates the operator will determine if restart is needed + ReconfigureRestartAuto ReconfigureRestartType = "auto" + // ReconfigureRestartTrue forces a restart during reconfiguration + ReconfigureRestartTrue ReconfigureRestartType = "true" + // ReconfigureRestartFalse skips restart during reconfiguration + ReconfigureRestartFalse ReconfigureRestartType = "false" +) + +// ReconfigurationSpec is the spec for Reconfiguring the Database +type ReconfigurationSpec struct { + // ConfigSecret is an optional field to provide custom configuration file for the database (i.e. mssql.conf, mongod.conf). + // If specified, these configurations will be used with default configurations (if any) and applyConfig configurations (if any). + // Configurations from this secret will override default configurations. + // +optional + ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` + + // ApplyConfig contains key-value pairs of configurations to be applied to the database. + // These configurations will override both default configurations and configurations from the config secret (if any). + ApplyConfig map[string]string `json:"applyConfig,omitempty"` + + // RemoveCustomConfig when set to true, removes any previous custom configuration (config secret and apply configs) and uses only current configurations (if provided) and the default configurations. + // +optional + RemoveCustomConfig bool `json:"removeCustomConfig,omitempty"` + + // Restart controls whether to restart the database during reconfiguration. + // - auto (default): Operator determines if restart is needed based on configuration changes. + // - true: Restart the database during reconfiguration. + // - false: Don't restart the database during reconfiguration. + // +optional + // +kubebuilder:default=auto + Restart ReconfigureRestartType `json:"restart,omitempty"` +} + type OpsRequestStatus struct { // Specifies the current phase of the ops request // +optional @@ -110,9 +149,10 @@ const ( type Accessor interface { GetObjectMeta() metav1.ObjectMeta GetDBRefName() string - GetRequestType() any + GetRequestType() string GetStatus() OpsRequestStatus SetStatus(_ OpsRequestStatus) + client.Object } // +kubebuilder:validation:Enum=ConfigureArchiver;DisableArchiver diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/zookeeper_ops_helpers.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/zookeeper_ops_helpers.go index a226fd3f8..70772aa43 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/zookeeper_ops_helpers.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/zookeeper_ops_helpers.go @@ -63,8 +63,8 @@ func (z *ZooKeeperOpsRequest) GetDBRefName() string { return z.Spec.DatabaseRef.Name } -func (z *ZooKeeperOpsRequest) GetRequestType() any { - return z.Spec.Type +func (z *ZooKeeperOpsRequest) GetRequestType() string { + return string(z.Spec.Type) } func (z *ZooKeeperOpsRequest) GetStatus() OpsRequestStatus { diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/zookeeper_ops_types.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/zookeeper_ops_types.go index 79b62ea61..8b0e6b55a 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/zookeeper_ops_types.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/zookeeper_ops_types.go @@ -68,7 +68,7 @@ type ZooKeeperOpsRequestSpec struct { // Specifies information necessary for volume expansion VolumeExpansion *ZooKeeperVolumeExpansionSpec `json:"volumeExpansion,omitempty"` // Specifies information necessary for custom configuration of zookeeper - Configuration *ZooKeeperCustomConfigurationSpec `json:"configuration,omitempty"` + Configuration *ReconfigurationSpec `json:"configuration,omitempty"` // Specifies information necessary for configuring authSecret of the database Authentication *AuthSpec `json:"authentication,omitempty"` // Specifies information necessary for configuring TLS @@ -113,27 +113,6 @@ type ZooKeeperVolumeExpansionSpec struct { Node *resource.Quantity `json:"node,omitempty"` } -// ZooKeeperCustomConfigurationSpec is the spec for Reconfiguring the zookeeper Settings -type ZooKeeperCustomConfigurationSpec struct { - // ConfigSecret is an optional field to provide custom configuration file for database. - // +optional - ConfigSecret *core.LocalObjectReference `json:"configSecret,omitempty"` - // ApplyConfig is an optional field to provide zookeeper configuration. - // Provided configuration will be applied to config files stored in ConfigSecret. - // If the ConfigSecret is missing, the operator will create a new k8s secret by the - // following naming convention: {db-name}-user-config . - // Expected input format: - // applyConfig: - // zookeeper.conf: | - // key=value - // +optional - ApplyConfig map[string]string `json:"applyConfig,omitempty"` - // If set to "true", the user provided configuration will be removed. - // The zookeeper cluster will start will default configuration that is generated by the operator. - // +optional - RemoveCustomConfig bool `json:"removeCustomConfig,omitempty"` -} - // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // ZooKeeperOpsRequestList is a list of ZooKeeperOpsRequests diff --git a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/zz_generated.deepcopy.go b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/zz_generated.deepcopy.go index 5063d9817..697e6fa98 100644 --- a/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/kubedb.dev/apimachinery/apis/ops/v1alpha1/zz_generated.deepcopy.go @@ -208,7 +208,7 @@ func (in *CassandraOpsRequestSpec) DeepCopyInto(out *CassandraOpsRequestSpec) { *out = *in if in.Configuration != nil { in, out := &in.Configuration, &out.Configuration - *out = new(CassandraCustomConfigurationSpec) + *out = new(ReconfigurationSpec) (*in).DeepCopyInto(*out) } out.DatabaseRef = in.DatabaseRef @@ -328,34 +328,6 @@ func (in *CassandraVolumeExpansionSpec) DeepCopy() *CassandraVolumeExpansionSpec return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClickHouseCustomConfigurationSpec) DeepCopyInto(out *ClickHouseCustomConfigurationSpec) { - *out = *in - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(v1.LocalObjectReference) - **out = **in - } - if in.ApplyConfig != nil { - in, out := &in.ApplyConfig, &out.ApplyConfig - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClickHouseCustomConfigurationSpec. -func (in *ClickHouseCustomConfigurationSpec) DeepCopy() *ClickHouseCustomConfigurationSpec { - if in == nil { - return nil - } - out := new(ClickHouseCustomConfigurationSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClickHouseHorizontalScalingSpec) DeepCopyInto(out *ClickHouseHorizontalScalingSpec) { *out = *in @@ -474,7 +446,7 @@ func (in *ClickHouseOpsRequestSpec) DeepCopyInto(out *ClickHouseOpsRequestSpec) } if in.Configuration != nil { in, out := &in.Configuration, &out.Configuration - *out = new(ClickHouseCustomConfigurationSpec) + *out = new(ReconfigurationSpec) (*in).DeepCopyInto(*out) } if in.Timeout != nil { @@ -608,34 +580,6 @@ func (in *ContainerResources) DeepCopy() *ContainerResources { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DruidCustomConfigurationSpec) DeepCopyInto(out *DruidCustomConfigurationSpec) { - *out = *in - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(v1.LocalObjectReference) - **out = **in - } - if in.ApplyConfig != nil { - in, out := &in.ApplyConfig, &out.ApplyConfig - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DruidCustomConfigurationSpec. -func (in *DruidCustomConfigurationSpec) DeepCopy() *DruidCustomConfigurationSpec { - if in == nil { - return nil - } - out := new(DruidCustomConfigurationSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DruidHorizontalScalingSpec) DeepCopyInto(out *DruidHorizontalScalingSpec) { *out = *in @@ -800,7 +744,7 @@ func (in *DruidOpsRequestSpec) DeepCopyInto(out *DruidOpsRequestSpec) { } if in.Configuration != nil { in, out := &in.Configuration, &out.Configuration - *out = new(DruidCustomConfigurationSpec) + *out = new(ReconfigurationSpec) (*in).DeepCopyInto(*out) } if in.TLS != nil { @@ -942,39 +886,6 @@ func (in *ElasticsearchCustomConfiguration) DeepCopy() *ElasticsearchCustomConfi return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ElasticsearchCustomConfigurationSpec) DeepCopyInto(out *ElasticsearchCustomConfigurationSpec) { - *out = *in - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(v1.LocalObjectReference) - **out = **in - } - if in.SecureConfigSecret != nil { - in, out := &in.SecureConfigSecret, &out.SecureConfigSecret - *out = new(v1.LocalObjectReference) - **out = **in - } - if in.ApplyConfig != nil { - in, out := &in.ApplyConfig, &out.ApplyConfig - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ElasticsearchCustomConfigurationSpec. -func (in *ElasticsearchCustomConfigurationSpec) DeepCopy() *ElasticsearchCustomConfigurationSpec { - if in == nil { - return nil - } - out := new(ElasticsearchCustomConfigurationSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ElasticsearchHorizontalScalingSpec) DeepCopyInto(out *ElasticsearchHorizontalScalingSpec) { *out = *in @@ -1159,7 +1070,7 @@ func (in *ElasticsearchOpsRequestSpec) DeepCopyInto(out *ElasticsearchOpsRequest } if in.Configuration != nil { in, out := &in.Configuration, &out.Configuration - *out = new(ElasticsearchCustomConfigurationSpec) + *out = new(ElasticsearchReconfigurationSpec) (*in).DeepCopyInto(*out) } if in.TLS != nil { @@ -1195,6 +1106,39 @@ func (in *ElasticsearchOpsRequestSpec) DeepCopy() *ElasticsearchOpsRequestSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ElasticsearchReconfigurationSpec) DeepCopyInto(out *ElasticsearchReconfigurationSpec) { + *out = *in + if in.ConfigSecret != nil { + in, out := &in.ConfigSecret, &out.ConfigSecret + *out = new(v1.LocalObjectReference) + **out = **in + } + if in.SecureConfigSecret != nil { + in, out := &in.SecureConfigSecret, &out.SecureConfigSecret + *out = new(v1.LocalObjectReference) + **out = **in + } + if in.ApplyConfig != nil { + in, out := &in.ApplyConfig, &out.ApplyConfig + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ElasticsearchReconfigurationSpec. +func (in *ElasticsearchReconfigurationSpec) DeepCopy() *ElasticsearchReconfigurationSpec { + if in == nil { + return nil + } + out := new(ElasticsearchReconfigurationSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ElasticsearchReplicaReadinessCriteria) DeepCopyInto(out *ElasticsearchReplicaReadinessCriteria) { *out = *in @@ -1855,34 +1799,6 @@ func (in *FerretDBVerticalScalingSpec) DeepCopy() *FerretDBVerticalScalingSpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *HazelcastCustomConfigurationSpec) DeepCopyInto(out *HazelcastCustomConfigurationSpec) { - *out = *in - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(v1.LocalObjectReference) - **out = **in - } - if in.ApplyConfig != nil { - in, out := &in.ApplyConfig, &out.ApplyConfig - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HazelcastCustomConfigurationSpec. -func (in *HazelcastCustomConfigurationSpec) DeepCopy() *HazelcastCustomConfigurationSpec { - if in == nil { - return nil - } - out := new(HazelcastCustomConfigurationSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *HazelcastHorizontalScalingSpec) DeepCopyInto(out *HazelcastHorizontalScalingSpec) { *out = *in @@ -1996,7 +1912,7 @@ func (in *HazelcastOpsRequestSpec) DeepCopyInto(out *HazelcastOpsRequestSpec) { } if in.Configuration != nil { in, out := &in.Configuration, &out.Configuration - *out = new(HazelcastCustomConfigurationSpec) + *out = new(ReconfigurationSpec) (*in).DeepCopyInto(*out) } if in.TLS != nil { @@ -2122,34 +2038,6 @@ func (in *Horizons) DeepCopy() *Horizons { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *IgniteCustomConfigurationSpec) DeepCopyInto(out *IgniteCustomConfigurationSpec) { - *out = *in - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(v1.LocalObjectReference) - **out = **in - } - if in.ApplyConfig != nil { - in, out := &in.ApplyConfig, &out.ApplyConfig - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IgniteCustomConfigurationSpec. -func (in *IgniteCustomConfigurationSpec) DeepCopy() *IgniteCustomConfigurationSpec { - if in == nil { - return nil - } - out := new(IgniteCustomConfigurationSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *IgniteHorizontalScalingSpec) DeepCopyInto(out *IgniteHorizontalScalingSpec) { *out = *in @@ -2258,7 +2146,7 @@ func (in *IgniteOpsRequestSpec) DeepCopyInto(out *IgniteOpsRequestSpec) { } if in.Configuration != nil { in, out := &in.Configuration, &out.Configuration - *out = new(IgniteCustomConfigurationSpec) + *out = new(ReconfigurationSpec) (*in).DeepCopyInto(*out) } if in.TLS != nil { @@ -2352,34 +2240,6 @@ func (in *IgniteVolumeExpansionSpec) DeepCopy() *IgniteVolumeExpansionSpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KafkaCustomConfigurationSpec) DeepCopyInto(out *KafkaCustomConfigurationSpec) { - *out = *in - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(v1.LocalObjectReference) - **out = **in - } - if in.ApplyConfig != nil { - in, out := &in.ApplyConfig, &out.ApplyConfig - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KafkaCustomConfigurationSpec. -func (in *KafkaCustomConfigurationSpec) DeepCopy() *KafkaCustomConfigurationSpec { - if in == nil { - return nil - } - out := new(KafkaCustomConfigurationSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *KafkaHorizontalScalingSpec) DeepCopyInto(out *KafkaHorizontalScalingSpec) { *out = *in @@ -2519,7 +2379,7 @@ func (in *KafkaOpsRequestSpec) DeepCopyInto(out *KafkaOpsRequestSpec) { } if in.Configuration != nil { in, out := &in.Configuration, &out.Configuration - *out = new(KafkaCustomConfigurationSpec) + *out = new(ReconfigurationSpec) (*in).DeepCopyInto(*out) } if in.TLS != nil { @@ -2649,34 +2509,6 @@ func (in *KafkaVolumeExpansionSpec) DeepCopy() *KafkaVolumeExpansionSpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MSSQLServerCustomConfigurationSpec) DeepCopyInto(out *MSSQLServerCustomConfigurationSpec) { - *out = *in - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(v1.LocalObjectReference) - **out = **in - } - if in.ApplyConfig != nil { - in, out := &in.ApplyConfig, &out.ApplyConfig - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MSSQLServerCustomConfigurationSpec. -func (in *MSSQLServerCustomConfigurationSpec) DeepCopy() *MSSQLServerCustomConfigurationSpec { - if in == nil { - return nil - } - out := new(MSSQLServerCustomConfigurationSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MSSQLServerHorizontalScalingSpec) DeepCopyInto(out *MSSQLServerHorizontalScalingSpec) { *out = *in @@ -2785,7 +2617,7 @@ func (in *MSSQLServerOpsRequestSpec) DeepCopyInto(out *MSSQLServerOpsRequestSpec } if in.Configuration != nil { in, out := &in.Configuration, &out.Configuration - *out = new(MSSQLServerCustomConfigurationSpec) + *out = new(ReconfigurationSpec) (*in).DeepCopyInto(*out) } if in.TLS != nil { @@ -2950,34 +2782,6 @@ func (in *MariaDBCustomConfiguration) DeepCopy() *MariaDBCustomConfiguration { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MariaDBCustomConfigurationSpec) DeepCopyInto(out *MariaDBCustomConfigurationSpec) { - *out = *in - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(v1.LocalObjectReference) - **out = **in - } - if in.ApplyConfig != nil { - in, out := &in.ApplyConfig, &out.ApplyConfig - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MariaDBCustomConfigurationSpec. -func (in *MariaDBCustomConfigurationSpec) DeepCopy() *MariaDBCustomConfigurationSpec { - if in == nil { - return nil - } - out := new(MariaDBCustomConfigurationSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MariaDBHorizontalScalingSpec) DeepCopyInto(out *MariaDBHorizontalScalingSpec) { *out = *in @@ -3086,7 +2890,7 @@ func (in *MariaDBOpsRequestSpec) DeepCopyInto(out *MariaDBOpsRequestSpec) { } if in.Configuration != nil { in, out := &in.Configuration, &out.Configuration - *out = new(MariaDBCustomConfigurationSpec) + *out = new(ReconfigurationSpec) (*in).DeepCopyInto(*out) } if in.TLS != nil { @@ -3402,7 +3206,7 @@ func (in *MemcachedOpsRequestSpec) DeepCopyInto(out *MemcachedOpsRequestSpec) { } if in.Configuration != nil { in, out := &in.Configuration, &out.Configuration - *out = new(MemcachedCustomConfigurationSpec) + *out = new(ReconfigurationSpec) (*in).DeepCopyInto(*out) } if in.TLS != nil { @@ -3523,101 +3327,22 @@ func (in *MemcachedVolumeExpansionSpec) DeepCopy() *MemcachedVolumeExpansionSpec } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MongoDBCustomConfiguration) DeepCopyInto(out *MongoDBCustomConfiguration) { +func (in *MongoDBHorizontalScalingSpec) DeepCopyInto(out *MongoDBHorizontalScalingSpec) { *out = *in - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(v1.LocalObjectReference) + if in.Shard != nil { + in, out := &in.Shard, &out.Shard + *out = new(MongoDBShardNode) **out = **in } - if in.ApplyConfig != nil { - in, out := &in.ApplyConfig, &out.ApplyConfig - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } + if in.ConfigServer != nil { + in, out := &in.ConfigServer, &out.ConfigServer + *out = new(ConfigNode) + **out = **in } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MongoDBCustomConfiguration. -func (in *MongoDBCustomConfiguration) DeepCopy() *MongoDBCustomConfiguration { - if in == nil { - return nil - } - out := new(MongoDBCustomConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MongoDBCustomConfigurationSpec) DeepCopyInto(out *MongoDBCustomConfigurationSpec) { - *out = *in - if in.Standalone != nil { - in, out := &in.Standalone, &out.Standalone - *out = new(MongoDBCustomConfiguration) - (*in).DeepCopyInto(*out) - } - if in.ReplicaSet != nil { - in, out := &in.ReplicaSet, &out.ReplicaSet - *out = new(MongoDBCustomConfiguration) - (*in).DeepCopyInto(*out) - } - if in.Mongos != nil { - in, out := &in.Mongos, &out.Mongos - *out = new(MongoDBCustomConfiguration) - (*in).DeepCopyInto(*out) - } - if in.ConfigServer != nil { - in, out := &in.ConfigServer, &out.ConfigServer - *out = new(MongoDBCustomConfiguration) - (*in).DeepCopyInto(*out) - } - if in.Shard != nil { - in, out := &in.Shard, &out.Shard - *out = new(MongoDBCustomConfiguration) - (*in).DeepCopyInto(*out) - } - if in.Arbiter != nil { - in, out := &in.Arbiter, &out.Arbiter - *out = new(MongoDBCustomConfiguration) - (*in).DeepCopyInto(*out) - } - if in.Hidden != nil { - in, out := &in.Hidden, &out.Hidden - *out = new(MongoDBCustomConfiguration) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MongoDBCustomConfigurationSpec. -func (in *MongoDBCustomConfigurationSpec) DeepCopy() *MongoDBCustomConfigurationSpec { - if in == nil { - return nil - } - out := new(MongoDBCustomConfigurationSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MongoDBHorizontalScalingSpec) DeepCopyInto(out *MongoDBHorizontalScalingSpec) { - *out = *in - if in.Shard != nil { - in, out := &in.Shard, &out.Shard - *out = new(MongoDBShardNode) - **out = **in - } - if in.ConfigServer != nil { - in, out := &in.ConfigServer, &out.ConfigServer - *out = new(ConfigNode) - **out = **in - } - if in.Mongos != nil { - in, out := &in.Mongos, &out.Mongos - *out = new(MongosNode) - **out = **in + if in.Mongos != nil { + in, out := &in.Mongos, &out.Mongos + *out = new(MongosNode) + **out = **in } if in.Hidden != nil { in, out := &in.Hidden, &out.Hidden @@ -3729,7 +3454,7 @@ func (in *MongoDBOpsRequestSpec) DeepCopyInto(out *MongoDBOpsRequestSpec) { } if in.Configuration != nil { in, out := &in.Configuration, &out.Configuration - *out = new(MongoDBCustomConfigurationSpec) + *out = new(MongoDBReconfigurationSpec) (*in).DeepCopyInto(*out) } if in.TLS != nil { @@ -3785,6 +3510,57 @@ func (in *MongoDBOpsRequestSpec) DeepCopy() *MongoDBOpsRequestSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MongoDBReconfigurationSpec) DeepCopyInto(out *MongoDBReconfigurationSpec) { + *out = *in + if in.Standalone != nil { + in, out := &in.Standalone, &out.Standalone + *out = new(ReconfigurationSpec) + (*in).DeepCopyInto(*out) + } + if in.ReplicaSet != nil { + in, out := &in.ReplicaSet, &out.ReplicaSet + *out = new(ReconfigurationSpec) + (*in).DeepCopyInto(*out) + } + if in.Mongos != nil { + in, out := &in.Mongos, &out.Mongos + *out = new(ReconfigurationSpec) + (*in).DeepCopyInto(*out) + } + if in.ConfigServer != nil { + in, out := &in.ConfigServer, &out.ConfigServer + *out = new(ReconfigurationSpec) + (*in).DeepCopyInto(*out) + } + if in.Shard != nil { + in, out := &in.Shard, &out.Shard + *out = new(ReconfigurationSpec) + (*in).DeepCopyInto(*out) + } + if in.Arbiter != nil { + in, out := &in.Arbiter, &out.Arbiter + *out = new(ReconfigurationSpec) + (*in).DeepCopyInto(*out) + } + if in.Hidden != nil { + in, out := &in.Hidden, &out.Hidden + *out = new(ReconfigurationSpec) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MongoDBReconfigurationSpec. +func (in *MongoDBReconfigurationSpec) DeepCopy() *MongoDBReconfigurationSpec { + if in == nil { + return nil + } + out := new(MongoDBReconfigurationSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MongoDBReplicaReadinessCriteria) DeepCopyInto(out *MongoDBReplicaReadinessCriteria) { *out = *in @@ -3951,34 +3727,6 @@ func (in *MongosNode) DeepCopy() *MongosNode { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MySQLCustomConfigurationSpec) DeepCopyInto(out *MySQLCustomConfigurationSpec) { - *out = *in - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(v1.LocalObjectReference) - **out = **in - } - if in.ApplyConfig != nil { - in, out := &in.ApplyConfig, &out.ApplyConfig - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MySQLCustomConfigurationSpec. -func (in *MySQLCustomConfigurationSpec) DeepCopy() *MySQLCustomConfigurationSpec { - if in == nil { - return nil - } - out := new(MySQLCustomConfigurationSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MySQLHorizontalScalingSpec) DeepCopyInto(out *MySQLHorizontalScalingSpec) { *out = *in @@ -4108,7 +3856,7 @@ func (in *MySQLOpsRequestSpec) DeepCopyInto(out *MySQLOpsRequestSpec) { } if in.Configuration != nil { in, out := &in.Configuration, &out.Configuration - *out = new(MySQLCustomConfigurationSpec) + *out = new(ReconfigurationSpec) (*in).DeepCopyInto(*out) } if in.TLS != nil { @@ -4506,7 +4254,7 @@ func (in *PerconaXtraDBOpsRequestSpec) DeepCopyInto(out *PerconaXtraDBOpsRequest } if in.Configuration != nil { in, out := &in.Configuration, &out.Configuration - *out = new(PerconaXtraDBCustomConfigurationSpec) + *out = new(ReconfigurationSpec) (*in).DeepCopyInto(*out) } if in.TLS != nil { @@ -4648,55 +4396,6 @@ func (in *PerconaXtraDBVolumeExpansionSpec) DeepCopy() *PerconaXtraDBVolumeExpan return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PgBouncerCustomConfiguration) DeepCopyInto(out *PgBouncerCustomConfiguration) { - *out = *in - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(v1.LocalObjectReference) - **out = **in - } - if in.ApplyConfig != nil { - in, out := &in.ApplyConfig, &out.ApplyConfig - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PgBouncerCustomConfiguration. -func (in *PgBouncerCustomConfiguration) DeepCopy() *PgBouncerCustomConfiguration { - if in == nil { - return nil - } - out := new(PgBouncerCustomConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PgBouncerCustomConfigurationSpec) DeepCopyInto(out *PgBouncerCustomConfigurationSpec) { - *out = *in - if in.PgBouncer != nil { - in, out := &in.PgBouncer, &out.PgBouncer - *out = new(PgBouncerCustomConfiguration) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PgBouncerCustomConfigurationSpec. -func (in *PgBouncerCustomConfigurationSpec) DeepCopy() *PgBouncerCustomConfigurationSpec { - if in == nil { - return nil - } - out := new(PgBouncerCustomConfigurationSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PgBouncerHorizontalScalingSpec) DeepCopyInto(out *PgBouncerHorizontalScalingSpec) { *out = *in @@ -4800,7 +4499,7 @@ func (in *PgBouncerOpsRequestSpec) DeepCopyInto(out *PgBouncerOpsRequestSpec) { } if in.Configuration != nil { in, out := &in.Configuration, &out.Configuration - *out = new(PgBouncerCustomConfigurationSpec) + *out = new(ReconfigurationSpec) (*in).DeepCopyInto(*out) } if in.TLS != nil { @@ -4895,34 +4594,6 @@ func (in *PgBouncerVerticalScalingSpec) DeepCopy() *PgBouncerVerticalScalingSpec return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PgpoolCustomConfigurationSpec) DeepCopyInto(out *PgpoolCustomConfigurationSpec) { - *out = *in - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(v1.LocalObjectReference) - **out = **in - } - if in.ApplyConfig != nil { - in, out := &in.ApplyConfig, &out.ApplyConfig - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PgpoolCustomConfigurationSpec. -func (in *PgpoolCustomConfigurationSpec) DeepCopy() *PgpoolCustomConfigurationSpec { - if in == nil { - return nil - } - out := new(PgpoolCustomConfigurationSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PgpoolHorizontalScalingSpec) DeepCopyInto(out *PgpoolHorizontalScalingSpec) { *out = *in @@ -5026,7 +4697,7 @@ func (in *PgpoolOpsRequestSpec) DeepCopyInto(out *PgpoolOpsRequestSpec) { } if in.Configuration != nil { in, out := &in.Configuration, &out.Configuration - *out = new(PgpoolCustomConfigurationSpec) + *out = new(ReconfigurationSpec) (*in).DeepCopyInto(*out) } if in.TLS != nil { @@ -5169,18 +4840,12 @@ func (in *PostgresCustomConfiguration) DeepCopy() *PostgresCustomConfiguration { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PostgresCustomConfigurationSpec) DeepCopyInto(out *PostgresCustomConfigurationSpec) { *out = *in - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(v1.LocalObjectReference) - **out = **in - } - if in.ApplyConfig != nil { - in, out := &in.ApplyConfig, &out.ApplyConfig - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } + if in.Tuning != nil { + in, out := &in.Tuning, &out.Tuning + *out = new(PostgresTuningConfig) + (*in).DeepCopyInto(*out) } + in.ReconfigurationSpec.DeepCopyInto(&out.ReconfigurationSpec) return } @@ -5471,6 +5136,37 @@ func (in *PostgresTLSSpec) DeepCopy() *PostgresTLSSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PostgresTuningConfig) DeepCopyInto(out *PostgresTuningConfig) { + *out = *in + if in.Profile != nil { + in, out := &in.Profile, &out.Profile + *out = new(PostgresProfile) + **out = **in + } + if in.MaxConnections != nil { + in, out := &in.MaxConnections, &out.MaxConnections + *out = new(int32) + **out = **in + } + if in.StorageType != nil { + in, out := &in.StorageType, &out.StorageType + *out = new(PostgresStorageType) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgresTuningConfig. +func (in *PostgresTuningConfig) DeepCopy() *PostgresTuningConfig { + if in == nil { + return nil + } + out := new(PostgresTuningConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PostgresUpdateVersionSpec) DeepCopyInto(out *PostgresUpdateVersionSpec) { *out = *in @@ -5577,42 +5273,6 @@ func (in *ProxySQLCustomConfiguration) DeepCopy() *ProxySQLCustomConfiguration { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProxySQLCustomConfigurationSpec) DeepCopyInto(out *ProxySQLCustomConfigurationSpec) { - *out = *in - if in.MySQLUsers != nil { - in, out := &in.MySQLUsers, &out.MySQLUsers - *out = new(MySQLUsers) - (*in).DeepCopyInto(*out) - } - if in.MySQLQueryRules != nil { - in, out := &in.MySQLQueryRules, &out.MySQLQueryRules - *out = new(MySQLQueryRules) - (*in).DeepCopyInto(*out) - } - if in.AdminVariables != nil { - in, out := &in.AdminVariables, &out.AdminVariables - *out = new(runtime.RawExtension) - (*in).DeepCopyInto(*out) - } - if in.MySQLVariables != nil { - in, out := &in.MySQLVariables, &out.MySQLVariables - *out = new(runtime.RawExtension) - (*in).DeepCopyInto(*out) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxySQLCustomConfigurationSpec. -func (in *ProxySQLCustomConfigurationSpec) DeepCopy() *ProxySQLCustomConfigurationSpec { - if in == nil { - return nil - } - out := new(ProxySQLCustomConfigurationSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ProxySQLHorizontalScalingSpec) DeepCopyInto(out *ProxySQLHorizontalScalingSpec) { *out = *in @@ -5716,7 +5376,7 @@ func (in *ProxySQLOpsRequestSpec) DeepCopyInto(out *ProxySQLOpsRequestSpec) { } if in.Configuration != nil { in, out := &in.Configuration, &out.Configuration - *out = new(ProxySQLCustomConfigurationSpec) + *out = new(ProxySQLReconfigurationSpec) (*in).DeepCopyInto(*out) } if in.TLS != nil { @@ -5752,6 +5412,42 @@ func (in *ProxySQLOpsRequestSpec) DeepCopy() *ProxySQLOpsRequestSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProxySQLReconfigurationSpec) DeepCopyInto(out *ProxySQLReconfigurationSpec) { + *out = *in + if in.MySQLUsers != nil { + in, out := &in.MySQLUsers, &out.MySQLUsers + *out = new(MySQLUsers) + (*in).DeepCopyInto(*out) + } + if in.MySQLQueryRules != nil { + in, out := &in.MySQLQueryRules, &out.MySQLQueryRules + *out = new(MySQLQueryRules) + (*in).DeepCopyInto(*out) + } + if in.AdminVariables != nil { + in, out := &in.AdminVariables, &out.AdminVariables + *out = new(runtime.RawExtension) + (*in).DeepCopyInto(*out) + } + if in.MySQLVariables != nil { + in, out := &in.MySQLVariables, &out.MySQLVariables + *out = new(runtime.RawExtension) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxySQLReconfigurationSpec. +func (in *ProxySQLReconfigurationSpec) DeepCopy() *ProxySQLReconfigurationSpec { + if in == nil { + return nil + } + out := new(ProxySQLReconfigurationSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ProxySQLReplicaReadinessCriteria) DeepCopyInto(out *ProxySQLReplicaReadinessCriteria) { *out = *in @@ -5811,29 +5507,83 @@ func (in *ProxySQLVerticalScalingSpec) DeepCopy() *ProxySQLVerticalScalingSpec { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RabbitMQCustomConfigurationSpec) DeepCopyInto(out *RabbitMQCustomConfigurationSpec) { +func (in *QdrantOpsRequest) DeepCopyInto(out *QdrantOpsRequest) { *out = *in - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(v1.LocalObjectReference) - **out = **in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QdrantOpsRequest. +func (in *QdrantOpsRequest) DeepCopy() *QdrantOpsRequest { + if in == nil { + return nil } - if in.ApplyConfig != nil { - in, out := &in.ApplyConfig, &out.ApplyConfig - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val + out := new(QdrantOpsRequest) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *QdrantOpsRequest) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QdrantOpsRequestList) DeepCopyInto(out *QdrantOpsRequestList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]QdrantOpsRequest, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) } } return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RabbitMQCustomConfigurationSpec. -func (in *RabbitMQCustomConfigurationSpec) DeepCopy() *RabbitMQCustomConfigurationSpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QdrantOpsRequestList. +func (in *QdrantOpsRequestList) DeepCopy() *QdrantOpsRequestList { if in == nil { return nil } - out := new(RabbitMQCustomConfigurationSpec) + out := new(QdrantOpsRequestList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *QdrantOpsRequestList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *QdrantOpsRequestSpec) DeepCopyInto(out *QdrantOpsRequestSpec) { + *out = *in + if in.TLS != nil { + in, out := &in.TLS, &out.TLS + *out = new(TLSSpec) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QdrantOpsRequestSpec. +func (in *QdrantOpsRequestSpec) DeepCopy() *QdrantOpsRequestSpec { + if in == nil { + return nil + } + out := new(QdrantOpsRequestSpec) in.DeepCopyInto(out) return out } @@ -5946,7 +5696,7 @@ func (in *RabbitMQOpsRequestSpec) DeepCopyInto(out *RabbitMQOpsRequestSpec) { } if in.Configuration != nil { in, out := &in.Configuration, &out.Configuration - *out = new(RabbitMQCustomConfigurationSpec) + *out = new(ReconfigurationSpec) (*in).DeepCopyInto(*out) } if in.TLS != nil { @@ -6056,6 +5806,34 @@ func (in *RabbitMQVolumeExpansionSpec) DeepCopy() *RabbitMQVolumeExpansionSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ReconfigurationSpec) DeepCopyInto(out *ReconfigurationSpec) { + *out = *in + if in.ConfigSecret != nil { + in, out := &in.ConfigSecret, &out.ConfigSecret + *out = new(v1.LocalObjectReference) + **out = **in + } + if in.ApplyConfig != nil { + in, out := &in.ApplyConfig, &out.ApplyConfig + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReconfigurationSpec. +func (in *ReconfigurationSpec) DeepCopy() *ReconfigurationSpec { + if in == nil { + return nil + } + out := new(ReconfigurationSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RedisAclSpec) DeepCopyInto(out *RedisAclSpec) { *out = *in @@ -6090,18 +5868,7 @@ func (in *RedisAclSpec) DeepCopy() *RedisAclSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RedisCustomConfigurationSpec) DeepCopyInto(out *RedisCustomConfigurationSpec) { *out = *in - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(v1.LocalObjectReference) - **out = **in - } - if in.ApplyConfig != nil { - in, out := &in.ApplyConfig, &out.ApplyConfig - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } + in.ReconfigurationSpec.DeepCopyInto(&out.ReconfigurationSpec) if in.Auth != nil { in, out := &in.Auth, &out.Auth *out = new(RedisAclSpec) @@ -6773,17 +6540,17 @@ func (in *SinglestoreCustomConfigurationSpec) DeepCopyInto(out *SinglestoreCusto *out = *in if in.Node != nil { in, out := &in.Node, &out.Node - *out = new(SinglestoreCustomConfiguration) + *out = new(ReconfigurationSpec) (*in).DeepCopyInto(*out) } if in.Aggregator != nil { in, out := &in.Aggregator, &out.Aggregator - *out = new(SinglestoreCustomConfiguration) + *out = new(ReconfigurationSpec) (*in).DeepCopyInto(*out) } if in.Leaf != nil { in, out := &in.Leaf, &out.Leaf - *out = new(SinglestoreCustomConfiguration) + *out = new(ReconfigurationSpec) (*in).DeepCopyInto(*out) } return @@ -7031,34 +6798,6 @@ func (in *SinglestoreVolumeExpansionSpec) DeepCopy() *SinglestoreVolumeExpansion return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SolrCustomConfigurationSpec) DeepCopyInto(out *SolrCustomConfigurationSpec) { - *out = *in - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(v1.LocalObjectReference) - **out = **in - } - if in.ApplyConfig != nil { - in, out := &in.ApplyConfig, &out.ApplyConfig - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SolrCustomConfigurationSpec. -func (in *SolrCustomConfigurationSpec) DeepCopy() *SolrCustomConfigurationSpec { - if in == nil { - return nil - } - out := new(SolrCustomConfigurationSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SolrHorizontalScalingSpec) DeepCopyInto(out *SolrHorizontalScalingSpec) { *out = *in @@ -7187,7 +6926,7 @@ func (in *SolrOpsRequestSpec) DeepCopyInto(out *SolrOpsRequestSpec) { } if in.Configuration != nil { in, out := &in.Configuration, &out.Configuration - *out = new(SolrCustomConfigurationSpec) + *out = new(ReconfigurationSpec) (*in).DeepCopyInto(*out) } if in.TLS != nil { @@ -7339,34 +7078,6 @@ func (in *Topology) DeepCopy() *Topology { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ZooKeeperCustomConfigurationSpec) DeepCopyInto(out *ZooKeeperCustomConfigurationSpec) { - *out = *in - if in.ConfigSecret != nil { - in, out := &in.ConfigSecret, &out.ConfigSecret - *out = new(v1.LocalObjectReference) - **out = **in - } - if in.ApplyConfig != nil { - in, out := &in.ApplyConfig, &out.ApplyConfig - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ZooKeeperCustomConfigurationSpec. -func (in *ZooKeeperCustomConfigurationSpec) DeepCopy() *ZooKeeperCustomConfigurationSpec { - if in == nil { - return nil - } - out := new(ZooKeeperCustomConfigurationSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ZooKeeperHorizontalScalingSpec) DeepCopyInto(out *ZooKeeperHorizontalScalingSpec) { *out = *in @@ -7475,7 +7186,7 @@ func (in *ZooKeeperOpsRequestSpec) DeepCopyInto(out *ZooKeeperOpsRequestSpec) { } if in.Configuration != nil { in, out := &in.Configuration, &out.Configuration - *out = new(ZooKeeperCustomConfigurationSpec) + *out = new(ReconfigurationSpec) (*in).DeepCopyInto(*out) } if in.Authentication != nil { diff --git a/vendor/kubedb.dev/apimachinery/client/clientset/versioned/typed/ops/v1alpha1/generated_expansion.go b/vendor/kubedb.dev/apimachinery/client/clientset/versioned/typed/ops/v1alpha1/generated_expansion.go index a4745abe2..3f28b559d 100644 --- a/vendor/kubedb.dev/apimachinery/client/clientset/versioned/typed/ops/v1alpha1/generated_expansion.go +++ b/vendor/kubedb.dev/apimachinery/client/clientset/versioned/typed/ops/v1alpha1/generated_expansion.go @@ -56,6 +56,8 @@ type PostgresOpsRequestExpansion interface{} type ProxySQLOpsRequestExpansion interface{} +type QdrantOpsRequestExpansion interface{} + type RabbitMQOpsRequestExpansion interface{} type RedisOpsRequestExpansion interface{} diff --git a/vendor/kubedb.dev/apimachinery/client/clientset/versioned/typed/ops/v1alpha1/ops_client.go b/vendor/kubedb.dev/apimachinery/client/clientset/versioned/typed/ops/v1alpha1/ops_client.go index e95dc432f..308e6d90c 100644 --- a/vendor/kubedb.dev/apimachinery/client/clientset/versioned/typed/ops/v1alpha1/ops_client.go +++ b/vendor/kubedb.dev/apimachinery/client/clientset/versioned/typed/ops/v1alpha1/ops_client.go @@ -48,6 +48,7 @@ type OpsV1alpha1Interface interface { PgpoolOpsRequestsGetter PostgresOpsRequestsGetter ProxySQLOpsRequestsGetter + QdrantOpsRequestsGetter RabbitMQOpsRequestsGetter RedisOpsRequestsGetter RedisSentinelOpsRequestsGetter @@ -137,6 +138,10 @@ func (c *OpsV1alpha1Client) ProxySQLOpsRequests(namespace string) ProxySQLOpsReq return newProxySQLOpsRequests(c, namespace) } +func (c *OpsV1alpha1Client) QdrantOpsRequests(namespace string) QdrantOpsRequestInterface { + return newQdrantOpsRequests(c, namespace) +} + func (c *OpsV1alpha1Client) RabbitMQOpsRequests(namespace string) RabbitMQOpsRequestInterface { return newRabbitMQOpsRequests(c, namespace) } diff --git a/vendor/kubedb.dev/apimachinery/client/clientset/versioned/typed/ops/v1alpha1/qdrantopsrequest.go b/vendor/kubedb.dev/apimachinery/client/clientset/versioned/typed/ops/v1alpha1/qdrantopsrequest.go new file mode 100644 index 000000000..a48be3a3e --- /dev/null +++ b/vendor/kubedb.dev/apimachinery/client/clientset/versioned/typed/ops/v1alpha1/qdrantopsrequest.go @@ -0,0 +1,196 @@ +/* +Copyright AppsCode Inc. and Contributors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + "time" + + v1alpha1 "kubedb.dev/apimachinery/apis/ops/v1alpha1" + scheme "kubedb.dev/apimachinery/client/clientset/versioned/scheme" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// QdrantOpsRequestsGetter has a method to return a QdrantOpsRequestInterface. +// A group's client should implement this interface. +type QdrantOpsRequestsGetter interface { + QdrantOpsRequests(namespace string) QdrantOpsRequestInterface +} + +// QdrantOpsRequestInterface has methods to work with QdrantOpsRequest resources. +type QdrantOpsRequestInterface interface { + Create(ctx context.Context, qdrantOpsRequest *v1alpha1.QdrantOpsRequest, opts v1.CreateOptions) (*v1alpha1.QdrantOpsRequest, error) + Update(ctx context.Context, qdrantOpsRequest *v1alpha1.QdrantOpsRequest, opts v1.UpdateOptions) (*v1alpha1.QdrantOpsRequest, error) + UpdateStatus(ctx context.Context, qdrantOpsRequest *v1alpha1.QdrantOpsRequest, opts v1.UpdateOptions) (*v1alpha1.QdrantOpsRequest, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.QdrantOpsRequest, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.QdrantOpsRequestList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.QdrantOpsRequest, err error) + QdrantOpsRequestExpansion +} + +// qdrantOpsRequests implements QdrantOpsRequestInterface +type qdrantOpsRequests struct { + client rest.Interface + ns string +} + +// newQdrantOpsRequests returns a QdrantOpsRequests +func newQdrantOpsRequests(c *OpsV1alpha1Client, namespace string) *qdrantOpsRequests { + return &qdrantOpsRequests{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the qdrantOpsRequest, and returns the corresponding qdrantOpsRequest object, and an error if there is any. +func (c *qdrantOpsRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.QdrantOpsRequest, err error) { + result = &v1alpha1.QdrantOpsRequest{} + err = c.client.Get(). + Namespace(c.ns). + Resource("qdrantopsrequests"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of QdrantOpsRequests that match those selectors. +func (c *qdrantOpsRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.QdrantOpsRequestList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.QdrantOpsRequestList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("qdrantopsrequests"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested qdrantOpsRequests. +func (c *qdrantOpsRequests) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("qdrantopsrequests"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a qdrantOpsRequest and creates it. Returns the server's representation of the qdrantOpsRequest, and an error, if there is any. +func (c *qdrantOpsRequests) Create(ctx context.Context, qdrantOpsRequest *v1alpha1.QdrantOpsRequest, opts v1.CreateOptions) (result *v1alpha1.QdrantOpsRequest, err error) { + result = &v1alpha1.QdrantOpsRequest{} + err = c.client.Post(). + Namespace(c.ns). + Resource("qdrantopsrequests"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(qdrantOpsRequest). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a qdrantOpsRequest and updates it. Returns the server's representation of the qdrantOpsRequest, and an error, if there is any. +func (c *qdrantOpsRequests) Update(ctx context.Context, qdrantOpsRequest *v1alpha1.QdrantOpsRequest, opts v1.UpdateOptions) (result *v1alpha1.QdrantOpsRequest, err error) { + result = &v1alpha1.QdrantOpsRequest{} + err = c.client.Put(). + Namespace(c.ns). + Resource("qdrantopsrequests"). + Name(qdrantOpsRequest.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(qdrantOpsRequest). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *qdrantOpsRequests) UpdateStatus(ctx context.Context, qdrantOpsRequest *v1alpha1.QdrantOpsRequest, opts v1.UpdateOptions) (result *v1alpha1.QdrantOpsRequest, err error) { + result = &v1alpha1.QdrantOpsRequest{} + err = c.client.Put(). + Namespace(c.ns). + Resource("qdrantopsrequests"). + Name(qdrantOpsRequest.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(qdrantOpsRequest). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the qdrantOpsRequest and deletes it. Returns an error if one occurs. +func (c *qdrantOpsRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("qdrantopsrequests"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *qdrantOpsRequests) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("qdrantopsrequests"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched qdrantOpsRequest. +func (c *qdrantOpsRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.QdrantOpsRequest, err error) { + result = &v1alpha1.QdrantOpsRequest{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("qdrantopsrequests"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_druids.yaml b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_druids.yaml index 4c98f9908..a07d9184e 100644 --- a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_druids.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_druids.yaml @@ -55,13 +55,15 @@ spec: disabled: type: boolean type: object - configSecret: + configuration: properties: - name: - default: "" + inline: + additionalProperties: + type: string + type: object + secretName: type: string type: object - x-kubernetes-map-type: atomic deepStorage: properties: configSecret: diff --git a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_elasticsearches.yaml b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_elasticsearches.yaml index 67fac406f..30d87ce51 100644 --- a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_elasticsearches.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_elasticsearches.yaml @@ -62,6 +62,15 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object deletionPolicy: enum: - Halt diff --git a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_kafkas.yaml b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_kafkas.yaml index 92abfc647..9adcb6b37 100644 --- a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_kafkas.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_kafkas.yaml @@ -67,6 +67,15 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object cruiseControl: properties: brokerCapacity: @@ -76,30 +85,15 @@ spec: outBoundNetwork: type: string type: object - configSecret: + configuration: properties: - activeFrom: - format: date-time - type: string - apiGroup: - default: "" - type: string - externallyManaged: - type: boolean - kind: - default: Secret - type: string - name: - type: string - rotateAfter: - type: string - secretStoreName: + inline: + additionalProperties: + type: string + type: object + secretName: type: string - required: - - kind - - name type: object - x-kubernetes-map-type: atomic podTemplate: properties: controller: @@ -3339,39 +3333,6 @@ spec: replicas: format: int32 type: integer - resources: - properties: - claims: - items: - properties: - name: - type: string - request: - type: string - required: - - name - type: object - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object suffix: type: string type: object diff --git a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_mariadbs.yaml b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_mariadbs.yaml index 7b610aacb..5100e170b 100644 --- a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_mariadbs.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_mariadbs.yaml @@ -148,6 +148,15 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object deletionPolicy: enum: - Halt diff --git a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_memcacheds.yaml b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_memcacheds.yaml index f21b453c5..becb6dbfa 100644 --- a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_memcacheds.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_memcacheds.yaml @@ -57,6 +57,15 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object dataVolume: properties: awsElasticBlockStore: diff --git a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_mongodbs.yaml b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_mongodbs.yaml index 53bc3cd70..8681cc9e8 100644 --- a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_mongodbs.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_mongodbs.yaml @@ -106,6 +106,15 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object podTemplate: properties: controller: @@ -3402,6 +3411,15 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object deletionPolicy: enum: - Halt @@ -3453,6 +3471,15 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object podTemplate: properties: controller: @@ -11433,6 +11460,15 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object ephemeralStorage: properties: medium: @@ -14785,6 +14821,15 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object podTemplate: properties: controller: @@ -18038,6 +18083,15 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object ephemeralStorage: properties: medium: diff --git a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_mssqlservers.yaml b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_mssqlservers.yaml index 5f0b1ec67..cae46ad9c 100644 --- a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_mssqlservers.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_mssqlservers.yaml @@ -135,6 +135,15 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object deletionPolicy: enum: - Halt diff --git a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_mysqls.yaml b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_mysqls.yaml index ae9c6827c..4b808f571 100644 --- a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_mysqls.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_mysqls.yaml @@ -218,6 +218,15 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object deletionPolicy: enum: - Halt diff --git a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_perconaxtradbs.yaml b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_perconaxtradbs.yaml index 459176f21..de54fea77 100644 --- a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_perconaxtradbs.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_perconaxtradbs.yaml @@ -132,6 +132,15 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object deletionPolicy: enum: - Halt diff --git a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_pgbouncers.yaml b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_pgbouncers.yaml index b4102ff77..153904302 100644 --- a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_pgbouncers.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_pgbouncers.yaml @@ -62,6 +62,15 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object connectionPool: properties: authType: diff --git a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_pgpools.yaml b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_pgpools.yaml index 4bf612173..106587cab 100644 --- a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_pgpools.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_pgpools.yaml @@ -62,13 +62,15 @@ spec: - scram - cert type: string - configSecret: + configuration: properties: - name: - default: "" + inline: + additionalProperties: + type: string + type: object + secretName: type: string type: object - x-kubernetes-map-type: atomic deletionPolicy: enum: - Halt @@ -1181,12 +1183,6 @@ spec: waitForInitialRestore: type: boolean type: object - initConfig: - properties: - pgpoolConfig: - type: object - x-kubernetes-preserve-unknown-fields: true - type: object monitor: properties: agent: diff --git a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_postgreses.yaml b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_postgreses.yaml index fc91812e2..ae9f9233f 100644 --- a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_postgreses.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_postgreses.yaml @@ -211,6 +211,37 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + tuning: + properties: + disableAutoTune: + type: boolean + maxConnections: + format: int32 + type: integer + profile: + enum: + - web + - oltp + - dw + - mixed + - desktop + type: string + storageType: + enum: + - ssd + - hdd + - san + type: string + type: object + type: object deletionPolicy: enum: - Halt @@ -4848,7 +4879,7 @@ spec: type: integer replication: properties: - forceFailOverAcceptingDataLossAfter: + forceFailoverAcceptingDataLossAfter: type: string maxSlotWALKeepSize: format: int32 @@ -5147,40 +5178,6 @@ spec: type: object x-kubernetes-map-type: atomic type: object - tuning: - properties: - disableAutoTune: - type: boolean - maxConnections: - format: int32 - type: integer - resourcesOverride: - properties: - cpu: - format: int32 - type: integer - memory: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - storageType: - enum: - - ssd - - hdd - - san - type: string - tuningProfile: - enum: - - web - - oltp - - dw - - mixed - - desktop - type: string - type: object version: type: string required: diff --git a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_proxysqls.yaml b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_proxysqls.yaml index 254ec661b..cc5cb5bbe 100644 --- a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_proxysqls.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_proxysqls.yaml @@ -69,6 +69,63 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + init: + properties: + inline: + properties: + adminVariables: + type: object + x-kubernetes-preserve-unknown-fields: true + mysqlQueryRules: + items: + type: object + x-kubernetes-preserve-unknown-fields: true + type: array + x-kubernetes-preserve-unknown-fields: true + mysqlUsers: + items: + properties: + active: + type: integer + attributes: + type: string + backend: + type: integer + comment: + type: string + default_hostgroup: + type: integer + default_schema: + type: string + fast_forward: + type: integer + frontend: + type: integer + max_connections: + format: int32 + type: integer + schema_locked: + type: integer + transaction_persistent: + type: integer + use_ssl: + type: integer + username: + type: string + required: + - username + type: object + type: array + mysqlVariables: + type: object + x-kubernetes-preserve-unknown-fields: true + type: object + secretName: + type: string + type: object + type: object deletionPolicy: enum: - Halt diff --git a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_rabbitmqs.yaml b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_rabbitmqs.yaml index a2a310458..e87da6f01 100644 --- a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_rabbitmqs.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_rabbitmqs.yaml @@ -62,6 +62,15 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object deletionPolicy: enum: - Halt diff --git a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_redises.yaml b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_redises.yaml index 342a88f2b..d405a868a 100644 --- a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_redises.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_redises.yaml @@ -173,6 +173,29 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + acl: + properties: + rules: + items: + type: string + type: array + secretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + type: object + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object deletionPolicy: enum: - Halt diff --git a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_singlestores.yaml b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_singlestores.yaml index 89a0cf002..cb05e5c14 100644 --- a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_singlestores.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_singlestores.yaml @@ -55,13 +55,15 @@ spec: disabled: type: boolean type: object - configSecret: + configuration: properties: - name: - default: "" + inline: + additionalProperties: + type: string + type: object + secretName: type: string type: object - x-kubernetes-map-type: atomic deletionPolicy: enum: - Halt @@ -4926,13 +4928,15 @@ spec: properties: aggregator: properties: - configSecret: + configuration: properties: - name: - default: "" + inline: + additionalProperties: + type: string + type: object + secretName: type: string type: object - x-kubernetes-map-type: atomic podTemplate: properties: controller: @@ -8265,13 +8269,15 @@ spec: type: object leaf: properties: - configSecret: + configuration: properties: - name: - default: "" + inline: + additionalProperties: + type: string + type: object + secretName: type: string type: object - x-kubernetes-map-type: atomic podTemplate: properties: controller: diff --git a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_solrs.yaml b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_solrs.yaml index 8144e2e19..f70614ced 100644 --- a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_solrs.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_solrs.yaml @@ -64,13 +64,15 @@ spec: type: object clientAuthSSL: type: string - configSecret: + configuration: properties: - name: - default: "" + inline: + additionalProperties: + type: string + type: object + secretName: type: string type: object - x-kubernetes-map-type: atomic deletionPolicy: enum: - Halt diff --git a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_zookeepers.yaml b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_zookeepers.yaml index b5976d72c..c7767d072 100644 --- a/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_zookeepers.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/gitops.kubedb.com_zookeepers.yaml @@ -63,13 +63,15 @@ spec: default: 2182 format: int32 type: integer - configSecret: + configuration: properties: - name: - default: "" + inline: + additionalProperties: + type: string + type: object + secretName: type: string type: object - x-kubernetes-map-type: atomic deletionPolicy: enum: - Halt diff --git a/vendor/kubedb.dev/apimachinery/crds/kafka.kubedb.com_connectclusters.yaml b/vendor/kubedb.dev/apimachinery/crds/kafka.kubedb.com_connectclusters.yaml index 460d2af9f..0860469ba 100644 --- a/vendor/kubedb.dev/apimachinery/crds/kafka.kubedb.com_connectclusters.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/kafka.kubedb.com_connectclusters.yaml @@ -76,6 +76,15 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object connectorPlugins: items: type: string diff --git a/vendor/kubedb.dev/apimachinery/crds/kafka.kubedb.com_connectors.yaml b/vendor/kubedb.dev/apimachinery/crds/kafka.kubedb.com_connectors.yaml index 30b881662..fe1216b9b 100644 --- a/vendor/kubedb.dev/apimachinery/crds/kafka.kubedb.com_connectors.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/kafka.kubedb.com_connectors.yaml @@ -52,6 +52,15 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object connectClusterRef: properties: name: diff --git a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_cassandras.yaml b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_cassandras.yaml index a3b90f435..0a366d8bb 100644 --- a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_cassandras.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_cassandras.yaml @@ -77,13 +77,15 @@ spec: disabled: type: boolean type: object - configSecret: + configuration: properties: - name: - default: "" + inline: + additionalProperties: + type: string + type: object + secretName: type: string type: object - x-kubernetes-map-type: atomic deletionPolicy: enum: - Halt diff --git a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_clickhouses.yaml b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_clickhouses.yaml index 6fd16bd60..4230bd224 100644 --- a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_clickhouses.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_clickhouses.yaml @@ -6768,13 +6768,15 @@ spec: type: string type: object type: object - configSecret: + configuration: properties: - name: - default: "" + inline: + additionalProperties: + type: string + type: object + secretName: type: string type: object - x-kubernetes-map-type: atomic deletionPolicy: enum: - Halt diff --git a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_druids.yaml b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_druids.yaml index d82133f22..b69830f67 100644 --- a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_druids.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_druids.yaml @@ -77,13 +77,15 @@ spec: disabled: type: boolean type: object - configSecret: + configuration: properties: - name: - default: "" + inline: + additionalProperties: + type: string + type: object + secretName: type: string type: object - x-kubernetes-map-type: atomic deepStorage: properties: configSecret: diff --git a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_elasticsearches.yaml b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_elasticsearches.yaml index 70e206796..88ba993d0 100644 --- a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_elasticsearches.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_elasticsearches.yaml @@ -84,6 +84,15 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object deletionPolicy: enum: - Halt diff --git a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_hanadbs.yaml b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_hanadbs.yaml index b63ad21d5..f5d6ad354 100644 --- a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_hanadbs.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_hanadbs.yaml @@ -72,13 +72,15 @@ spec: - name type: object x-kubernetes-map-type: atomic - configSecret: + configuration: properties: - name: - default: "" + inline: + additionalProperties: + type: string + type: object + secretName: type: string type: object - x-kubernetes-map-type: atomic deletionPolicy: enum: - Halt diff --git a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_hazelcasts.yaml b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_hazelcasts.yaml index 583207ae8..324bed6df 100644 --- a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_hazelcasts.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_hazelcasts.yaml @@ -72,13 +72,15 @@ spec: disabled: type: boolean type: object - configSecret: + configuration: properties: - name: - default: "" + inline: + additionalProperties: + type: string + type: object + secretName: type: string type: object - x-kubernetes-map-type: atomic deletionPolicy: enum: - Halt diff --git a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_ignites.yaml b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_ignites.yaml index 5b9840122..cf5ec3300 100644 --- a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_ignites.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_ignites.yaml @@ -72,13 +72,15 @@ spec: disabled: type: boolean type: object - configSecret: + configuration: properties: - name: - default: "" + inline: + additionalProperties: + type: string + type: object + secretName: type: string type: object - x-kubernetes-map-type: atomic deletionPolicy: enum: - Halt diff --git a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_kafkas.yaml b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_kafkas.yaml index c9c9197f5..9361f54d8 100644 --- a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_kafkas.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_kafkas.yaml @@ -89,6 +89,15 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object cruiseControl: properties: brokerCapacity: @@ -98,30 +107,15 @@ spec: outBoundNetwork: type: string type: object - configSecret: + configuration: properties: - activeFrom: - format: date-time - type: string - apiGroup: - default: "" - type: string - externallyManaged: - type: boolean - kind: - default: Secret - type: string - name: - type: string - rotateAfter: - type: string - secretStoreName: + inline: + additionalProperties: + type: string + type: object + secretName: type: string - required: - - kind - - name type: object - x-kubernetes-map-type: atomic podTemplate: properties: controller: @@ -3361,39 +3355,6 @@ spec: replicas: format: int32 type: integer - resources: - properties: - claims: - items: - properties: - name: - type: string - request: - type: string - required: - - name - type: object - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map - limits: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - type: object suffix: type: string type: object @@ -13970,26 +13931,9 @@ spec: type: object configSecret: properties: - activeFrom: - format: date-time - type: string - apiGroup: - default: "" - type: string - externallyManaged: - type: boolean - kind: - default: Secret - type: string name: + default: "" type: string - rotateAfter: - type: string - secretStoreName: - type: string - required: - - kind - - name type: object x-kubernetes-map-type: atomic podTemplate: diff --git a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_mariadbs.yaml b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_mariadbs.yaml index 5ec033c54..745bcd576 100644 --- a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_mariadbs.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_mariadbs.yaml @@ -170,6 +170,15 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object deletionPolicy: enum: - Halt diff --git a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_memcacheds.yaml b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_memcacheds.yaml index 7f1f396ff..d4375ce79 100644 --- a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_memcacheds.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_memcacheds.yaml @@ -79,6 +79,15 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object dataVolume: properties: awsElasticBlockStore: diff --git a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_milvuses.yaml b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_milvuses.yaml index 621e6e9cf..7fa3a8ec5 100644 --- a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_milvuses.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_milvuses.yaml @@ -67,13 +67,15 @@ spec: - name type: object x-kubernetes-map-type: atomic - configSecret: + configuration: properties: - name: - default: "" + inline: + additionalProperties: + type: string + type: object + secretName: type: string type: object - x-kubernetes-map-type: atomic deletionPolicy: enum: - Halt diff --git a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_mongodbs.yaml b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_mongodbs.yaml index 51226840d..9d8072fc9 100644 --- a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_mongodbs.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_mongodbs.yaml @@ -128,6 +128,15 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object podTemplate: properties: controller: @@ -3424,6 +3433,15 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object deletionPolicy: enum: - Halt @@ -3475,6 +3493,15 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object podTemplate: properties: controller: @@ -11455,6 +11482,15 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object ephemeralStorage: properties: medium: @@ -14807,6 +14843,15 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object podTemplate: properties: controller: @@ -18060,6 +18105,15 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object ephemeralStorage: properties: medium: diff --git a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_mssqlservers.yaml b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_mssqlservers.yaml index be7d7e41a..07722ec2b 100644 --- a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_mssqlservers.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_mssqlservers.yaml @@ -157,6 +157,15 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object deletionPolicy: enum: - Halt diff --git a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_mysqls.yaml b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_mysqls.yaml index 65aa56f98..54a602eb4 100644 --- a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_mysqls.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_mysqls.yaml @@ -240,6 +240,15 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object deletionPolicy: enum: - Halt diff --git a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_neo4js.yaml b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_neo4js.yaml index e52128a5d..971c36d68 100644 --- a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_neo4js.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_neo4js.yaml @@ -67,13 +67,15 @@ spec: - name type: object x-kubernetes-map-type: atomic - configSecret: + configuration: properties: - name: - default: "" + inline: + additionalProperties: + type: string + type: object + secretName: type: string type: object - x-kubernetes-map-type: atomic deletionPolicy: enum: - Halt diff --git a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_oracles.yaml b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_oracles.yaml index ca1bdc0e7..764416f64 100644 --- a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_oracles.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_oracles.yaml @@ -74,13 +74,15 @@ spec: disabled: type: boolean type: object - configSecret: + configuration: properties: - name: - default: "" + inline: + additionalProperties: + type: string + type: object + secretName: type: string type: object - x-kubernetes-map-type: atomic dataGuard: properties: applyLagThreshold: diff --git a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_perconaxtradbs.yaml b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_perconaxtradbs.yaml index bb9337330..5703a5be2 100644 --- a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_perconaxtradbs.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_perconaxtradbs.yaml @@ -154,6 +154,15 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object deletionPolicy: enum: - Halt diff --git a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_pgbouncers.yaml b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_pgbouncers.yaml index b13758451..ccfc65afe 100644 --- a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_pgbouncers.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_pgbouncers.yaml @@ -84,6 +84,15 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object connectionPool: properties: authType: diff --git a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_pgpools.yaml b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_pgpools.yaml index c55b64630..046267617 100644 --- a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_pgpools.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_pgpools.yaml @@ -84,13 +84,15 @@ spec: - scram - cert type: string - configSecret: + configuration: properties: - name: - default: "" + inline: + additionalProperties: + type: string + type: object + secretName: type: string type: object - x-kubernetes-map-type: atomic deletionPolicy: enum: - Halt @@ -1203,12 +1205,6 @@ spec: waitForInitialRestore: type: boolean type: object - initConfig: - properties: - pgpoolConfig: - type: object - x-kubernetes-preserve-unknown-fields: true - type: object monitor: properties: agent: diff --git a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_postgreses.yaml b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_postgreses.yaml index 766ffe0c2..4a70f36e3 100644 --- a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_postgreses.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_postgreses.yaml @@ -233,6 +233,37 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + tuning: + properties: + disableAutoTune: + type: boolean + maxConnections: + format: int32 + type: integer + profile: + enum: + - web + - oltp + - dw + - mixed + - desktop + type: string + storageType: + enum: + - ssd + - hdd + - san + type: string + type: object + type: object deletionPolicy: enum: - Halt @@ -4870,7 +4901,7 @@ spec: type: integer replication: properties: - forceFailOverAcceptingDataLossAfter: + forceFailoverAcceptingDataLossAfter: type: string maxSlotWALKeepSize: format: int32 @@ -5169,40 +5200,6 @@ spec: type: object x-kubernetes-map-type: atomic type: object - tuning: - properties: - disableAutoTune: - type: boolean - maxConnections: - format: int32 - type: integer - resourcesOverride: - properties: - cpu: - format: int32 - type: integer - memory: - anyOf: - - type: integer - - type: string - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - type: object - storageType: - enum: - - ssd - - hdd - - san - type: string - tuningProfile: - enum: - - web - - oltp - - dw - - mixed - - desktop - type: string - type: object version: type: string required: @@ -9700,7 +9697,7 @@ spec: type: integer replication: properties: - forceFailOverAcceptingDataLossAfter: + forceFailoverAcceptingDataLossAfter: type: string maxSlotWALKeepSize: format: int32 diff --git a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_proxysqls.yaml b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_proxysqls.yaml index e96632616..5e5541e00 100644 --- a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_proxysqls.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_proxysqls.yaml @@ -91,6 +91,63 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + init: + properties: + inline: + properties: + adminVariables: + type: object + x-kubernetes-preserve-unknown-fields: true + mysqlQueryRules: + items: + type: object + x-kubernetes-preserve-unknown-fields: true + type: array + x-kubernetes-preserve-unknown-fields: true + mysqlUsers: + items: + properties: + active: + type: integer + attributes: + type: string + backend: + type: integer + comment: + type: string + default_hostgroup: + type: integer + default_schema: + type: string + fast_forward: + type: integer + frontend: + type: integer + max_connections: + format: int32 + type: integer + schema_locked: + type: integer + transaction_persistent: + type: integer + use_ssl: + type: integer + username: + type: string + required: + - username + type: object + type: array + mysqlVariables: + type: object + x-kubernetes-preserve-unknown-fields: true + type: object + secretName: + type: string + type: object + type: object deletionPolicy: enum: - Halt diff --git a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_qdrants.yaml b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_qdrants.yaml index 6ed26e2d9..dda03d43a 100644 --- a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_qdrants.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_qdrants.yaml @@ -67,13 +67,15 @@ spec: - name type: object x-kubernetes-map-type: atomic - configSecret: + configuration: properties: - name: - default: "" + inline: + additionalProperties: + type: string + type: object + secretName: type: string type: object - x-kubernetes-map-type: atomic deletionPolicy: enum: - Halt @@ -3515,6 +3517,111 @@ spec: - Durable - Ephemeral type: string + tls: + properties: + certificates: + items: + properties: + alias: + type: string + dnsNames: + items: + type: string + type: array + duration: + type: string + emailAddresses: + items: + type: string + type: array + ipAddresses: + items: + type: string + type: array + issuerRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + privateKey: + properties: + encoding: + enum: + - PKCS1 + - PKCS8 + type: string + type: object + renewBefore: + type: string + secretName: + type: string + subject: + properties: + countries: + items: + type: string + type: array + localities: + items: + type: string + type: array + organizationalUnits: + items: + type: string + type: array + organizations: + items: + type: string + type: array + postalCodes: + items: + type: string + type: array + provinces: + items: + type: string + type: array + serialNumber: + type: string + streetAddresses: + items: + type: string + type: array + type: object + uris: + items: + type: string + type: array + required: + - alias + type: object + type: array + client: + type: boolean + issuerRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + p2p: + type: boolean + type: object version: type: string required: diff --git a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_rabbitmqs.yaml b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_rabbitmqs.yaml index 00769d701..ed9eca056 100644 --- a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_rabbitmqs.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_rabbitmqs.yaml @@ -84,6 +84,15 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object deletionPolicy: enum: - Halt diff --git a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_redises.yaml b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_redises.yaml index 9b818c3a8..dc71f679c 100644 --- a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_redises.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_redises.yaml @@ -195,6 +195,29 @@ spec: type: string type: object x-kubernetes-map-type: atomic + configuration: + properties: + acl: + properties: + rules: + items: + type: string + type: array + secretRef: + properties: + name: + default: "" + type: string + type: object + x-kubernetes-map-type: atomic + type: object + inline: + additionalProperties: + type: string + type: object + secretName: + type: string + type: object deletionPolicy: enum: - Halt diff --git a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_singlestores.yaml b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_singlestores.yaml index 2bb0dec8e..626754c9f 100644 --- a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_singlestores.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_singlestores.yaml @@ -77,13 +77,15 @@ spec: disabled: type: boolean type: object - configSecret: + configuration: properties: - name: - default: "" + inline: + additionalProperties: + type: string + type: object + secretName: type: string type: object - x-kubernetes-map-type: atomic deletionPolicy: enum: - Halt @@ -4948,13 +4950,15 @@ spec: properties: aggregator: properties: - configSecret: + configuration: properties: - name: - default: "" + inline: + additionalProperties: + type: string + type: object + secretName: type: string type: object - x-kubernetes-map-type: atomic podTemplate: properties: controller: @@ -8287,13 +8291,15 @@ spec: type: object leaf: properties: - configSecret: + configuration: properties: - name: - default: "" + inline: + additionalProperties: + type: string + type: object + secretName: type: string type: object - x-kubernetes-map-type: atomic podTemplate: properties: controller: diff --git a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_solrs.yaml b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_solrs.yaml index 5106756ca..9588f29e3 100644 --- a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_solrs.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_solrs.yaml @@ -86,13 +86,15 @@ spec: type: object clientAuthSSL: type: string - configSecret: + configuration: properties: - name: - default: "" + inline: + additionalProperties: + type: string + type: object + secretName: type: string type: object - x-kubernetes-map-type: atomic deletionPolicy: enum: - Halt diff --git a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_weaviates.yaml b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_weaviates.yaml index 922d558ca..9bd67b93d 100644 --- a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_weaviates.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_weaviates.yaml @@ -70,13 +70,15 @@ spec: - name type: object x-kubernetes-map-type: atomic - configSecret: + configuration: properties: - name: - default: "" + inline: + additionalProperties: + type: string + type: object + secretName: type: string type: object - x-kubernetes-map-type: atomic deletionPolicy: enum: - Halt diff --git a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_zookeepers.yaml b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_zookeepers.yaml index 328e67f2a..cab787c02 100644 --- a/vendor/kubedb.dev/apimachinery/crds/kubedb.com_zookeepers.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/kubedb.com_zookeepers.yaml @@ -85,13 +85,15 @@ spec: default: 2182 format: int32 type: integer - configSecret: + configuration: properties: - name: - default: "" + inline: + additionalProperties: + type: string + type: object + secretName: type: string type: object - x-kubernetes-map-type: atomic deletionPolicy: enum: - Halt diff --git a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_cassandraopsrequests.yaml b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_cassandraopsrequests.yaml index 362e64ede..6cb7a0540 100644 --- a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_cassandraopsrequests.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_cassandraopsrequests.yaml @@ -81,6 +81,13 @@ spec: x-kubernetes-map-type: atomic removeCustomConfig: type: boolean + restart: + default: auto + enum: + - auto + - "true" + - "false" + type: string type: object databaseRef: properties: diff --git a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_clickhouseopsrequests.yaml b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_clickhouseopsrequests.yaml index 44dded3ba..374791d04 100644 --- a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_clickhouseopsrequests.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_clickhouseopsrequests.yaml @@ -81,6 +81,13 @@ spec: x-kubernetes-map-type: atomic removeCustomConfig: type: boolean + restart: + default: auto + enum: + - auto + - "true" + - "false" + type: string type: object databaseRef: properties: diff --git a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_druidopsrequests.yaml b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_druidopsrequests.yaml index ef5dd919a..2fabf4978 100644 --- a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_druidopsrequests.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_druidopsrequests.yaml @@ -81,6 +81,13 @@ spec: x-kubernetes-map-type: atomic removeCustomConfig: type: boolean + restart: + default: auto + enum: + - auto + - "true" + - "false" + type: string type: object databaseRef: properties: diff --git a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_elasticsearchopsrequests.yaml b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_elasticsearchopsrequests.yaml index 9973c4af2..a311c31e6 100644 --- a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_elasticsearchopsrequests.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_elasticsearchopsrequests.yaml @@ -83,6 +83,13 @@ spec: type: boolean removeSecureCustomConfig: type: boolean + restart: + default: auto + enum: + - auto + - "true" + - "false" + type: string secureConfigSecret: properties: name: diff --git a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_hazelcastopsrequests.yaml b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_hazelcastopsrequests.yaml index 9c87beb7a..cccbfae91 100644 --- a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_hazelcastopsrequests.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_hazelcastopsrequests.yaml @@ -81,6 +81,13 @@ spec: x-kubernetes-map-type: atomic removeCustomConfig: type: boolean + restart: + default: auto + enum: + - auto + - "true" + - "false" + type: string type: object databaseRef: properties: diff --git a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_igniteopsrequests.yaml b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_igniteopsrequests.yaml index 583be63b8..1cabedc6c 100644 --- a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_igniteopsrequests.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_igniteopsrequests.yaml @@ -81,6 +81,13 @@ spec: x-kubernetes-map-type: atomic removeCustomConfig: type: boolean + restart: + default: auto + enum: + - auto + - "true" + - "false" + type: string type: object databaseRef: properties: diff --git a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_kafkaopsrequests.yaml b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_kafkaopsrequests.yaml index 774e653dc..e5b7bbebc 100644 --- a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_kafkaopsrequests.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_kafkaopsrequests.yaml @@ -81,6 +81,13 @@ spec: x-kubernetes-map-type: atomic removeCustomConfig: type: boolean + restart: + default: auto + enum: + - auto + - "true" + - "false" + type: string type: object databaseRef: properties: diff --git a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_mariadbopsrequests.yaml b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_mariadbopsrequests.yaml index 1b4163217..ba3392fef 100644 --- a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_mariadbopsrequests.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_mariadbopsrequests.yaml @@ -81,6 +81,13 @@ spec: x-kubernetes-map-type: atomic removeCustomConfig: type: boolean + restart: + default: auto + enum: + - auto + - "true" + - "false" + type: string type: object databaseRef: properties: diff --git a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_memcachedopsrequests.yaml b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_memcachedopsrequests.yaml index fbacf3624..e149a35f5 100644 --- a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_memcachedopsrequests.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_memcachedopsrequests.yaml @@ -81,6 +81,13 @@ spec: x-kubernetes-map-type: atomic removeCustomConfig: type: boolean + restart: + default: auto + enum: + - auto + - "true" + - "false" + type: string type: object databaseRef: properties: diff --git a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_mongodbopsrequests.yaml b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_mongodbopsrequests.yaml index 85c483b34..dc53bda6e 100644 --- a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_mongodbopsrequests.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_mongodbopsrequests.yaml @@ -103,6 +103,13 @@ spec: x-kubernetes-map-type: atomic removeCustomConfig: type: boolean + restart: + default: auto + enum: + - auto + - "true" + - "false" + type: string type: object configServer: properties: @@ -119,6 +126,13 @@ spec: x-kubernetes-map-type: atomic removeCustomConfig: type: boolean + restart: + default: auto + enum: + - auto + - "true" + - "false" + type: string type: object hidden: properties: @@ -135,6 +149,13 @@ spec: x-kubernetes-map-type: atomic removeCustomConfig: type: boolean + restart: + default: auto + enum: + - auto + - "true" + - "false" + type: string type: object mongos: properties: @@ -151,6 +172,13 @@ spec: x-kubernetes-map-type: atomic removeCustomConfig: type: boolean + restart: + default: auto + enum: + - auto + - "true" + - "false" + type: string type: object replicaSet: properties: @@ -167,6 +195,13 @@ spec: x-kubernetes-map-type: atomic removeCustomConfig: type: boolean + restart: + default: auto + enum: + - auto + - "true" + - "false" + type: string type: object shard: properties: @@ -183,6 +218,13 @@ spec: x-kubernetes-map-type: atomic removeCustomConfig: type: boolean + restart: + default: auto + enum: + - auto + - "true" + - "false" + type: string type: object standalone: properties: @@ -199,6 +241,13 @@ spec: x-kubernetes-map-type: atomic removeCustomConfig: type: boolean + restart: + default: auto + enum: + - auto + - "true" + - "false" + type: string type: object type: object databaseRef: diff --git a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_mssqlserveropsrequests.yaml b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_mssqlserveropsrequests.yaml index dd495faef..f7db4165d 100644 --- a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_mssqlserveropsrequests.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_mssqlserveropsrequests.yaml @@ -81,6 +81,13 @@ spec: x-kubernetes-map-type: atomic removeCustomConfig: type: boolean + restart: + default: auto + enum: + - auto + - "true" + - "false" + type: string type: object databaseRef: properties: diff --git a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_mysqlopsrequests.yaml b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_mysqlopsrequests.yaml index cc7c31509..37259861b 100644 --- a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_mysqlopsrequests.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_mysqlopsrequests.yaml @@ -81,6 +81,13 @@ spec: x-kubernetes-map-type: atomic removeCustomConfig: type: boolean + restart: + default: auto + enum: + - auto + - "true" + - "false" + type: string type: object databaseRef: properties: diff --git a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_perconaxtradbopsrequests.yaml b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_perconaxtradbopsrequests.yaml index 393f7dda6..1aae3a8d9 100644 --- a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_perconaxtradbopsrequests.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_perconaxtradbopsrequests.yaml @@ -81,6 +81,13 @@ spec: x-kubernetes-map-type: atomic removeCustomConfig: type: boolean + restart: + default: auto + enum: + - auto + - "true" + - "false" + type: string type: object databaseRef: properties: diff --git a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_pgbounceropsrequests.yaml b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_pgbounceropsrequests.yaml index 291b3da6e..77f963cf8 100644 --- a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_pgbounceropsrequests.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_pgbounceropsrequests.yaml @@ -68,24 +68,26 @@ spec: type: object configuration: properties: - pgbouncer: + applyConfig: + additionalProperties: + type: string + type: object + configSecret: properties: - applyConfig: - additionalProperties: - type: string - type: object - configSecret: - properties: - name: - default: "" - type: string - type: object - x-kubernetes-map-type: atomic - removeCustomConfig: - type: boolean + name: + default: "" + type: string type: object - required: - - pgbouncer + x-kubernetes-map-type: atomic + removeCustomConfig: + type: boolean + restart: + default: auto + enum: + - auto + - "true" + - "false" + type: string type: object databaseRef: properties: diff --git a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_pgpoolopsrequests.yaml b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_pgpoolopsrequests.yaml index b7f089423..8fc13c4bd 100644 --- a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_pgpoolopsrequests.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_pgpoolopsrequests.yaml @@ -81,6 +81,13 @@ spec: x-kubernetes-map-type: atomic removeCustomConfig: type: boolean + restart: + default: auto + enum: + - auto + - "true" + - "false" + type: string type: object databaseRef: properties: diff --git a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_postgresopsrequests.yaml b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_postgresopsrequests.yaml index c652f6b64..a14db6a95 100644 --- a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_postgresopsrequests.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_postgresopsrequests.yaml @@ -81,6 +81,35 @@ spec: x-kubernetes-map-type: atomic removeCustomConfig: type: boolean + restart: + default: auto + enum: + - auto + - "true" + - "false" + type: string + tuning: + properties: + disableAutoTune: + type: boolean + maxConnections: + format: int32 + type: integer + profile: + enum: + - web + - oltp + - dw + - mixed + - desktop + type: string + storageType: + enum: + - ssd + - hdd + - san + type: string + type: object type: object databaseRef: properties: diff --git a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_qdrantopsrequests.yaml b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_qdrantopsrequests.yaml new file mode 100644 index 000000000..405051441 --- /dev/null +++ b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_qdrantopsrequests.yaml @@ -0,0 +1,212 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + labels: + app.kubernetes.io/name: kubedb + name: qdrantopsrequests.ops.kubedb.com +spec: + group: ops.kubedb.com + names: + categories: + - ops + - kubedb + - appscode + kind: QdrantOpsRequest + listKind: QdrantOpsRequestList + plural: qdrantopsrequests + shortNames: + - qdops + singular: qdrantopsrequest + scope: Namespaced + versions: + - additionalPrinterColumns: + - jsonPath: .spec.type + name: Type + type: string + - jsonPath: .status.phase + name: Status + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + properties: + apiVersion: + type: string + kind: + type: string + metadata: + type: object + spec: + properties: + tls: + properties: + certificates: + items: + properties: + alias: + type: string + dnsNames: + items: + type: string + type: array + duration: + type: string + emailAddresses: + items: + type: string + type: array + ipAddresses: + items: + type: string + type: array + issuerRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + privateKey: + properties: + encoding: + enum: + - PKCS1 + - PKCS8 + type: string + type: object + renewBefore: + type: string + secretName: + type: string + subject: + properties: + countries: + items: + type: string + type: array + localities: + items: + type: string + type: array + organizationalUnits: + items: + type: string + type: array + organizations: + items: + type: string + type: array + postalCodes: + items: + type: string + type: array + provinces: + items: + type: string + type: array + serialNumber: + type: string + streetAddresses: + items: + type: string + type: array + type: object + uris: + items: + type: string + type: array + required: + - alias + type: object + type: array + issuerRef: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + remove: + type: boolean + rotateCertificates: + type: boolean + type: object + type: object + status: + properties: + conditions: + items: + properties: + lastTransitionTime: + format: date-time + type: string + message: + type: string + observedGeneration: + format: int64 + type: integer + reason: + type: string + severity: + type: string + status: + type: string + type: + type: string + required: + - lastTransitionTime + - status + - type + type: object + type: array + observedGeneration: + format: int64 + type: integer + pausedBackups: + items: + properties: + apiGroup: + type: string + kind: + type: string + name: + type: string + namespace: + type: string + required: + - name + type: object + type: array + phase: + enum: + - Pending + - Progressing + - Successful + - WaitingForApproval + - Failed + - Approved + - Denied + - Skipped + type: string + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_rabbitmqopsrequests.yaml b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_rabbitmqopsrequests.yaml index d4d4567c7..14e16d951 100644 --- a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_rabbitmqopsrequests.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_rabbitmqopsrequests.yaml @@ -81,6 +81,13 @@ spec: x-kubernetes-map-type: atomic removeCustomConfig: type: boolean + restart: + default: auto + enum: + - auto + - "true" + - "false" + type: string type: object databaseRef: properties: diff --git a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_redisopsrequests.yaml b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_redisopsrequests.yaml index 593555de2..1c9b04c43 100644 --- a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_redisopsrequests.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_redisopsrequests.yaml @@ -117,6 +117,13 @@ spec: x-kubernetes-map-type: atomic removeCustomConfig: type: boolean + restart: + default: auto + enum: + - auto + - "true" + - "false" + type: string type: object databaseRef: properties: diff --git a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_singlestoreopsrequests.yaml b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_singlestoreopsrequests.yaml index 7cec20433..97747ba58 100644 --- a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_singlestoreopsrequests.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_singlestoreopsrequests.yaml @@ -83,6 +83,13 @@ spec: x-kubernetes-map-type: atomic removeCustomConfig: type: boolean + restart: + default: auto + enum: + - auto + - "true" + - "false" + type: string type: object leaf: properties: @@ -99,6 +106,13 @@ spec: x-kubernetes-map-type: atomic removeCustomConfig: type: boolean + restart: + default: auto + enum: + - auto + - "true" + - "false" + type: string type: object node: properties: @@ -115,6 +129,13 @@ spec: x-kubernetes-map-type: atomic removeCustomConfig: type: boolean + restart: + default: auto + enum: + - auto + - "true" + - "false" + type: string type: object type: object databaseRef: diff --git a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_solropsrequests.yaml b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_solropsrequests.yaml index 88cb27e3b..4c40a1e9b 100644 --- a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_solropsrequests.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_solropsrequests.yaml @@ -81,6 +81,13 @@ spec: x-kubernetes-map-type: atomic removeCustomConfig: type: boolean + restart: + default: auto + enum: + - auto + - "true" + - "false" + type: string type: object databaseRef: properties: diff --git a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_zookeeperopsrequests.yaml b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_zookeeperopsrequests.yaml index e501bd2b1..5ea19994a 100644 --- a/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_zookeeperopsrequests.yaml +++ b/vendor/kubedb.dev/apimachinery/crds/ops.kubedb.com_zookeeperopsrequests.yaml @@ -81,6 +81,13 @@ spec: x-kubernetes-map-type: atomic removeCustomConfig: type: boolean + restart: + default: auto + enum: + - auto + - "true" + - "false" + type: string type: object databaseRef: properties: diff --git a/vendor/kubedb.dev/apimachinery/pkg/factory/client.go b/vendor/kubedb.dev/apimachinery/pkg/factory/client.go index f2cb06302..0e69d0b2f 100644 --- a/vendor/kubedb.dev/apimachinery/pkg/factory/client.go +++ b/vendor/kubedb.dev/apimachinery/pkg/factory/client.go @@ -31,6 +31,7 @@ import ( metricsscheme "k8s.io/metrics/pkg/client/clientset/versioned/scheme" crscheme "kmodules.xyz/custom-resources/client/clientset/versioned/scheme" cacertsv1alpha1 "kubeops.dev/csi-driver-cacerts/apis/cacerts/v1alpha1" + shardapi "kubeops.dev/operator-shard-manager/api/v1alpha1" psapi "kubeops.dev/petset/apis/apps/v1" sidekickapi "kubeops.dev/sidekick/apis/apps/v1alpha1" stashcoreapi "kubestash.dev/apimachinery/apis/core/v1alpha1" @@ -117,7 +118,10 @@ func NewUncachedClient(cfg *rest.Config) (client.Client, error) { return nil, err } - if err := kubesliceapi.AddToScheme(scheme); err != nil { + if err := kubesliceapi.Install(scheme); err != nil { + return nil, err + } + if err := shardapi.AddToScheme(scheme); err != nil { return nil, err } diff --git a/vendor/kubedb.dev/apimachinery/pkg/lib/lib.go b/vendor/kubedb.dev/apimachinery/pkg/lib/lib.go index a48a44a79..1615fbbcb 100644 --- a/vendor/kubedb.dev/apimachinery/pkg/lib/lib.go +++ b/vendor/kubedb.dev/apimachinery/pkg/lib/lib.go @@ -349,7 +349,7 @@ func ResumeBackupConfiguration(KBClient client.Client, stashClient scs.StashV1be kubeStashConditions := make([]kmapi.Condition, 0) var err error - if kubeStashOperatorExist(KBClient) { + if stashOperatorExist(KBClient) { stashConditions, err = resumeStashBackupConfiguration(stashClient, pausedBackups, opsGeneration) if err != nil { return nil, err diff --git a/vendor/kubedb.dev/apimachinery/pkg/lib/reconfigure_merger.go b/vendor/kubedb.dev/apimachinery/pkg/lib/reconfigure_merger.go new file mode 100644 index 000000000..0b684e94d --- /dev/null +++ b/vendor/kubedb.dev/apimachinery/pkg/lib/reconfigure_merger.go @@ -0,0 +1,428 @@ +/* +Copyright AppsCode Inc. and Contributors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package lib + +import ( + "context" + "fmt" + "sort" + "strings" + "time" + + opsapi "kubedb.dev/apimachinery/apis/ops/v1alpha1" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/klog/v2" + kutil "kmodules.xyz/client-go" + kmapi "kmodules.xyz/client-go/api/v1" + cu "kmodules.xyz/client-go/client" + cutil "kmodules.xyz/client-go/conditions" + meta_util "kmodules.xyz/client-go/meta" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +type MergeFunc func(pendingReconfigureOps []opsapi.Accessor) (any, error) + +type ConvertFunc func(u *unstructured.Unstructured) (opsapi.Accessor, error) + +type ReconfigureMerger struct { + kbClient client.Client + kind string + opsReqList []client.Object + currentOps opsapi.Accessor + mergeFn MergeFunc + convertFn ConvertFunc + log interface { + Info(msg string, keysAndValues ...any) + } +} + +func NewReconfigureMerger(kbClient client.Client, kind string, curOps client.Object, mergeFn MergeFunc, convertFn ConvertFunc, log interface { + Info(msg string, keysAndValues ...any) +}, +) (*ReconfigureMerger, error) { + ret := &ReconfigureMerger{ + kbClient: kbClient, + kind: kind, + currentOps: curOps.(opsapi.Accessor), + mergeFn: mergeFn, + convertFn: convertFn, + log: log, + } + err := ret.populateList() + return ret, err +} + +const ( + MergedOpsSubStr = "-rcfg-merged-" + OriginalOpsSkipped = "OriginalOpsSkipped" + MergedFromOps = "MergedFromOps" + ConfigurationMerged = "ConfigurationMerged" +) + +const ( + ContinueGeneral = iota // 0 + MergeNeeded // 1 + RequeueNeeded // 2 + RequeueNotNeeded // 3 +) + +func (m *ReconfigureMerger) populateList() error { + unsList := &unstructured.UnstructuredList{} + unsList.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "ops.kubedb.com", + Version: "v1alpha1", + Kind: m.kind + "List", + }) + + err := m.kbClient.List(context.TODO(), unsList, + client.InNamespace(m.currentOps.GetNamespace()), + ) + if err != nil { + return err + } + + var ( + lst []client.Object + accessor opsapi.Accessor + ) + for _, request := range unsList.Items { + accessor, err = m.convertFn(&request) + if err != nil { + return err + } + lst = append(lst, accessor) + } + m.opsReqList = lst + return nil +} + +func (m *ReconfigureMerger) Run() (int, error) { + skip, pendingReconfigureOps := m.FindPendingReconfigureOpsToMerge() + if skip != MergeNeeded { + return skip, nil + } + + mergedConfig, err := m.mergeFn(pendingReconfigureOps) + if err != nil { + return RequeueNeeded, fmt.Errorf("failed to merge configurations from reconfigure ops requests: %w", err) + } + + u, err := m.GetMergedOpsRequest(pendingReconfigureOps[0], mergedConfig) + if err != nil { + return RequeueNeeded, err + } + + mergedOps, err := m.convertFn(u) + if err != nil { + return RequeueNeeded, err + } + + klog.Infof("mmm %v %v \n", m.currentOps.GetName(), mergedOps.GetName()) + err = m.EnsureMergedOpsRequest(mergedOps, pendingReconfigureOps) + return ContinueGeneral, err +} + +/* +FindPendingReconfigureOpsToMerge +- Check if OriginalOpsSkipped condition is present. +- If any Reconfigure is Progressing (other than current), requeue current request +- Collect pendingReconfigureOps +- Avoid parallel processing by checking if current ops is already part of an existing merge +- markAsSkipped is the current ops is already merged into another ops. +*/ +func (m *ReconfigureMerger) FindPendingReconfigureOpsToMerge() (int, []opsapi.Accessor) { + // Only process Reconfigure type ops requests + if m.currentOps.GetRequestType() != opsapi.Reconfigure { + return ContinueGeneral, nil + } + + // If it is already Progressing, let it continue + if m.currentOps.GetStatus().Phase == opsapi.OpsRequestPhaseProgressing { + return ContinueGeneral, nil + } + + // If current ops is a merged ops request, check if original ops have been skipped + // Merged ops requests have names like: -rcfg-merged- + meta := m.currentOps.GetObjectMeta() + if strings.Contains(meta.GetName(), MergedOpsSubStr) { + // Check if the "OriginalOpsSkipped" condition is true + if !m.areOriginalOpsSkipped(m.currentOps.GetStatus()) { + m.log.Info(fmt.Sprintf("Merged ops request %s/%s waiting for original ops to be skipped, requeuing", + meta.GetName(), meta.GetName())) + return RequeueNeeded, nil // Requeue until original ops are skipped + } + // Original ops are skipped, proceed with reconciliation + m.log.Info(fmt.Sprintf("Merged ops request %s/%s ready to proceed, original ops have been skipped", + meta.GetNamespace(), meta.GetName())) + return ContinueGeneral, nil + } + + // Collect all pending Reconfigure ops requests for the same database + var pendingReconfigureOps []opsapi.Accessor + for _, o := range m.opsReqList { + req := o.(opsapi.Accessor) + + // Only consider ops for the same database + if req.GetDBRefName() != m.currentOps.GetDBRefName() { + continue + } + + // Only Reconfigure type + if req.GetRequestType() != opsapi.Reconfigure { + continue + } + + // If any Reconfigure is Progressing (other than current), requeue current request + if req.GetStatus().Phase == opsapi.OpsRequestPhaseProgressing { + m.log.Info(fmt.Sprintf("Reconfigure ops request %s/%s is already progressing for database %s, requeuing current request %s/%s", + req.GetObjectMeta().Namespace, req.GetObjectMeta().Name, req.GetDBRefName(), meta.GetNamespace(), meta.GetName())) + return RequeueNeeded, nil + } + + // Collect only Pending or empty ("") phase ops requests + // Ignore Successful/Failed/Skipped + if req.GetStatus().Phase == opsapi.OpsRequestPhasePending || req.GetStatus().Phase == "" { + pendingReconfigureOps = append(pendingReconfigureOps, req) + } + } + + // If only one or none, no need to merge + if len(pendingReconfigureOps) <= 1 { + return ContinueGeneral, nil + } + + // Check if current ops is already part of an existing merge + // This prevents parallel processing from creating duplicate merges + if alreadyMerged, mergedOpsName := isAlreadyMerged(m.currentOps, pendingReconfigureOps); alreadyMerged { + m.log.Info(fmt.Sprintf("Ops request %s/%s is already merged into %s, skipping", + meta.GetNamespace(), meta.GetName(), mergedOpsName)) + + // Mark current ops as Skipped since it's already merged + if err := m.markAsSkippedForMergedOps(m.currentOps, metav1.ObjectMeta{ + Name: mergedOpsName, + Namespace: meta.GetNamespace(), + }); err != nil { + klog.Errorf("failed to mark already merged ops request %s/%s as skipped: %v", meta.GetNamespace(), meta.GetName(), err) + return RequeueNotNeeded, nil + } + return RequeueNotNeeded, nil // Skip this ops as it's already part of a merge + } + + m.log.Info(fmt.Sprintf("Found %d pending reconfigure ops requests to merge", len(pendingReconfigureOps))) + + // Sort by creation timestamp (oldest first), then by name (lexicographically smaller first) + sort.Slice(pendingReconfigureOps, func(i, j int) bool { + x := pendingReconfigureOps[i].GetObjectMeta().CreationTimestamp + y := pendingReconfigureOps[j].GetObjectMeta() + if !x.Equal(&y.CreationTimestamp) { + return x.Before(&y.CreationTimestamp) + } + return strings.Compare(pendingReconfigureOps[i].GetObjectMeta().Name, pendingReconfigureOps[j].GetObjectMeta().Name) < 0 + }) + + return MergeNeeded, pendingReconfigureOps +} + +func (m *ReconfigureMerger) areOriginalOpsSkipped(opsStatus opsapi.OpsRequestStatus) bool { + return cutil.IsConditionTrue(opsStatus.Conditions, OriginalOpsSkipped) +} + +func isAlreadyMerged(currentReq opsapi.Accessor, pendingReconfigureOps []opsapi.Accessor) (bool, string) { + for _, req := range pendingReconfigureOps { + // Only check ops requests that is merged ops + if !strings.Contains(req.GetObjectMeta().Name, MergedOpsSubStr) { + continue + } + + // Check if current ops name is in the "MergedFromOps" condition message + for _, cond := range req.GetStatus().Conditions { + if cond.Type == MergedFromOps && cond.Status == metav1.ConditionTrue { + // The message contains comma-separated list of original ops names + opsNames := strings.Split(cond.Message, ", ") + for _, name := range opsNames { + if strings.TrimSpace(name) == currentReq.GetObjectMeta().Name { + return true, req.GetObjectMeta().Name + } + } + } + } + } + return false, "" +} + +func (m *ReconfigureMerger) markAsSkippedForMergedOps(ops opsapi.Accessor, mergedOpsMeta metav1.ObjectMeta) error { + msg := fmt.Sprintf("Configuration merged into newly created ops request %s/%s", mergedOpsMeta.Namespace, mergedOpsMeta.Name) + + _, err := cu.PatchStatus(context.TODO(), m.kbClient, ops, func(obj client.Object) client.Object { + ret := obj.(opsapi.Accessor) + sts := ret.GetStatus() + sts.Phase = opsapi.OpsRequestPhaseSkipped + sts.ObservedGeneration = ret.GetObjectMeta().Generation + sts.Conditions = cutil.SetCondition(sts.Conditions, kmapi.Condition{ + Type: kmapi.ConditionType(opsapi.OpsRequestPhaseSkipped), + Reason: ConfigurationMerged, + Status: metav1.ConditionTrue, + ObservedGeneration: ret.GetObjectMeta().Generation, + LastTransitionTime: metav1.Now(), + Message: msg, + }) + ret.SetStatus(sts) + return ret + }) + if err != nil { + return fmt.Errorf("failed to mark ops request %s/%s as skipped: %w", ops.GetObjectMeta().Namespace, ops.GetObjectMeta().Name, err) + } + + m.log.Info(fmt.Sprintf("%s/%s skipped: %s", ops.GetObjectMeta().Namespace, ops.GetObjectMeta().Name, msg)) + return nil +} + +func (m *ReconfigureMerger) GetMergedOpsRequest(firstPendingOps opsapi.Accessor, config any) (*unstructured.Unstructured, error) { + toUnstructured := func(obj any) (*unstructured.Unstructured, error) { + m, err := runtime.DefaultUnstructuredConverter.ToUnstructured(obj) + if err != nil { + return nil, err + } + return &unstructured.Unstructured{Object: m}, nil + } + + buildReconfigureOpsRequest := func( + firstPendingOps opsapi.Accessor, + config any, + ) (*unstructured.Unstructured, error) { + mergedOpsName := meta_util.NameWithSuffix(firstPendingOps.GetDBRefName(), fmt.Sprintf("rcfg-merged-%d", time.Now().UnixMilli())) + cfg, err := toUnstructured(config) + if err != nil { + return nil, err + } + + obj := map[string]any{ + "apiVersion": "ops.kubedb.com/v1alpha1", + "kind": m.kind, + "metadata": map[string]any{ + "name": mergedOpsName, + "namespace": firstPendingOps.GetObjectMeta().Namespace, + "labels": firstPendingOps.GetObjectMeta().Labels, + }, + "spec": map[string]any{ + "type": opsapi.Reconfigure, + "databaseRef": map[string]any{ + "name": firstPendingOps.GetDBRefName(), + }, + "configuration": cfg.Object, + }, + } + + return &unstructured.Unstructured{Object: obj}, nil + } + + request, err := buildReconfigureOpsRequest(firstPendingOps, config) + if err != nil { + return nil, err + } + + return request, nil +} + +func (m *ReconfigureMerger) EnsureMergedOpsRequest(mergedOpsRequest opsapi.Accessor, pendingReconfigureOps []opsapi.Accessor) error { + verb, err := cu.CreateOrPatch(context.TODO(), m.kbClient, mergedOpsRequest, func(obj client.Object, _ bool) client.Object { + return mergedOpsRequest + }) + if err != nil { + return fmt.Errorf("failed to create merged ops request %s/%s: %w", mergedOpsRequest.GetObjectMeta().Namespace, mergedOpsRequest.GetObjectMeta().Name, err) + } + + // Prepare the list of original ops names for the "MergedFromOps" condition + var opsNames []string + for _, ops := range pendingReconfigureOps { + opsNames = append(opsNames, ops.GetObjectMeta().Name) + } + + mergedFromOpsMessage := strings.Join(opsNames, ", ") + if verb == kutil.VerbCreated { + m.log.Info(fmt.Sprintf("Created merged reconfigure ops request %s/%s from %d pending requests", + mergedOpsRequest.GetObjectMeta().Namespace, mergedOpsRequest.GetObjectMeta().Name, len(opsNames))) + } + + if err := m.updateConditionForMergedOps(mergedOpsRequest, mergedFromOpsMessage); err != nil { + return fmt.Errorf("failed to record merged-from condition for %s/%s: %w", mergedOpsRequest.GetObjectMeta().Namespace, mergedOpsRequest.GetObjectMeta().Name, err) + } + + for _, op := range pendingReconfigureOps { + err = m.markAsSkippedForMergedOps(op, mergedOpsRequest.GetObjectMeta()) + if err != nil { + return err + } + } + + // Mark the merged ops request with "OriginalOpsSkipped" condition after skipping is done + // This allows the merged ops to proceed with reconciliation + if err := m.markOriginalOpsAsSkipped(mergedOpsRequest); err != nil { + return fmt.Errorf("failed to mark original ops as skipped for merged ops %s/%s: %w", mergedOpsRequest.GetObjectMeta().Namespace, mergedOpsRequest.GetObjectMeta().Name, err) + } + + m.log.Info(fmt.Sprintf("Marked merged ops request %s/%s as ready to proceed (original ops skipped)", mergedOpsRequest.GetObjectMeta().Namespace, mergedOpsRequest.GetObjectMeta().Name)) + return nil +} + +func (m *ReconfigureMerger) updateConditionForMergedOps(mergedOps opsapi.Accessor, mergedFromOpsMessage string) error { + _, err := cu.PatchStatus(context.TODO(), m.kbClient, mergedOps, func(obj client.Object) client.Object { + ret := obj.(opsapi.Accessor) + sts := ret.GetStatus() + sts.ObservedGeneration = ret.GetGeneration() + sts.Conditions = cutil.SetCondition(sts.Conditions, kmapi.Condition{ + Type: MergedFromOps, + Reason: ConfigurationMerged, + Status: metav1.ConditionTrue, + ObservedGeneration: ret.GetGeneration(), + LastTransitionTime: metav1.Now(), + Message: mergedFromOpsMessage, + }) + ret.SetStatus(sts) + return ret + }) + if err != nil { + return fmt.Errorf("failed to set MergedFromOps condition for %s/%s: %w", mergedOps.GetObjectMeta().Namespace, mergedOps.GetObjectMeta().Name, err) + } + return nil +} + +func (m *ReconfigureMerger) markOriginalOpsAsSkipped(mergedOps opsapi.Accessor) error { + _, err := cu.PatchStatus(context.TODO(), m.kbClient, mergedOps, func(obj client.Object) client.Object { + ret := obj.(opsapi.Accessor) + sts := ret.GetStatus() + sts.ObservedGeneration = ret.GetGeneration() + sts.Conditions = cutil.SetCondition(sts.Conditions, kmapi.Condition{ + Type: OriginalOpsSkipped, + Reason: OriginalOpsSkipped, + Status: metav1.ConditionTrue, + ObservedGeneration: ret.GetGeneration(), + LastTransitionTime: metav1.Now(), + Message: "All original ops requests have been marked as Skipped", + }) + ret.SetStatus(sts) + return ret + }) + if err != nil { + return fmt.Errorf("failed to mark original ops as skipped for merged ops %s/%s: %w", mergedOps.GetObjectMeta().Namespace, mergedOps.GetObjectMeta().Name, err) + } + return nil +} diff --git a/vendor/kubedb.dev/db-client-go/elasticsearch/api.go b/vendor/kubedb.dev/db-client-go/elasticsearch/api.go index 7e46eb451..d40218a9b 100644 --- a/vendor/kubedb.dev/db-client-go/elasticsearch/api.go +++ b/vendor/kubedb.dev/db-client-go/elasticsearch/api.go @@ -18,29 +18,11 @@ package elasticsearch import ( "context" - "crypto/tls" "encoding/json" - "fmt" - "net" - "net/http" - "time" - catalog "kubedb.dev/apimachinery/apis/catalog/v1alpha1" dbapi "kubedb.dev/apimachinery/apis/kubedb/v1" - cs "kubedb.dev/apimachinery/client/clientset/versioned" - "github.com/Masterminds/semver/v3" - esv6 "github.com/elastic/go-elasticsearch/v6" - esv7 "github.com/elastic/go-elasticsearch/v7" - esv8 "github.com/elastic/go-elasticsearch/v8" - esv9 "github.com/elastic/go-elasticsearch/v9" - "github.com/go-logr/logr" - opensearchv1 "github.com/opensearch-project/opensearch-go" - opensearchv2 "github.com/opensearch-project/opensearch-go/v2" - "github.com/pkg/errors" core "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/kubernetes" ) const ( @@ -92,8 +74,6 @@ const ( VotingExclusionUrl = "/_cluster/voting_config_exclusions" ) -var log logr.Logger - type Info struct { Name string `json:"name"` ClusterName string `json:"cluster_name"` @@ -138,268 +118,6 @@ type IndexDistribution struct { Node string `json:"node"` } -// GetElasticClient Returns Elasticsearch Client, Health Check Status Code, Error -func GetElasticClient(kc kubernetes.Interface, dc cs.Interface, db *dbapi.Elasticsearch, url string) (ESClient, int, error) { - var username, password string - if !db.Spec.DisableSecurity && db.Spec.AuthSecret != nil { - secret, err := kc.CoreV1().Secrets(db.Namespace).Get(context.TODO(), db.Spec.AuthSecret.Name, metav1.GetOptions{}) - if err != nil { - log.Error(err, fmt.Sprintf("Failed to get secret: %s for Elasticsearch: %s/%s", db.Spec.AuthSecret.Name, db.Namespace, db.Name)) - return nil, -1, errors.Wrap(err, "failed to get the secret") - } - - if value, ok := secret.Data[core.BasicAuthUsernameKey]; ok { - username = string(value) - } else { - log.Error(errors.New("username is missing"), fmt.Sprintf("Failed for secret: %s/%s, username is missing", secret.Namespace, secret.Name)) - return nil, -1, errors.New("username is missing") - } - - if value, ok := secret.Data[core.BasicAuthPasswordKey]; ok { - password = string(value) - } else { - log.Error(errors.New("password is missing"), fmt.Sprintf("Failed for secret: %s/%s, password is missing", secret.Namespace, secret.Name)) - return nil, -1, errors.New("password is missing") - } - } - - // Get original Elasticsearch version, since the client is version specific - esVersion, err := dc.CatalogV1alpha1().ElasticsearchVersions().Get(context.TODO(), db.Spec.Version, metav1.GetOptions{}) - if err != nil { - return nil, -1, errors.Wrap(err, "failed to get elasticsearchVersion") - } - - version, err := semver.NewVersion(esVersion.Spec.Version) - if err != nil { - return nil, -1, errors.Wrap(err, "failed to parse version") - } - - switch esVersion.Spec.AuthPlugin { - case catalog.ElasticsearchAuthPluginXpack, catalog.ElasticsearchAuthPluginSearchGuard, catalog.ElasticsearchAuthPluginOpenDistro: - switch { - case version.Major() == 6: - client, err := esv6.NewClient(esv6.Config{ - Addresses: []string{url}, - Username: username, - Password: password, - EnableDebugLogger: true, - DisableRetry: true, - Transport: &http.Transport{ - IdleConnTimeout: 3 * time.Second, - DialContext: (&net.Dialer{ - Timeout: 30 * time.Second, - }).DialContext, - TLSClientConfig: &tls.Config{ - InsecureSkipVerify: true, - MaxVersion: tls.VersionTLS12, - }, - }, - }) - if err != nil { - log.Error(err, fmt.Sprintf("Failed to create HTTP client for Elasticsearch: %s/%s", db.Namespace, db.Name)) - return nil, -1, err - } - // do a manual health check to test client - res, err := client.Cluster.Health( - client.Cluster.Health.WithPretty(), - ) - if err != nil { - return nil, -1, errors.Wrap(err, "failed to perform health check") - } - defer res.Body.Close() // nolint:errcheck - - if res.IsError() { - return &ESClientV6{client: client}, res.StatusCode, fmt.Errorf("health check failed with status code: %d", res.StatusCode) - } - return &ESClientV6{client: client}, res.StatusCode, nil - - case version.Major() == 7: - client, err := esv7.NewClient(esv7.Config{ - Addresses: []string{url}, - Username: username, - Password: password, - EnableDebugLogger: true, - DisableRetry: true, - Transport: &http.Transport{ - IdleConnTimeout: 3 * time.Second, - DialContext: (&net.Dialer{ - Timeout: 30 * time.Second, - }).DialContext, - TLSClientConfig: &tls.Config{ - InsecureSkipVerify: true, - MaxVersion: tls.VersionTLS12, - }, - }, - }) - if err != nil { - log.Error(err, fmt.Sprintf("Failed to create HTTP client for Elasticsearch: %s/%s", db.Namespace, db.Name)) - return nil, -1, err - } - // do a manual health check to test client - res, err := client.Cluster.Health( - client.Cluster.Health.WithPretty(), - ) - if err != nil { - return nil, -1, errors.Wrap(err, "failed to perform health check") - } - defer res.Body.Close() // nolint:errcheck - - if res.IsError() { - return &ESClientV7{client: client}, res.StatusCode, fmt.Errorf("health check failed with status code: %d", res.StatusCode) - } - return &ESClientV7{client: client}, res.StatusCode, nil - - case version.Major() == 8: - client, err := esv8.NewClient(esv8.Config{ - Addresses: []string{url}, - Username: username, - Password: password, - EnableDebugLogger: true, - DisableRetry: true, - Transport: &http.Transport{ - IdleConnTimeout: 3 * time.Second, - DialContext: (&net.Dialer{ - Timeout: 30 * time.Second, - }).DialContext, - TLSClientConfig: &tls.Config{ - InsecureSkipVerify: true, - MaxVersion: tls.VersionTLS12, - }, - }, - }) - if err != nil { - log.Error(err, fmt.Sprintf("Failed to create HTTP client for Elasticsearch: %s/%s", db.Namespace, db.Name)) - return nil, -1, err - } - // do a manual health check to test client - res, err := client.Cluster.Health( - client.Cluster.Health.WithPretty(), - ) - if err != nil { - return nil, -1, errors.Wrap(err, "failed to perform health check") - } - defer res.Body.Close() // nolint:errcheck - - if res.IsError() { - return &ESClientV8{client: client}, res.StatusCode, fmt.Errorf("health check failed with status code: %d", res.StatusCode) - } - return &ESClientV8{client: client}, res.StatusCode, nil - - case version.Major() == 9: - client, err := esv9.NewClient(esv9.Config{ - Addresses: []string{url}, - Username: username, - Password: password, - EnableDebugLogger: true, - DisableRetry: true, - Transport: &http.Transport{ - IdleConnTimeout: 3 * time.Second, - DialContext: (&net.Dialer{ - Timeout: 30 * time.Second, - }).DialContext, - TLSClientConfig: &tls.Config{ - InsecureSkipVerify: true, - MaxVersion: tls.VersionTLS12, - }, - }, - }) - if err != nil { - log.Error(err, fmt.Sprintf("Failed to create HTTP client for Elasticsearch: %s/%s", db.Namespace, db.Name)) - return nil, -1, err - } - // do a manual health check to test client - res, err := client.Cluster.Health( - client.Cluster.Health.WithPretty(), - ) - if err != nil { - return nil, -1, errors.Wrap(err, "failed to perform health check") - } - defer res.Body.Close() // nolint:errcheck - - if res.IsError() { - return &ESClientV9{client: client}, res.StatusCode, fmt.Errorf("health check failed with status code: %d", res.StatusCode) - } - return &ESClientV9{client: client}, res.StatusCode, nil - } - - case catalog.ElasticsearchAuthPluginOpenSearch: - switch { - case version.Major() == 1: - client, err := opensearchv1.NewClient(opensearchv1.Config{ - Addresses: []string{url}, - Username: username, - Password: password, - EnableDebugLogger: true, - DisableRetry: true, - Transport: &http.Transport{ - IdleConnTimeout: 3 * time.Second, - DialContext: (&net.Dialer{ - Timeout: 30 * time.Second, - }).DialContext, - TLSClientConfig: &tls.Config{ - InsecureSkipVerify: true, - MaxVersion: tls.VersionTLS12, - }, - }, - }) - if err != nil { - log.Error(err, fmt.Sprintf("Failed to create HTTP client for Elasticsearch: %s/%s", db.Namespace, db.Name)) - return nil, -1, err - } - // do a manual health check to test client - res, err := client.Cluster.Health( - client.Cluster.Health.WithPretty(), - ) - if err != nil { - return nil, -1, errors.Wrap(err, "failed to perform health check") - } - defer res.Body.Close() // nolint:errcheck - - if res.IsError() { - return &OSClientV1{client: client}, res.StatusCode, fmt.Errorf("health check failed with status code: %d", res.StatusCode) - } - return &OSClientV1{client: client}, res.StatusCode, nil - case version.Major() == 2: - client, err := opensearchv2.NewClient(opensearchv2.Config{ - Addresses: []string{url}, - Username: username, - Password: password, - EnableDebugLogger: true, - DisableRetry: true, - Transport: &http.Transport{ - IdleConnTimeout: 3 * time.Second, - DialContext: (&net.Dialer{ - Timeout: 30 * time.Second, - }).DialContext, - TLSClientConfig: &tls.Config{ - InsecureSkipVerify: true, - MaxVersion: tls.VersionTLS12, - }, - }, - }) - if err != nil { - log.Error(err, fmt.Sprintf("Failed to create HTTP client for Elasticsearch: %s/%s", db.Namespace, db.Name)) - return nil, -1, err - } - // do a manual health check to test client - res, err := client.Cluster.Health( - client.Cluster.Health.WithPretty(), - ) - if err != nil { - return nil, -1, errors.Wrap(err, "Failed to perform health check") - } - defer res.Body.Close() // nolint:errcheck - - if res.IsError() { - return &OSClientV2{client: client}, res.StatusCode, fmt.Errorf("health check failed with status code: %d", res.StatusCode) - } - return &OSClientV2{client: client}, res.StatusCode, nil - } - } - - return nil, -1, fmt.Errorf("unknown database version: %s", esVersion.Spec.Version) -} - // By default searchGuard/openDistro maintain a copy this index's shard in every data node. // -->: "auto_expand_replicas" : "0-all" var IgnorableIndexList = []string{ diff --git a/vendor/kubedb.dev/db-client-go/elasticsearch/kubedb_client_builder.go b/vendor/kubedb.dev/db-client-go/elasticsearch/kubedb_client_builder.go index b0eb7121b..aa2b01b2d 100644 --- a/vendor/kubedb.dev/db-client-go/elasticsearch/kubedb_client_builder.go +++ b/vendor/kubedb.dev/db-client-go/elasticsearch/kubedb_client_builder.go @@ -45,6 +45,8 @@ import ( osapiv1 "github.com/opensearch-project/opensearch-go/opensearchapi" osv2 "github.com/opensearch-project/opensearch-go/v2" osapiv2 "github.com/opensearch-project/opensearch-go/v2/opensearchapi" + osv3 "github.com/opensearch-project/opensearch-go/v3" + osapiv3 "github.com/opensearch-project/opensearch-go/v3/opensearchapi" "github.com/pkg/errors" core "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime/schema" @@ -461,6 +463,52 @@ func (o *KubeDBClientBuilder) GetElasticClient() (*Client, error) { return &Client{ &OSClientV2{client: osClient}, }, nil + case version.Major() == 3: + defaultTLSConfig, err := o.getDefaultTLSConfig() + if err != nil { + klog.Errorf("Failed get default TLS configuration") + return nil, err + } + + // Create the base client + baseClient, err := osv3.NewClient(osv3.Config{ + Addresses: []string{o.url}, + Username: username, + Password: password, + EnableDebugLogger: true, + DisableRetry: true, + Transport: &http.Transport{ + IdleConnTimeout: 3 * time.Second, + DialContext: (&net.Dialer{ + Timeout: 30 * time.Second, + }).DialContext, + TLSClientConfig: defaultTLSConfig, + }, + }) + if err != nil { + klog.Errorf("Failed to create HTTP client for Elasticsearch: %s/%s with: %s", o.db.Namespace, o.db.Name, err) + return nil, err + } + + // Create the API client from the base client + osClient := &osapiv3.Client{ + Client: baseClient, + } + + // Use Info() to test connection + res, err := osClient.Info(o.ctx, nil) + if err != nil { + return nil, err + } + + // Check if response indicates an error + if res.Inspect().Response.StatusCode >= 400 { + return nil, fmt.Errorf("cluster info request failed with status code: %d", res.Inspect().Response.StatusCode) + } + + return &Client{ + &OSClientV3{client: osClient}, + }, nil } } diff --git a/vendor/kubedb.dev/db-client-go/elasticsearch/os_client_v3.go b/vendor/kubedb.dev/db-client-go/elasticsearch/os_client_v3.go new file mode 100644 index 000000000..434e06e8c --- /dev/null +++ b/vendor/kubedb.dev/db-client-go/elasticsearch/os_client_v3.go @@ -0,0 +1,965 @@ +/* +Copyright AppsCode Inc. and Contributors +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package elasticsearch + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "io" + "net/http" + "strings" + "text/template" + + dbapi "kubedb.dev/apimachinery/apis/kubedb/v1" + + osv3api "github.com/opensearch-project/opensearch-go/v3/opensearchapi" + "github.com/pkg/errors" + core "k8s.io/api/core/v1" + "k8s.io/klog/v2" + kutil "kmodules.xyz/client-go" +) + +var _ ESClient = &OSClientV3{} + +type OSClientV3 struct { + client *osv3api.Client +} + +func (os *OSClientV3) ClusterHealthInfo() (map[string]any, error) { + req, err := http.NewRequest(http.MethodGet, "/_cluster/health", nil) + if err != nil { + return nil, err + } + + q := req.URL.Query() + q.Add("pretty", "true") + q.Add("human", "true") + req.URL.RawQuery = q.Encode() + + resp, err := os.client.Client.Transport.Perform(req) + if err != nil { + return nil, err + } + defer func() { + if closeErr := resp.Body.Close(); closeErr != nil { + klog.Errorf("failed to close response body for ClusterHealthInfo, reason: %s", closeErr) + } + }() + + if resp.StatusCode != http.StatusOK { + return nil, fmt.Errorf("cluster health request failed with status code: %d", resp.StatusCode) + } + + response := make(map[string]any) + if err := json.NewDecoder(resp.Body).Decode(&response); err != nil { + return nil, errors.Wrap(err, "failed to parse the response body") + } + return response, nil +} + +func (os *OSClientV3) NodesStats() (map[string]any, error) { + req, err := http.NewRequest(http.MethodGet, "/_nodes/stats", nil) + if err != nil { + return nil, err + } + + q := req.URL.Query() + q.Add("pretty", "true") + q.Add("human", "true") + req.URL.RawQuery = q.Encode() + + resp, err := os.client.Client.Transport.Perform(req) + if err != nil { + return nil, err + } + defer func() { + if closeErr := resp.Body.Close(); closeErr != nil { + klog.Errorf("failed to close response body for NodesStats, reason: %s", closeErr) + } + }() + + if resp.StatusCode != http.StatusOK { + return nil, fmt.Errorf("nodes stats request failed with status code: %d", resp.StatusCode) + } + + nodesStats := make(map[string]any) + if err := json.NewDecoder(resp.Body).Decode(&nodesStats); err != nil { + return nil, fmt.Errorf("failed to deserialize the response: %v", err) + } + + return nodesStats, nil +} + +func (os *OSClientV3) DisableShardAllocation() error { + var b strings.Builder + b.WriteString(DisableShardAllocation) + + req, err := http.NewRequest(http.MethodPut, "/_cluster/settings", strings.NewReader(b.String())) + if err != nil { + return err + } + + q := req.URL.Query() + q.Add("pretty", "true") + q.Add("human", "true") + req.URL.RawQuery = q.Encode() + + req.Header.Set("Content-Type", "application/json") + + resp, err := os.client.Client.Transport.Perform(req) + if err != nil { + return err + } + defer func() { + if closeErr := resp.Body.Close(); closeErr != nil { + klog.Errorf("failed to close response body for DisableShardAllocation, reason: %s", closeErr) + } + }() + + if resp.StatusCode != http.StatusOK { + return fmt.Errorf("received status code: %d", resp.StatusCode) + } + + return nil +} + +func (os *OSClientV3) ShardStats() ([]ShardInfo, error) { + req, err := http.NewRequest(http.MethodGet, "/_cat/shards", nil) + if err != nil { + return nil, err + } + + q := req.URL.Query() + q.Add("format", "json") + q.Add("bytes", "b") + q.Add("h", "index,shard,prirep,state,unassigned.reason") + req.URL.RawQuery = q.Encode() + + resp, err := os.client.Client.Transport.Perform(req) + if err != nil { + return nil, err + } + defer func() { + if closeErr := resp.Body.Close(); closeErr != nil { + klog.Errorf("failed to close response body from ShardsStats, reason: %s", closeErr) + } + }() + + if resp.StatusCode != http.StatusOK { + return nil, fmt.Errorf("cat shards failed with status code: %d", resp.StatusCode) + } + + body, err := io.ReadAll(resp.Body) + if err != nil { + return nil, err + } + + var shardStats []ShardInfo + if err := json.Unmarshal(body, &shardStats); err != nil { + return nil, err + } + return shardStats, nil +} + +func (os *OSClientV3) GetIndicesInfo() ([]any, error) { + req, err := http.NewRequest(http.MethodGet, "/_cat/indices", nil) + if err != nil { + return nil, err + } + + q := req.URL.Query() + q.Add("format", "json") + q.Add("bytes", "b") + req.URL.RawQuery = q.Encode() + + resp, err := os.client.Client.Transport.Perform(req) + if err != nil { + return nil, err + } + defer func() { + if closeErr := resp.Body.Close(); closeErr != nil { + klog.Errorf("failed to close response body from GetIndicesInfo, reason: %s", closeErr) + } + }() + + if resp.StatusCode != http.StatusOK { + return nil, fmt.Errorf("cat indices failed with status code: %d", resp.StatusCode) + } + + var indicesInfo []any + if err := json.NewDecoder(resp.Body).Decode(&indicesInfo); err != nil { + return nil, fmt.Errorf("failed to deserialize the response: %v", err) + } + + return indicesInfo, nil +} + +func (os *OSClientV3) ClusterStatus() (string, error) { + req, err := http.NewRequest(http.MethodGet, "/_cluster/health", nil) + if err != nil { + return "", err + } + + q := req.URL.Query() + q.Add("pretty", "true") + req.URL.RawQuery = q.Encode() + + resp, err := os.client.Client.Transport.Perform(req) + if err != nil { + return "", err + } + defer func() { + if closeErr := resp.Body.Close(); closeErr != nil { + klog.Errorf("failed to close response body from ClusterStatus, reason: %s", closeErr) + } + }() + + if resp.StatusCode != http.StatusOK { + return "", fmt.Errorf("cluster health request failed with status code: %d", resp.StatusCode) + } + + response := make(map[string]any) + if err := json.NewDecoder(resp.Body).Decode(&response); err != nil { + return "", errors.Wrap(err, "failed to parse the response body") + } + if value, ok := response["status"]; ok { + if strValue, ok := value.(string); ok { + return strValue, nil + } + return "", errors.New("failed to convert response to string") + } + return "", errors.New("status is missing") +} + +func (os *OSClientV3) GetClusterWriteStatus(ctx context.Context, db *dbapi.Elasticsearch) error { + indexBody := WriteRequestIndexBody{ + ID: writeRequestID, + } + indexReq := WriteRequestIndex{indexBody} + ReqBody := db.Spec + + indexJson, err := json.Marshal(indexReq) + if err != nil { + return errors.Wrap(err, "Failed to encode index for performing write request") + } + bodyJson, err := json.Marshal(ReqBody) + if err != nil { + return errors.Wrap(err, "Failed to encode request body for performing write request") + } + + // Bulk body requires newline-delimited JSON + bulkBody := string(indexJson) + "\n" + string(bodyJson) + "\n" + + req, err := http.NewRequestWithContext(ctx, http.MethodPost, "/_bulk", strings.NewReader(bulkBody)) + if err != nil { + return errors.Wrap(err, "Failed to create write request") + } + + q := req.URL.Query() + q.Add("index", writeRequestIndex) + q.Add("pretty", "true") + req.URL.RawQuery = q.Encode() + + req.Header.Set("Content-Type", "application/x-ndjson") + + resp, err := os.client.Client.Transport.Perform(req) + if err != nil { + return errors.Wrap(err, "Failed to perform write request") + } + defer func() { + if closeErr := resp.Body.Close(); closeErr != nil { + klog.Errorf("Failed to close write request response body, reason: %s", closeErr) + } + }() + + if resp.StatusCode >= 400 { + return fmt.Errorf("failed to get response from write request with error statuscode %d", resp.StatusCode) + } + + responseBody := make(map[string]any) + if err := json.NewDecoder(resp.Body).Decode(&responseBody); err != nil { + return errors.Wrap(err, "Failed to decode response from write request") + } + + if value, ok := responseBody["errors"]; ok { + if strValue, ok := value.(bool); ok { + if !strValue { + return nil + } + return errors.Errorf("Write request responded with error, %v", responseBody) + } + return errors.New("Failed to parse value for `errors` in response from write request") + } + return errors.New("Failed to parse key `errors` in response from write request") +} + +func (os *OSClientV3) GetClusterReadStatus(ctx context.Context, db *dbapi.Elasticsearch) error { + path := fmt.Sprintf("/%s/_doc/%s", writeRequestIndex, writeRequestID) + req, err := http.NewRequestWithContext(ctx, http.MethodGet, path, nil) + if err != nil { + return errors.Wrap(err, "Failed to create read request") + } + + q := req.URL.Query() + q.Add("pretty", "true") + req.URL.RawQuery = q.Encode() + + resp, err := os.client.Client.Transport.Perform(req) + if err != nil { + return errors.Wrap(err, "Failed to perform read request") + } + defer func() { + if closeErr := resp.Body.Close(); closeErr != nil { + klog.Errorf("failed to close read request response body, reason: %s", closeErr) + } + }() + + if resp.StatusCode == http.StatusNotFound { + return kutil.ErrNotFound + } + if resp.StatusCode >= 400 { + return fmt.Errorf("failed to get response from read request with error statuscode %d", resp.StatusCode) + } + + return nil +} + +func (os *OSClientV3) GetTotalDiskUsage(ctx context.Context) (string, error) { + path := "/" + diskUsageRequestIndex + "/_disk_usage" + req, err := http.NewRequestWithContext(ctx, http.MethodPost, path, nil) + if err != nil { + return "", errors.Wrap(err, "Failed to create Disk Usage Request") + } + + q := req.URL.Query() + q.Add("run_expensive_tasks", "true") + q.Add("expand_wildcards", diskUsageRequestWildcards) + req.URL.RawQuery = q.Encode() + + res, err := os.client.Client.Transport.Perform(req) + if err != nil { + return "", errors.Wrap(err, "Failed to perform Disk Usage Request") + } + defer func() { + if closeErr := res.Body.Close(); closeErr != nil { + klog.Errorf("failed to close response body from Disk Usage Request, reason: %s", closeErr) + } + }() + + if res.StatusCode != http.StatusOK { + return "", fmt.Errorf("disk Usage Request failed with status code: %d", res.StatusCode) + } + + totalDiskUsage, err := calculateDatabaseSize(res.Body) + if err != nil { + return "", errors.Wrap(err, "Failed to parse json response to get disk usage") + } + + return totalDiskUsage, nil +} + +func (os *OSClientV3) SyncCredentialFromSecret(secret *core.Secret) error { + return nil +} + +func (os *OSClientV3) GetDBUserRole(ctx context.Context) (error, bool) { + return errors.New("not supported in os version 3"), false +} + +func (os *OSClientV3) CreateDBUserRole(ctx context.Context) error { + return errors.New("not supported in os version 3") +} + +func (os *OSClientV3) IndexExistsOrNot(index string) error { + req, err := http.NewRequest(http.MethodHead, "/"+index, nil) + if err != nil { + klog.Errorf("failed to create request while checking index existence %v", err) + return err + } + + resp, err := os.client.Client.Transport.Perform(req) + if err != nil { + klog.Errorf("failed to get response while checking either index exists or not %v", err) + return err + } + defer func() { + if closeErr := resp.Body.Close(); closeErr != nil { + klog.Errorf("failed to close response body for checking the existence of index, reason: %s", closeErr) + } + }() + + if resp.StatusCode == http.StatusNotFound { + klog.Errorf("index does not exist") + return fmt.Errorf("index %s does not exist (status code: 404)", index) + } + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + klog.Errorf("failed to check index existence with status code %d", resp.StatusCode) + return fmt.Errorf("failed to get index with statuscode %d", resp.StatusCode) + } + + return nil +} + +func (os *OSClientV3) CreateIndex(index string) error { + req, err := http.NewRequest(http.MethodPut, "/"+index, nil) + if err != nil { + klog.Errorf("failed to create request for creating index, reason: %s", err) + return err + } + + q := req.URL.Query() + q.Add("pretty", "true") + req.URL.RawQuery = q.Encode() + + res, err := os.client.Client.Transport.Perform(req) + if err != nil { + klog.Errorf("failed to apply create index request, reason: %s", err) + return err + } + defer func(Body io.ReadCloser) { + err = Body.Close() + if err != nil { + klog.Errorf("failed to close response body for creating index, reason: %s", err) + } + }(res.Body) + + if res.StatusCode < 200 || res.StatusCode >= 300 { + klog.Errorf("creating index failed with statuscode %d", res.StatusCode) + return errors.New("failed to create index") + } + + return nil +} + +func (os *OSClientV3) DeleteIndex(index string) error { + req, err := http.NewRequest(http.MethodDelete, "/"+index, nil) + if err != nil { + klog.Errorf("failed to create request for deleting index, reason: %s", err) + return err + } + + res, err := os.client.Client.Transport.Perform(req) + if err != nil { + klog.Errorf("failed to apply delete index request, reason: %s", err) + return err + } + defer func(Body io.ReadCloser) { + err = Body.Close() + if err != nil { + klog.Errorf("failed to close response body for deleting index, reason: %s", err) + } + }(res.Body) + + if res.StatusCode < 200 || res.StatusCode >= 300 { + klog.Errorf("failed to delete index with status code %d", res.StatusCode) + return errors.New("failed to delete index") + } + + return nil +} + +func (os *OSClientV3) CountData(index string) (int, error) { + path := "/" + index + "/_count" + req, err := http.NewRequest(http.MethodGet, path, nil) + if err != nil { + return 0, err + } + + res, err := os.client.Client.Transport.Perform(req) + if err != nil { + return 0, err + } + defer func(Body io.ReadCloser) { + err = Body.Close() + if err != nil { + klog.Errorf("failed to close response body for counting data, reason: %s", err) + } + }(res.Body) + + if res.StatusCode < 200 || res.StatusCode >= 300 { + klog.Errorf("failed to count number of documents in index with statuscode %d", res.StatusCode) + return 0, errors.New("failed to count number of documents in index") + } + + var response map[string]any + if err := json.NewDecoder(res.Body).Decode(&response); err != nil { + return 0, err + } + + count, ok := response["count"] + if !ok { + return 0, errors.New("failed to parse value for index count in response body") + } + + return int(count.(float64)), nil +} + +func (os *OSClientV3) PutData(index, id string, data map[string]any) error { + dataBytes, err := json.Marshal(data) + if err != nil { + return errors.Wrap(err, "failed to Marshal data") + } + + path := fmt.Sprintf("/%s/_doc/%s", index, id) + req, err := http.NewRequest(http.MethodPut, path, bytes.NewReader(dataBytes)) + if err != nil { + klog.Errorf("failed to create request for putting data, reason: %s", err) + return err + } + + q := req.URL.Query() + q.Add("pretty", "true") + req.URL.RawQuery = q.Encode() + + req.Header.Set("Content-Type", "application/json") + + res, err := os.client.Client.Transport.Perform(req) + if err != nil { + klog.Errorf("failed to put data in the index, reason: %s", err) + return err + } + defer func(Body io.ReadCloser) { + err = Body.Close() + if err != nil { + klog.Errorf("failed to close response body for putting data in the index, reason: %s", err) + } + }(res.Body) + + if res.StatusCode < 200 || res.StatusCode >= 300 { + klog.Errorf("failed to put data in an index with statuscode %d", res.StatusCode) + return errors.New("failed to put data in an index") + } + return nil +} + +func (os *OSClientV3) ReEnableShardAllocation() error { + var b strings.Builder + b.WriteString(ReEnableShardAllocation) + + req, err := http.NewRequest(http.MethodPut, "/_cluster/settings", strings.NewReader(b.String())) + if err != nil { + return err + } + + q := req.URL.Query() + q.Add("pretty", "true") + q.Add("human", "true") + req.URL.RawQuery = q.Encode() + + req.Header.Set("Content-Type", "application/json") + + res, err := os.client.Client.Transport.Perform(req) + if err != nil { + return err + } + defer func() { + if closeErr := res.Body.Close(); closeErr != nil { + klog.Errorf("failed to close response body from ReEnableShardAllocation, reason: %s", closeErr) + } + }() + + if res.StatusCode != http.StatusOK { + return fmt.Errorf("received status code: %d", res.StatusCode) + } + + return nil +} + +func (os *OSClientV3) CheckVersion() (string, error) { + req, err := http.NewRequest(http.MethodGet, "/", nil) + if err != nil { + return "", err + } + + q := req.URL.Query() + q.Add("pretty", "true") + q.Add("human", "true") + req.URL.RawQuery = q.Encode() + + res, err := os.client.Client.Transport.Perform(req) + if err != nil { + return "", err + } + defer func() { + if closeErr := res.Body.Close(); closeErr != nil { + klog.Errorf("failed to close response body from CheckVersion, reason: %s", closeErr) + } + }() + if res.StatusCode != http.StatusOK { + return "", fmt.Errorf("info request failed with status code: %d", res.StatusCode) + } + + nodeInfo := new(Info) + if err := json.NewDecoder(res.Body).Decode(&nodeInfo); err != nil { + return "", errors.Wrap(err, "failed to deserialize the response") + } + + if nodeInfo.Version.Number == "" { + return "", errors.New("elasticsearch version is empty") + } + + return nodeInfo.Version.Number, nil +} + +func (os *OSClientV3) GetClusterStatus() (string, error) { + req, err := http.NewRequest(http.MethodGet, "/_cluster/health", nil) + if err != nil { + return "", err + } + + q := req.URL.Query() + q.Add("pretty", "true") + req.URL.RawQuery = q.Encode() + + resp, err := os.client.Client.Transport.Perform(req) + if err != nil { + return "", err + } + defer func() { + if closeErr := resp.Body.Close(); closeErr != nil { + klog.Errorf("failed to close response body for GetClusterStatus, reason: %s", closeErr) + } + }() + + if resp.StatusCode != http.StatusOK { + return "", fmt.Errorf("cluster health request failed with status code: %d", resp.StatusCode) + } + + response := make(map[string]any) + if err := json.NewDecoder(resp.Body).Decode(&response); err != nil { + return "", errors.Wrap(err, "failed to parse the response body") + } + if value, ok := response["status"]; ok { + if strValue, ok := value.(string); ok { + return strValue, nil + } + } + return "", errors.New("status is missing") +} + +func (os *OSClientV3) CountIndex() (int, error) { + req, err := http.NewRequest(http.MethodGet, "/_all/_settings", nil) + if err != nil { + return 0, err + } + + q := req.URL.Query() + q.Add("pretty", "true") + q.Add("human", "true") + req.URL.RawQuery = q.Encode() + + res, err := os.client.Client.Transport.Perform(req) + if err != nil { + return 0, err + } + defer func() { + if closeErr := res.Body.Close(); closeErr != nil { + klog.Errorf("failed to close response body from CountIndex, reason: %s", closeErr) + } + }() + + if res.StatusCode < 200 || res.StatusCode >= 300 { + return 0, fmt.Errorf("received status code: %d", res.StatusCode) + } + + response := make(map[string]any) + if err2 := json.NewDecoder(res.Body).Decode(&response); err2 != nil { + return 0, errors.Wrap(err2, "failed to parse the response body") + } + return len(response), nil +} + +func (os *OSClientV3) GetData(_index, _type, _id string) (map[string]any, error) { + path := fmt.Sprintf("/%s/_doc/%s", _index, _id) + req, err := http.NewRequest(http.MethodGet, path, nil) + if err != nil { + return nil, err + } + + q := req.URL.Query() + q.Add("pretty", "true") + q.Add("human", "true") + req.URL.RawQuery = q.Encode() + + res, err := os.client.Client.Transport.Perform(req) + if err != nil { + return nil, err + } + defer func() { + if closeErr := res.Body.Close(); closeErr != nil { + klog.Errorf("failed to close response body from Get Data, reason: %s", closeErr) + } + }() + + if res.StatusCode < 200 || res.StatusCode >= 300 { + return nil, fmt.Errorf("received status code: %d", res.StatusCode) + } + + response := make(map[string]any) + if err2 := json.NewDecoder(res.Body).Decode(&response); err2 != nil { + return nil, errors.Wrap(err2, "failed to parse the response body") + } + + return response, nil +} + +func (os *OSClientV3) CountNodes() (int64, error) { + req, err := http.NewRequest(http.MethodGet, "/_nodes", nil) + if err != nil { + return -1, err + } + + resp, err := os.client.Client.Transport.Perform(req) + if err != nil { + return -1, err + } + defer func() { + if closeErr := resp.Body.Close(); closeErr != nil { + klog.Errorf("failed to close response body from CountNodes, reason: %s", closeErr) + } + }() + + if resp.StatusCode != http.StatusOK { + return -1, fmt.Errorf("nodes info request failed with status code: %d", resp.StatusCode) + } + + nodeInfo := new(NodeInfo) + if err := json.NewDecoder(resp.Body).Decode(&nodeInfo); err != nil { + return -1, errors.Wrap(err, "failed to deserialize the response") + } + + if nodeInfo.Nodes.Total == "" { + return -1, errors.New("Node count is empty") + } + + return nodeInfo.Nodes.Total.Int64() +} + +func (os *OSClientV3) AddVotingConfigExclusions(nodes []string) error { + nodeNames := strings.Join(nodes, ",") + + req, err := http.NewRequest(http.MethodPost, "/_cluster/voting_config_exclusions", nil) + if err != nil { + return err + } + + q := req.URL.Query() + q.Add("node_names", nodeNames) + req.URL.RawQuery = q.Encode() + + res, err := os.client.Client.Transport.Perform(req) + if err != nil { + return err + } + + defer func() { + if closeErr := res.Body.Close(); closeErr != nil { + klog.Errorf("failed to close response body from AddVotingConfigExclusions, reason: %s", closeErr) + } + }() + + if res.StatusCode < 200 || res.StatusCode >= 300 { + return fmt.Errorf("failed with response.StatusCode: %d", res.StatusCode) + } + return nil +} + +func (os *OSClientV3) DeleteVotingConfigExclusions() error { + req, err := http.NewRequest(http.MethodDelete, VotingExclusionUrl, nil) + if err != nil { + return err + } + + resp, err := os.client.Client.Transport.Perform(req) + if err != nil { + return err + } + defer func() { + if closeErr := resp.Body.Close(); closeErr != nil { + klog.Errorf("failed to close response body for DeleteVotingConfigExclusions, reason: %s", closeErr) + } + }() + + if resp.StatusCode > 299 { + return fmt.Errorf("failed with response.StatusCode: %d", resp.StatusCode) + } + return nil +} + +func (os *OSClientV3) ExcludeNodeAllocation(nodes []string) error { + list := strings.Join(nodes, ",") + var body bytes.Buffer + t, err := template.New("").Parse(ExcludeNodeAllocation) + if err != nil { + return errors.Wrap(err, "failed to parse the template") + } + + if err := t.Execute(&body, list); err != nil { + return err + } + + req, err := http.NewRequest(http.MethodPut, "/_cluster/settings", bytes.NewReader(body.Bytes())) + if err != nil { + return err + } + + q := req.URL.Query() + q.Add("pretty", "true") + q.Add("human", "true") + req.URL.RawQuery = q.Encode() + + req.Header.Set("Content-Type", "application/json") + + resp, err := os.client.Client.Transport.Perform(req) + if err != nil { + return err + } + defer func() { + if closeErr := resp.Body.Close(); closeErr != nil { + klog.Errorf("failed to close response body from ExcludenodeAllocation, reason: %s", closeErr) + } + }() + + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + return fmt.Errorf("received status code: %d", resp.StatusCode) + } + + return nil +} + +func (os *OSClientV3) DeleteNodeAllocationExclusion() error { + var b strings.Builder + b.WriteString(DeleteNodeAllocationExclusion) + + req, err := http.NewRequest(http.MethodPut, "/_cluster/settings", strings.NewReader(b.String())) + if err != nil { + return err + } + + q := req.URL.Query() + q.Add("pretty", "true") + q.Add("human", "true") + req.URL.RawQuery = q.Encode() + + req.Header.Set("Content-Type", "application/json") + + resp, err := os.client.Client.Transport.Perform(req) + if err != nil { + return err + } + defer func() { + if closeErr := resp.Body.Close(); closeErr != nil { + klog.Errorf("failed to close response body from DeleteNodeAllocation reason: %s", closeErr) + } + }() + + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + return fmt.Errorf("received status code: %d", resp.StatusCode) + } + + return nil +} + +func (os *OSClientV3) GetUsedDataNodes() ([]string, error) { + req, err := http.NewRequest(http.MethodGet, "/_cat/shards", nil) + if err != nil { + return nil, err + } + + q := req.URL.Query() + q.Add("format", "json") + q.Add("h", "index,node") + req.URL.RawQuery = q.Encode() + + resp, err := os.client.Client.Transport.Perform(req) + if err != nil { + return nil, err + } + defer func() { + if closeErr := resp.Body.Close(); closeErr != nil { + klog.Errorf("failed to close response body from GetusedDataNode, reason: %s", closeErr) + } + }() + + if resp.StatusCode != http.StatusOK { + return nil, fmt.Errorf("cat shards request failed with status code: %d", resp.StatusCode) + } + + data, err := io.ReadAll(resp.Body) + if err != nil { + return nil, err + } + var list []IndexDistribution + err = json.Unmarshal(data, &list) + if err != nil { + return nil, err + } + + var nodes []string + for _, value := range list { + if !IsIgnorableIndex(value.Index) { + nodes = append(nodes, value.Node) + } + } + return nodes, nil +} + +func (os *OSClientV3) AssignedShardsSize(node string) (int64, error) { + path := fmt.Sprintf("/_nodes/%s/stats", node) + req, err := http.NewRequest(http.MethodGet, path, nil) + if err != nil { + return 0, err + } + q := req.URL.Query() + q.Add("pretty", "true") + q.Add("human", "true") + req.URL.RawQuery = q.Encode() + + resp, err := os.client.Client.Transport.Perform(req) + if err != nil { + return 0, err + } + defer func() { + if closeErr := resp.Body.Close(); closeErr != nil { + klog.Errorf("failed to close response body from AssignShardsize, reason: %s", closeErr) + } + }() + + if resp.StatusCode != http.StatusOK { + return 0, fmt.Errorf("nodes stats request failed with status code: %d", resp.StatusCode) + } + + response := new(NodesStats) + if err := json.NewDecoder(resp.Body).Decode(&response); err != nil { + return 0, err + } + + for _, value := range response.Nodes { + return value.Indices.Store.SizeInBytes, nil + } + return 0, errors.New("empty response body") +} + +// EnableUpgradeModeML enables upgrade modes for ML nodes. +func (os *OSClientV3) EnableUpgradeModeML() error { + return nil +} + +// DisableUpgradeModeML disables upgrade modes for ML nodes. +func (os *OSClientV3) DisableUpgradeModeML() error { + return nil +} diff --git a/vendor/kubeops.dev/csi-driver-cacerts/apis/cacerts/v1alpha1/openapi_generated.go b/vendor/kubeops.dev/csi-driver-cacerts/apis/cacerts/v1alpha1/openapi_generated.go index f0b38662b..8fb14f0f3 100644 --- a/vendor/kubeops.dev/csi-driver-cacerts/apis/cacerts/v1alpha1/openapi_generated.go +++ b/vendor/kubeops.dev/csi-driver-cacerts/apis/cacerts/v1alpha1/openapi_generated.go @@ -94,9 +94,12 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/api/core/v1.ConfigMapProjection": schema_k8sio_api_core_v1_ConfigMapProjection(ref), "k8s.io/api/core/v1.ConfigMapVolumeSource": schema_k8sio_api_core_v1_ConfigMapVolumeSource(ref), "k8s.io/api/core/v1.Container": schema_k8sio_api_core_v1_Container(ref), + "k8s.io/api/core/v1.ContainerExtendedResourceRequest": schema_k8sio_api_core_v1_ContainerExtendedResourceRequest(ref), "k8s.io/api/core/v1.ContainerImage": schema_k8sio_api_core_v1_ContainerImage(ref), "k8s.io/api/core/v1.ContainerPort": schema_k8sio_api_core_v1_ContainerPort(ref), "k8s.io/api/core/v1.ContainerResizePolicy": schema_k8sio_api_core_v1_ContainerResizePolicy(ref), + "k8s.io/api/core/v1.ContainerRestartRule": schema_k8sio_api_core_v1_ContainerRestartRule(ref), + "k8s.io/api/core/v1.ContainerRestartRuleOnExitCodes": schema_k8sio_api_core_v1_ContainerRestartRuleOnExitCodes(ref), "k8s.io/api/core/v1.ContainerState": schema_k8sio_api_core_v1_ContainerState(ref), "k8s.io/api/core/v1.ContainerStateRunning": schema_k8sio_api_core_v1_ContainerStateRunning(ref), "k8s.io/api/core/v1.ContainerStateTerminated": schema_k8sio_api_core_v1_ContainerStateTerminated(ref), @@ -125,6 +128,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/api/core/v1.EventSource": schema_k8sio_api_core_v1_EventSource(ref), "k8s.io/api/core/v1.ExecAction": schema_k8sio_api_core_v1_ExecAction(ref), "k8s.io/api/core/v1.FCVolumeSource": schema_k8sio_api_core_v1_FCVolumeSource(ref), + "k8s.io/api/core/v1.FileKeySelector": schema_k8sio_api_core_v1_FileKeySelector(ref), "k8s.io/api/core/v1.FlexPersistentVolumeSource": schema_k8sio_api_core_v1_FlexPersistentVolumeSource(ref), "k8s.io/api/core/v1.FlexVolumeSource": schema_k8sio_api_core_v1_FlexVolumeSource(ref), "k8s.io/api/core/v1.FlockerVolumeSource": schema_k8sio_api_core_v1_FlockerVolumeSource(ref), @@ -178,6 +182,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/api/core/v1.NodeSelectorTerm": schema_k8sio_api_core_v1_NodeSelectorTerm(ref), "k8s.io/api/core/v1.NodeSpec": schema_k8sio_api_core_v1_NodeSpec(ref), "k8s.io/api/core/v1.NodeStatus": schema_k8sio_api_core_v1_NodeStatus(ref), + "k8s.io/api/core/v1.NodeSwapStatus": schema_k8sio_api_core_v1_NodeSwapStatus(ref), "k8s.io/api/core/v1.NodeSystemInfo": schema_k8sio_api_core_v1_NodeSystemInfo(ref), "k8s.io/api/core/v1.ObjectFieldSelector": schema_k8sio_api_core_v1_ObjectFieldSelector(ref), "k8s.io/api/core/v1.ObjectReference": schema_k8sio_api_core_v1_ObjectReference(ref), @@ -199,10 +204,12 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "k8s.io/api/core/v1.PodAffinityTerm": schema_k8sio_api_core_v1_PodAffinityTerm(ref), "k8s.io/api/core/v1.PodAntiAffinity": schema_k8sio_api_core_v1_PodAntiAffinity(ref), "k8s.io/api/core/v1.PodAttachOptions": schema_k8sio_api_core_v1_PodAttachOptions(ref), + "k8s.io/api/core/v1.PodCertificateProjection": schema_k8sio_api_core_v1_PodCertificateProjection(ref), "k8s.io/api/core/v1.PodCondition": schema_k8sio_api_core_v1_PodCondition(ref), "k8s.io/api/core/v1.PodDNSConfig": schema_k8sio_api_core_v1_PodDNSConfig(ref), "k8s.io/api/core/v1.PodDNSConfigOption": schema_k8sio_api_core_v1_PodDNSConfigOption(ref), "k8s.io/api/core/v1.PodExecOptions": schema_k8sio_api_core_v1_PodExecOptions(ref), + "k8s.io/api/core/v1.PodExtendedResourceClaimStatus": schema_k8sio_api_core_v1_PodExtendedResourceClaimStatus(ref), "k8s.io/api/core/v1.PodIP": schema_k8sio_api_core_v1_PodIP(ref), "k8s.io/api/core/v1.PodList": schema_k8sio_api_core_v1_PodList(ref), "k8s.io/api/core/v1.PodLogOptions": schema_k8sio_api_core_v1_PodLogOptions(ref), @@ -1086,28 +1093,28 @@ func schema_k8sio_api_apps_v1_DeploymentStatus(ref common.ReferenceCallback) com }, "replicas": { SchemaProps: spec.SchemaProps{ - Description: "Total number of non-terminated pods targeted by this deployment (their labels match the selector).", + Description: "Total number of non-terminating pods targeted by this deployment (their labels match the selector).", Type: []string{"integer"}, Format: "int32", }, }, "updatedReplicas": { SchemaProps: spec.SchemaProps{ - Description: "Total number of non-terminated pods targeted by this deployment that have the desired template spec.", + Description: "Total number of non-terminating pods targeted by this deployment that have the desired template spec.", Type: []string{"integer"}, Format: "int32", }, }, "readyReplicas": { SchemaProps: spec.SchemaProps{ - Description: "readyReplicas is the number of pods targeted by this Deployment with a Ready Condition.", + Description: "Total number of non-terminating pods targeted by this Deployment with a Ready Condition.", Type: []string{"integer"}, Format: "int32", }, }, "availableReplicas": { SchemaProps: spec.SchemaProps{ - Description: "Total number of available pods (ready for at least minReadySeconds) targeted by this deployment.", + Description: "Total number of available non-terminating pods (ready for at least minReadySeconds) targeted by this deployment.", Type: []string{"integer"}, Format: "int32", }, @@ -1119,6 +1126,13 @@ func schema_k8sio_api_apps_v1_DeploymentStatus(ref common.ReferenceCallback) com Format: "int32", }, }, + "terminatingReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "Total number of terminating pods targeted by this deployment. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.", + Type: []string{"integer"}, + Format: "int32", + }, + }, "conditions": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ @@ -1319,7 +1333,7 @@ func schema_k8sio_api_apps_v1_ReplicaSetList(ref common.ReferenceCallback) commo }, "items": { SchemaProps: spec.SchemaProps{ - Description: "List of ReplicaSets. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller", + Description: "List of ReplicaSets. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -1349,7 +1363,7 @@ func schema_k8sio_api_apps_v1_ReplicaSetSpec(ref common.ReferenceCallback) commo Properties: map[string]spec.Schema{ "replicas": { SchemaProps: spec.SchemaProps{ - Description: "Replicas is the number of desired replicas. This is a pointer to distinguish between explicit zero and unspecified. Defaults to 1. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller", + Description: "Replicas is the number of desired pods. This is a pointer to distinguish between explicit zero and unspecified. Defaults to 1. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset", Type: []string{"integer"}, Format: "int32", }, @@ -1369,7 +1383,7 @@ func schema_k8sio_api_apps_v1_ReplicaSetSpec(ref common.ReferenceCallback) commo }, "template": { SchemaProps: spec.SchemaProps{ - Description: "Template is the object that describes the pod that will be created if insufficient replicas are detected. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template", + Description: "Template is the object that describes the pod that will be created if insufficient replicas are detected. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/#pod-template", Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.PodTemplateSpec"), }, @@ -1392,7 +1406,7 @@ func schema_k8sio_api_apps_v1_ReplicaSetStatus(ref common.ReferenceCallback) com Properties: map[string]spec.Schema{ "replicas": { SchemaProps: spec.SchemaProps{ - Description: "Replicas is the most recently observed number of replicas. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#what-is-a-replicationcontroller", + Description: "Replicas is the most recently observed number of non-terminating pods. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset", Default: 0, Type: []string{"integer"}, Format: "int32", @@ -1400,21 +1414,28 @@ func schema_k8sio_api_apps_v1_ReplicaSetStatus(ref common.ReferenceCallback) com }, "fullyLabeledReplicas": { SchemaProps: spec.SchemaProps{ - Description: "The number of pods that have labels matching the labels of the pod template of the replicaset.", + Description: "The number of non-terminating pods that have labels matching the labels of the pod template of the replicaset.", Type: []string{"integer"}, Format: "int32", }, }, "readyReplicas": { SchemaProps: spec.SchemaProps{ - Description: "readyReplicas is the number of pods targeted by this ReplicaSet with a Ready Condition.", + Description: "The number of non-terminating pods targeted by this ReplicaSet with a Ready Condition.", Type: []string{"integer"}, Format: "int32", }, }, "availableReplicas": { SchemaProps: spec.SchemaProps{ - Description: "The number of available replicas (ready for at least minReadySeconds) for this replica set.", + Description: "The number of available non-terminating pods (ready for at least minReadySeconds) for this replica set.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "terminatingReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "The number of terminating pods for this replica set. Terminating pods have a non-null .metadata.deletionTimestamp and have not yet reached the Failed or Succeeded .status.phase.\n\nThis is an alpha field. Enable DeploymentReplicaSetTerminatingReplicas to be able to use this field.", Type: []string{"integer"}, Format: "int32", }, @@ -1474,7 +1495,7 @@ func schema_k8sio_api_apps_v1_RollingUpdateDaemonSet(ref common.ReferenceCallbac }, "maxSurge": { SchemaProps: spec.SchemaProps{ - Description: "The maximum number of nodes with an existing available DaemonSet pod that can have an updated DaemonSet pod during during an update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up to a minimum of 1. Default value is 0. Example: when this is set to 30%, at most 30% of the total number of nodes that should be running the daemon pod (i.e. status.desiredNumberScheduled) can have their a new pod created before the old pod is marked as deleted. The update starts by launching new pods on 30% of nodes. Once an updated pod is available (Ready for at least minReadySeconds) the old DaemonSet pod on that node is marked deleted. If the old pod becomes unavailable for any reason (Ready transitions to false, is evicted, or is drained) an updated pod is immediatedly created on that node without considering surge limits. Allowing surge implies the possibility that the resources consumed by the daemonset on any given node can double if the readiness check fails, and so resource intensive daemonsets should take into account that they may cause evictions during disruption.", + Description: "The maximum number of nodes with an existing available DaemonSet pod that can have an updated DaemonSet pod during during an update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up to a minimum of 1. Default value is 0. Example: when this is set to 30%, at most 30% of the total number of nodes that should be running the daemon pod (i.e. status.desiredNumberScheduled) can have their a new pod created before the old pod is marked as deleted. The update starts by launching new pods on 30% of nodes. Once an updated pod is available (Ready for at least minReadySeconds) the old DaemonSet pod on that node is marked deleted. If the old pod becomes unavailable for any reason (Ready transitions to false, is evicted, or is drained) an updated pod is immediately created on that node without considering surge limits. Allowing surge implies the possibility that the resources consumed by the daemonset on any given node can double if the readiness check fails, and so resource intensive daemonsets should take into account that they may cause evictions during disruption.", Ref: ref("k8s.io/apimachinery/pkg/util/intstr.IntOrString"), }, }, @@ -1838,7 +1859,7 @@ func schema_k8sio_api_apps_v1_StatefulSetSpec(ref common.ReferenceCallback) comm }, }, }, - Required: []string{"selector", "template", "serviceName"}, + Required: []string{"selector", "template"}, }, }, Dependencies: []string{ @@ -3463,7 +3484,7 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope }, }, SchemaProps: spec.SchemaProps{ - Description: "List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.", + Description: "List of sources to populate environment variables in the container. The keys defined within a source may consist of any printable ASCII characters except '='. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -3527,11 +3548,30 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope }, "restartPolicy": { SchemaProps: spec.SchemaProps{ - Description: "RestartPolicy defines the restart behavior of individual containers in a pod. This field may only be set for init containers, and the only allowed value is \"Always\". For non-init containers or when this field is not specified, the restart behavior is defined by the Pod's restart policy and the container type. Setting the RestartPolicy as \"Always\" for the init container will have the following effect: this init container will be continually restarted on exit until all regular containers have terminated. Once all regular containers have completed, all init containers with restartPolicy \"Always\" will be shut down. This lifecycle differs from normal init containers and is often referred to as a \"sidecar\" container. Although this init container still starts in the init container sequence, it does not wait for the container to complete before proceeding to the next init container. Instead, the next init container starts immediately after this init container is started, or after any startupProbe has successfully completed.", + Description: "RestartPolicy defines the restart behavior of individual containers in a pod. This overrides the pod-level restart policy. When this field is not specified, the restart behavior is defined by the Pod's restart policy and the container type. Additionally, setting the RestartPolicy as \"Always\" for the init container will have the following effect: this init container will be continually restarted on exit until all regular containers have terminated. Once all regular containers have completed, all init containers with restartPolicy \"Always\" will be shut down. This lifecycle differs from normal init containers and is often referred to as a \"sidecar\" container. Although this init container still starts in the init container sequence, it does not wait for the container to complete before proceeding to the next init container. Instead, the next init container starts immediately after this init container is started, or after any startupProbe has successfully completed.", Type: []string{"string"}, Format: "", }, }, + "restartPolicyRules": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "Represents a list of rules to be checked to determine if the container should be restarted on exit. The rules are evaluated in order. Once a rule matches a container exit condition, the remaining rules are ignored. If no rule matches the container exit condition, the Container-level restart policy determines the whether the container is restarted or not. Constraints on the rules: - At most 20 rules are allowed. - Rules can have the same action. - Identical rules are not forbidden in validations. When rules are specified, container MUST set RestartPolicy explicitly even it if matches the Pod's RestartPolicy.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.ContainerRestartRule"), + }, + }, + }, + }, + }, "volumeMounts": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ @@ -3659,7 +3699,45 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ContainerPort", "k8s.io/api/core/v1.ContainerResizePolicy", "k8s.io/api/core/v1.EnvFromSource", "k8s.io/api/core/v1.EnvVar", "k8s.io/api/core/v1.Lifecycle", "k8s.io/api/core/v1.Probe", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.SecurityContext", "k8s.io/api/core/v1.VolumeDevice", "k8s.io/api/core/v1.VolumeMount"}, + "k8s.io/api/core/v1.ContainerPort", "k8s.io/api/core/v1.ContainerResizePolicy", "k8s.io/api/core/v1.ContainerRestartRule", "k8s.io/api/core/v1.EnvFromSource", "k8s.io/api/core/v1.EnvVar", "k8s.io/api/core/v1.Lifecycle", "k8s.io/api/core/v1.Probe", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.SecurityContext", "k8s.io/api/core/v1.VolumeDevice", "k8s.io/api/core/v1.VolumeMount"}, + } +} + +func schema_k8sio_api_core_v1_ContainerExtendedResourceRequest(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ContainerExtendedResourceRequest has the mapping of container name, extended resource name to the device request name.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "containerName": { + SchemaProps: spec.SchemaProps{ + Description: "The name of the container requesting resources.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "resourceName": { + SchemaProps: spec.SchemaProps{ + Description: "The name of the extended resource in that container which gets backed by DRA.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "requestName": { + SchemaProps: spec.SchemaProps{ + Description: "The name of the request in the special ResourceClaim which corresponds to the extended resource.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"containerName", "resourceName", "requestName"}, + }, + }, } } @@ -3785,6 +3863,74 @@ func schema_k8sio_api_core_v1_ContainerResizePolicy(ref common.ReferenceCallback } } +func schema_k8sio_api_core_v1_ContainerRestartRule(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ContainerRestartRule describes how a container exit is handled.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "action": { + SchemaProps: spec.SchemaProps{ + Description: "Specifies the action taken on a container exit if the requirements are satisfied. The only possible value is \"Restart\" to restart the container.", + Type: []string{"string"}, + Format: "", + }, + }, + "exitCodes": { + SchemaProps: spec.SchemaProps{ + Description: "Represents the exit codes to check on container exits.", + Ref: ref("k8s.io/api/core/v1.ContainerRestartRuleOnExitCodes"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.ContainerRestartRuleOnExitCodes"}, + } +} + +func schema_k8sio_api_core_v1_ContainerRestartRuleOnExitCodes(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ContainerRestartRuleOnExitCodes describes the condition for handling an exited container based on its exit codes.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "operator": { + SchemaProps: spec.SchemaProps{ + Description: "Represents the relationship between the container exit code(s) and the specified values. Possible values are: - In: the requirement is satisfied if the container exit code is in the\n set of specified values.\n- NotIn: the requirement is satisfied if the container exit code is\n not in the set of specified values.", + Type: []string{"string"}, + Format: "", + }, + }, + "values": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "set", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "Specifies the set of values to check for container exit codes. At most 255 elements are allowed.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: 0, + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + }, + }, + }, + }, + }, + } +} + func schema_k8sio_api_core_v1_ContainerState(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -4079,6 +4225,14 @@ func schema_k8sio_api_core_v1_ContainerStatus(ref common.ReferenceCallback) comm }, }, }, + "stopSignal": { + SchemaProps: spec.SchemaProps{ + Description: "StopSignal reports the effective stop signal for this container\n\nPossible enum values:\n - `\"SIGABRT\"`\n - `\"SIGALRM\"`\n - `\"SIGBUS\"`\n - `\"SIGCHLD\"`\n - `\"SIGCLD\"`\n - `\"SIGCONT\"`\n - `\"SIGFPE\"`\n - `\"SIGHUP\"`\n - `\"SIGILL\"`\n - `\"SIGINT\"`\n - `\"SIGIO\"`\n - `\"SIGIOT\"`\n - `\"SIGKILL\"`\n - `\"SIGPIPE\"`\n - `\"SIGPOLL\"`\n - `\"SIGPROF\"`\n - `\"SIGPWR\"`\n - `\"SIGQUIT\"`\n - `\"SIGRTMAX\"`\n - `\"SIGRTMAX-1\"`\n - `\"SIGRTMAX-10\"`\n - `\"SIGRTMAX-11\"`\n - `\"SIGRTMAX-12\"`\n - `\"SIGRTMAX-13\"`\n - `\"SIGRTMAX-14\"`\n - `\"SIGRTMAX-2\"`\n - `\"SIGRTMAX-3\"`\n - `\"SIGRTMAX-4\"`\n - `\"SIGRTMAX-5\"`\n - `\"SIGRTMAX-6\"`\n - `\"SIGRTMAX-7\"`\n - `\"SIGRTMAX-8\"`\n - `\"SIGRTMAX-9\"`\n - `\"SIGRTMIN\"`\n - `\"SIGRTMIN+1\"`\n - `\"SIGRTMIN+10\"`\n - `\"SIGRTMIN+11\"`\n - `\"SIGRTMIN+12\"`\n - `\"SIGRTMIN+13\"`\n - `\"SIGRTMIN+14\"`\n - `\"SIGRTMIN+15\"`\n - `\"SIGRTMIN+2\"`\n - `\"SIGRTMIN+3\"`\n - `\"SIGRTMIN+4\"`\n - `\"SIGRTMIN+5\"`\n - `\"SIGRTMIN+6\"`\n - `\"SIGRTMIN+7\"`\n - `\"SIGRTMIN+8\"`\n - `\"SIGRTMIN+9\"`\n - `\"SIGSEGV\"`\n - `\"SIGSTKFLT\"`\n - `\"SIGSTOP\"`\n - `\"SIGSYS\"`\n - `\"SIGTERM\"`\n - `\"SIGTRAP\"`\n - `\"SIGTSTP\"`\n - `\"SIGTTIN\"`\n - `\"SIGTTOU\"`\n - `\"SIGURG\"`\n - `\"SIGUSR1\"`\n - `\"SIGUSR2\"`\n - `\"SIGVTALRM\"`\n - `\"SIGWINCH\"`\n - `\"SIGXCPU\"`\n - `\"SIGXFSZ\"`", + Type: []string{"string"}, + Format: "", + Enum: []interface{}{"SIGABRT", "SIGALRM", "SIGBUS", "SIGCHLD", "SIGCLD", "SIGCONT", "SIGFPE", "SIGHUP", "SIGILL", "SIGINT", "SIGIO", "SIGIOT", "SIGKILL", "SIGPIPE", "SIGPOLL", "SIGPROF", "SIGPWR", "SIGQUIT", "SIGRTMAX", "SIGRTMAX-1", "SIGRTMAX-10", "SIGRTMAX-11", "SIGRTMAX-12", "SIGRTMAX-13", "SIGRTMAX-14", "SIGRTMAX-2", "SIGRTMAX-3", "SIGRTMAX-4", "SIGRTMAX-5", "SIGRTMAX-6", "SIGRTMAX-7", "SIGRTMAX-8", "SIGRTMAX-9", "SIGRTMIN", "SIGRTMIN+1", "SIGRTMIN+10", "SIGRTMIN+11", "SIGRTMIN+12", "SIGRTMIN+13", "SIGRTMIN+14", "SIGRTMIN+15", "SIGRTMIN+2", "SIGRTMIN+3", "SIGRTMIN+4", "SIGRTMIN+5", "SIGRTMIN+6", "SIGRTMIN+7", "SIGRTMIN+8", "SIGRTMIN+9", "SIGSEGV", "SIGSTKFLT", "SIGSTOP", "SIGSYS", "SIGTERM", "SIGTRAP", "SIGTSTP", "SIGTTIN", "SIGTTOU", "SIGURG", "SIGUSR1", "SIGUSR2", "SIGVTALRM", "SIGWINCH", "SIGXCPU", "SIGXFSZ"}, + }, + }, }, Required: []string{"name", "ready", "restartCount", "image", "imageID"}, }, @@ -4281,7 +4435,7 @@ func schema_k8sio_api_core_v1_EndpointAddress(ref common.ReferenceCallback) comm return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "EndpointAddress is a tuple that describes single IP address.", + Description: "EndpointAddress is a tuple that describes single IP address. Deprecated: This API is deprecated in v1.33+.", Type: []string{"object"}, Properties: map[string]spec.Schema{ "ip": { @@ -4330,7 +4484,7 @@ func schema_k8sio_api_core_v1_EndpointPort(ref common.ReferenceCallback) common. return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "EndpointPort is a tuple that describes a single port.", + Description: "EndpointPort is a tuple that describes a single port. Deprecated: This API is deprecated in v1.33+.", Type: []string{"object"}, Properties: map[string]spec.Schema{ "name": { @@ -4379,7 +4533,7 @@ func schema_k8sio_api_core_v1_EndpointSubset(ref common.ReferenceCallback) commo return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "EndpointSubset is a group of addresses with a common set of ports. The expanded set of endpoints is the Cartesian product of Addresses x Ports. For example, given:\n\n\t{\n\t Addresses: [{\"ip\": \"10.10.1.1\"}, {\"ip\": \"10.10.2.2\"}],\n\t Ports: [{\"name\": \"a\", \"port\": 8675}, {\"name\": \"b\", \"port\": 309}]\n\t}\n\nThe resulting set of endpoints can be viewed as:\n\n\ta: [ 10.10.1.1:8675, 10.10.2.2:8675 ],\n\tb: [ 10.10.1.1:309, 10.10.2.2:309 ]", + Description: "EndpointSubset is a group of addresses with a common set of ports. The expanded set of endpoints is the Cartesian product of Addresses x Ports. For example, given:\n\n\t{\n\t Addresses: [{\"ip\": \"10.10.1.1\"}, {\"ip\": \"10.10.2.2\"}],\n\t Ports: [{\"name\": \"a\", \"port\": 8675}, {\"name\": \"b\", \"port\": 309}]\n\t}\n\nThe resulting set of endpoints can be viewed as:\n\n\ta: [ 10.10.1.1:8675, 10.10.2.2:8675 ],\n\tb: [ 10.10.1.1:309, 10.10.2.2:309 ]\n\nDeprecated: This API is deprecated in v1.33+.", Type: []string{"object"}, Properties: map[string]spec.Schema{ "addresses": { @@ -4451,7 +4605,7 @@ func schema_k8sio_api_core_v1_Endpoints(ref common.ReferenceCallback) common.Ope return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "Endpoints is a collection of endpoints that implement the actual service. Example:\n\n\t Name: \"mysvc\",\n\t Subsets: [\n\t {\n\t Addresses: [{\"ip\": \"10.10.1.1\"}, {\"ip\": \"10.10.2.2\"}],\n\t Ports: [{\"name\": \"a\", \"port\": 8675}, {\"name\": \"b\", \"port\": 309}]\n\t },\n\t {\n\t Addresses: [{\"ip\": \"10.10.3.3\"}],\n\t Ports: [{\"name\": \"a\", \"port\": 93}, {\"name\": \"b\", \"port\": 76}]\n\t },\n\t]", + Description: "Endpoints is a collection of endpoints that implement the actual service. Example:\n\n\t Name: \"mysvc\",\n\t Subsets: [\n\t {\n\t Addresses: [{\"ip\": \"10.10.1.1\"}, {\"ip\": \"10.10.2.2\"}],\n\t Ports: [{\"name\": \"a\", \"port\": 8675}, {\"name\": \"b\", \"port\": 309}]\n\t },\n\t {\n\t Addresses: [{\"ip\": \"10.10.3.3\"}],\n\t Ports: [{\"name\": \"a\", \"port\": 93}, {\"name\": \"b\", \"port\": 76}]\n\t },\n\t]\n\nEndpoints is a legacy API and does not contain information about all Service features. Use discoveryv1.EndpointSlice for complete information about Service endpoints.\n\nDeprecated: This API is deprecated in v1.33+. Use discoveryv1.EndpointSlice.", Type: []string{"object"}, Properties: map[string]spec.Schema{ "kind": { @@ -4506,7 +4660,7 @@ func schema_k8sio_api_core_v1_EndpointsList(ref common.ReferenceCallback) common return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "EndpointsList is a list of endpoints.", + Description: "EndpointsList is a list of endpoints. Deprecated: This API is deprecated in v1.33+.", Type: []string{"object"}, Properties: map[string]spec.Schema{ "kind": { @@ -4557,12 +4711,12 @@ func schema_k8sio_api_core_v1_EnvFromSource(ref common.ReferenceCallback) common return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "EnvFromSource represents the source of a set of ConfigMaps", + Description: "EnvFromSource represents the source of a set of ConfigMaps or Secrets", Type: []string{"object"}, Properties: map[string]spec.Schema{ "prefix": { SchemaProps: spec.SchemaProps{ - Description: "An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.", + Description: "Optional text to prepend to the name of each environment variable. May consist of any printable ASCII characters except '='.", Type: []string{"string"}, Format: "", }, @@ -4596,7 +4750,7 @@ func schema_k8sio_api_core_v1_EnvVar(ref common.ReferenceCallback) common.OpenAP Properties: map[string]spec.Schema{ "name": { SchemaProps: spec.SchemaProps{ - Description: "Name of the environment variable. Must be a C_IDENTIFIER.", + Description: "Name of the environment variable. May consist of any printable ASCII characters except '='.", Default: "", Type: []string{"string"}, Format: "", @@ -4655,11 +4809,17 @@ func schema_k8sio_api_core_v1_EnvVarSource(ref common.ReferenceCallback) common. Ref: ref("k8s.io/api/core/v1.SecretKeySelector"), }, }, + "fileKeyRef": { + SchemaProps: spec.SchemaProps{ + Description: "FileKeyRef selects a key of the env file. Requires the EnvFiles feature gate to be enabled.", + Ref: ref("k8s.io/api/core/v1.FileKeySelector"), + }, + }, }, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ConfigMapKeySelector", "k8s.io/api/core/v1.ObjectFieldSelector", "k8s.io/api/core/v1.ResourceFieldSelector", "k8s.io/api/core/v1.SecretKeySelector"}, + "k8s.io/api/core/v1.ConfigMapKeySelector", "k8s.io/api/core/v1.FileKeySelector", "k8s.io/api/core/v1.ObjectFieldSelector", "k8s.io/api/core/v1.ResourceFieldSelector", "k8s.io/api/core/v1.SecretKeySelector"}, } } @@ -4764,7 +4924,7 @@ func schema_k8sio_api_core_v1_EphemeralContainer(ref common.ReferenceCallback) c }, }, SchemaProps: spec.SchemaProps{ - Description: "List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.", + Description: "List of sources to populate environment variables in the container. The keys defined within a source may consist of any printable ASCII characters except '='. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -4828,11 +4988,30 @@ func schema_k8sio_api_core_v1_EphemeralContainer(ref common.ReferenceCallback) c }, "restartPolicy": { SchemaProps: spec.SchemaProps{ - Description: "Restart policy for the container to manage the restart behavior of each container within a pod. This may only be set for init containers. You cannot set this field on ephemeral containers.", + Description: "Restart policy for the container to manage the restart behavior of each container within a pod. You cannot set this field on ephemeral containers.", Type: []string{"string"}, Format: "", }, }, + "restartPolicyRules": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "Represents a list of rules to be checked to determine if the container should be restarted on exit. You cannot set this field on ephemeral containers.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.ContainerRestartRule"), + }, + }, + }, + }, + }, "volumeMounts": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ @@ -4967,7 +5146,7 @@ func schema_k8sio_api_core_v1_EphemeralContainer(ref common.ReferenceCallback) c }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ContainerPort", "k8s.io/api/core/v1.ContainerResizePolicy", "k8s.io/api/core/v1.EnvFromSource", "k8s.io/api/core/v1.EnvVar", "k8s.io/api/core/v1.Lifecycle", "k8s.io/api/core/v1.Probe", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.SecurityContext", "k8s.io/api/core/v1.VolumeDevice", "k8s.io/api/core/v1.VolumeMount"}, + "k8s.io/api/core/v1.ContainerPort", "k8s.io/api/core/v1.ContainerResizePolicy", "k8s.io/api/core/v1.ContainerRestartRule", "k8s.io/api/core/v1.EnvFromSource", "k8s.io/api/core/v1.EnvVar", "k8s.io/api/core/v1.Lifecycle", "k8s.io/api/core/v1.Probe", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.SecurityContext", "k8s.io/api/core/v1.VolumeDevice", "k8s.io/api/core/v1.VolumeMount"}, } } @@ -5072,7 +5251,7 @@ func schema_k8sio_api_core_v1_EphemeralContainerCommon(ref common.ReferenceCallb }, }, SchemaProps: spec.SchemaProps{ - Description: "List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.", + Description: "List of sources to populate environment variables in the container. The keys defined within a source may consist of any printable ASCII characters except '='. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -5136,11 +5315,30 @@ func schema_k8sio_api_core_v1_EphemeralContainerCommon(ref common.ReferenceCallb }, "restartPolicy": { SchemaProps: spec.SchemaProps{ - Description: "Restart policy for the container to manage the restart behavior of each container within a pod. This may only be set for init containers. You cannot set this field on ephemeral containers.", + Description: "Restart policy for the container to manage the restart behavior of each container within a pod. You cannot set this field on ephemeral containers.", Type: []string{"string"}, Format: "", }, }, + "restartPolicyRules": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "Represents a list of rules to be checked to determine if the container should be restarted on exit. You cannot set this field on ephemeral containers.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.ContainerRestartRule"), + }, + }, + }, + }, + }, "volumeMounts": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ @@ -5268,7 +5466,7 @@ func schema_k8sio_api_core_v1_EphemeralContainerCommon(ref common.ReferenceCallb }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ContainerPort", "k8s.io/api/core/v1.ContainerResizePolicy", "k8s.io/api/core/v1.EnvFromSource", "k8s.io/api/core/v1.EnvVar", "k8s.io/api/core/v1.Lifecycle", "k8s.io/api/core/v1.Probe", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.SecurityContext", "k8s.io/api/core/v1.VolumeDevice", "k8s.io/api/core/v1.VolumeMount"}, + "k8s.io/api/core/v1.ContainerPort", "k8s.io/api/core/v1.ContainerResizePolicy", "k8s.io/api/core/v1.ContainerRestartRule", "k8s.io/api/core/v1.EnvFromSource", "k8s.io/api/core/v1.EnvVar", "k8s.io/api/core/v1.Lifecycle", "k8s.io/api/core/v1.Probe", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.SecurityContext", "k8s.io/api/core/v1.VolumeDevice", "k8s.io/api/core/v1.VolumeMount"}, } } @@ -5638,6 +5836,57 @@ func schema_k8sio_api_core_v1_FCVolumeSource(ref common.ReferenceCallback) commo } } +func schema_k8sio_api_core_v1_FileKeySelector(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "FileKeySelector selects a key of the env file.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "volumeName": { + SchemaProps: spec.SchemaProps{ + Description: "The name of the volume mount containing the env file.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "path": { + SchemaProps: spec.SchemaProps{ + Description: "The path within the volume from which to select the file. Must be relative and may not contain the '..' path or start with '..'.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "key": { + SchemaProps: spec.SchemaProps{ + Description: "The key within the env file. An invalid key will prevent the pod from starting. The keys defined within a source may consist of any printable ASCII characters except '='. During Alpha stage of the EnvFiles feature gate, the key size is limited to 128 characters.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "optional": { + SchemaProps: spec.SchemaProps{ + Description: "Specify whether the file or its key must be defined. If the file or key does not exist, then the env var is not published. If optional is set to true and the specified key does not exist, the environment variable will not be set in the Pod's containers.\n\nIf optional is set to false and the specified key does not exist, an error will be returned during Pod creation.", + Default: false, + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + Required: []string{"volumeName", "path", "key"}, + }, + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-map-type": "atomic", + }, + }, + }, + } +} + func schema_k8sio_api_core_v1_FlexPersistentVolumeSource(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -5947,7 +6196,7 @@ func schema_k8sio_api_core_v1_GlusterfsVolumeSource(ref common.ReferenceCallback Properties: map[string]spec.Schema{ "endpoints": { SchemaProps: spec.SchemaProps{ - Description: "endpoints is the endpoint name that details Glusterfs topology. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod", + Description: "endpoints is the endpoint name that details Glusterfs topology.", Default: "", Type: []string{"string"}, Format: "", @@ -6464,6 +6713,14 @@ func schema_k8sio_api_core_v1_Lifecycle(ref common.ReferenceCallback) common.Ope Ref: ref("k8s.io/api/core/v1.LifecycleHandler"), }, }, + "stopSignal": { + SchemaProps: spec.SchemaProps{ + Description: "StopSignal defines which signal will be sent to a container when it is being stopped. If not specified, the default is defined by the container runtime in use. StopSignal can only be set for Pods with a non-empty .spec.os.name\n\nPossible enum values:\n - `\"SIGABRT\"`\n - `\"SIGALRM\"`\n - `\"SIGBUS\"`\n - `\"SIGCHLD\"`\n - `\"SIGCLD\"`\n - `\"SIGCONT\"`\n - `\"SIGFPE\"`\n - `\"SIGHUP\"`\n - `\"SIGILL\"`\n - `\"SIGINT\"`\n - `\"SIGIO\"`\n - `\"SIGIOT\"`\n - `\"SIGKILL\"`\n - `\"SIGPIPE\"`\n - `\"SIGPOLL\"`\n - `\"SIGPROF\"`\n - `\"SIGPWR\"`\n - `\"SIGQUIT\"`\n - `\"SIGRTMAX\"`\n - `\"SIGRTMAX-1\"`\n - `\"SIGRTMAX-10\"`\n - `\"SIGRTMAX-11\"`\n - `\"SIGRTMAX-12\"`\n - `\"SIGRTMAX-13\"`\n - `\"SIGRTMAX-14\"`\n - `\"SIGRTMAX-2\"`\n - `\"SIGRTMAX-3\"`\n - `\"SIGRTMAX-4\"`\n - `\"SIGRTMAX-5\"`\n - `\"SIGRTMAX-6\"`\n - `\"SIGRTMAX-7\"`\n - `\"SIGRTMAX-8\"`\n - `\"SIGRTMAX-9\"`\n - `\"SIGRTMIN\"`\n - `\"SIGRTMIN+1\"`\n - `\"SIGRTMIN+10\"`\n - `\"SIGRTMIN+11\"`\n - `\"SIGRTMIN+12\"`\n - `\"SIGRTMIN+13\"`\n - `\"SIGRTMIN+14\"`\n - `\"SIGRTMIN+15\"`\n - `\"SIGRTMIN+2\"`\n - `\"SIGRTMIN+3\"`\n - `\"SIGRTMIN+4\"`\n - `\"SIGRTMIN+5\"`\n - `\"SIGRTMIN+6\"`\n - `\"SIGRTMIN+7\"`\n - `\"SIGRTMIN+8\"`\n - `\"SIGRTMIN+9\"`\n - `\"SIGSEGV\"`\n - `\"SIGSTKFLT\"`\n - `\"SIGSTOP\"`\n - `\"SIGSYS\"`\n - `\"SIGTERM\"`\n - `\"SIGTRAP\"`\n - `\"SIGTSTP\"`\n - `\"SIGTTIN\"`\n - `\"SIGTTOU\"`\n - `\"SIGURG\"`\n - `\"SIGUSR1\"`\n - `\"SIGUSR2\"`\n - `\"SIGVTALRM\"`\n - `\"SIGWINCH\"`\n - `\"SIGXCPU\"`\n - `\"SIGXFSZ\"`", + Type: []string{"string"}, + Format: "", + Enum: []interface{}{"SIGABRT", "SIGALRM", "SIGBUS", "SIGCHLD", "SIGCLD", "SIGCONT", "SIGFPE", "SIGHUP", "SIGILL", "SIGINT", "SIGIO", "SIGIOT", "SIGKILL", "SIGPIPE", "SIGPOLL", "SIGPROF", "SIGPWR", "SIGQUIT", "SIGRTMAX", "SIGRTMAX-1", "SIGRTMAX-10", "SIGRTMAX-11", "SIGRTMAX-12", "SIGRTMAX-13", "SIGRTMAX-14", "SIGRTMAX-2", "SIGRTMAX-3", "SIGRTMAX-4", "SIGRTMAX-5", "SIGRTMAX-6", "SIGRTMAX-7", "SIGRTMAX-8", "SIGRTMAX-9", "SIGRTMIN", "SIGRTMIN+1", "SIGRTMIN+10", "SIGRTMIN+11", "SIGRTMIN+12", "SIGRTMIN+13", "SIGRTMIN+14", "SIGRTMIN+15", "SIGRTMIN+2", "SIGRTMIN+3", "SIGRTMIN+4", "SIGRTMIN+5", "SIGRTMIN+6", "SIGRTMIN+7", "SIGRTMIN+8", "SIGRTMIN+9", "SIGSEGV", "SIGSTKFLT", "SIGSTOP", "SIGSYS", "SIGTERM", "SIGTRAP", "SIGTSTP", "SIGTTIN", "SIGTTOU", "SIGURG", "SIGUSR1", "SIGUSR2", "SIGVTALRM", "SIGWINCH", "SIGXCPU", "SIGXFSZ"}, + }, + }, }, }, }, @@ -8140,6 +8397,26 @@ func schema_k8sio_api_core_v1_NodeStatus(ref common.ReferenceCallback) common.Op } } +func schema_k8sio_api_core_v1_NodeSwapStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NodeSwapStatus represents swap memory information.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "capacity": { + SchemaProps: spec.SchemaProps{ + Description: "Total amount of swap memory in bytes.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + }, + }, + }, + } +} + func schema_k8sio_api_core_v1_NodeSystemInfo(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -8227,10 +8504,18 @@ func schema_k8sio_api_core_v1_NodeSystemInfo(ref common.ReferenceCallback) commo Format: "", }, }, + "swap": { + SchemaProps: spec.SchemaProps{ + Description: "Swap Info reported by the node.", + Ref: ref("k8s.io/api/core/v1.NodeSwapStatus"), + }, + }, }, Required: []string{"machineID", "systemUUID", "bootID", "kernelVersion", "osImage", "containerRuntimeVersion", "kubeletVersion", "kubeProxyVersion", "operatingSystem", "architecture"}, }, }, + Dependencies: []string{ + "k8s.io/api/core/v1.NodeSwapStatus"}, } } @@ -8620,7 +8905,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimSpec(ref common.ReferenceCall }, "volumeAttributesClassName": { SchemaProps: spec.SchemaProps{ - Description: "volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim. If specified, the CSI driver will create or update the volume with the attributes defined in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName, it can be changed after the claim is created. An empty string value means that no VolumeAttributesClass will be applied to the claim but it's not allowed to reset this field to empty string once it is set. If unspecified and the PersistentVolumeClaim is unbound, the default VolumeAttributesClass will be set by the persistentvolume controller if it exists. If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource exists. More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/ (Beta) Using this field requires the VolumeAttributesClass feature gate to be enabled (off by default).", + Description: "volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim. If specified, the CSI driver will create or update the volume with the attributes defined in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName, it can be changed after the claim is created. An empty string or nil value indicates that no VolumeAttributesClass will be applied to the claim. If the claim enters an Infeasible error state, this field can be reset to its previous value (including nil) to cancel the modification. If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource exists. More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/", Type: []string{"string"}, Format: "", }, @@ -8743,14 +9028,14 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCa }, "currentVolumeAttributesClassName": { SchemaProps: spec.SchemaProps{ - Description: "currentVolumeAttributesClassName is the current name of the VolumeAttributesClass the PVC is using. When unset, there is no VolumeAttributeClass applied to this PersistentVolumeClaim This is a beta field and requires enabling VolumeAttributesClass feature (off by default).", + Description: "currentVolumeAttributesClassName is the current name of the VolumeAttributesClass the PVC is using. When unset, there is no VolumeAttributeClass applied to this PersistentVolumeClaim", Type: []string{"string"}, Format: "", }, }, "modifyVolumeStatus": { SchemaProps: spec.SchemaProps{ - Description: "ModifyVolumeStatus represents the status object of ControllerModifyVolume operation. When this is unset, there is no ModifyVolume operation being attempted. This is a beta field and requires enabling VolumeAttributesClass feature (off by default).", + Description: "ModifyVolumeStatus represents the status object of ControllerModifyVolume operation. When this is unset, there is no ModifyVolume operation being attempted.", Ref: ref("k8s.io/api/core/v1.ModifyVolumeStatus"), }, }, @@ -9254,7 +9539,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeSpec(ref common.ReferenceCallback) }, "volumeAttributesClassName": { SchemaProps: spec.SchemaProps{ - Description: "Name of VolumeAttributesClass to which this persistent volume belongs. Empty value is not allowed. When this field is not set, it indicates that this volume does not belong to any VolumeAttributesClass. This field is mutable and can be changed by the CSI driver after a volume has been updated successfully to a new class. For an unbound PersistentVolume, the volumeAttributesClassName will be matched with unbound PersistentVolumeClaims during the binding process. This is a beta field and requires enabling VolumeAttributesClass feature (off by default).", + Description: "Name of VolumeAttributesClass to which this persistent volume belongs. Empty value is not allowed. When this field is not set, it indicates that this volume does not belong to any VolumeAttributesClass. This field is mutable and can be changed by the CSI driver after a volume has been updated successfully to a new class. For an unbound PersistentVolume, the volumeAttributesClassName will be matched with unbound PersistentVolumeClaims during the binding process.", Type: []string{"string"}, Format: "", }, @@ -9496,7 +9781,7 @@ func schema_k8sio_api_core_v1_PodAffinityTerm(ref common.ReferenceCallback) comm }, }, SchemaProps: spec.SchemaProps{ - Description: "MatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both matchLabelKeys and labelSelector. Also, matchLabelKeys cannot be set when labelSelector isn't set. This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).", + Description: "MatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both matchLabelKeys and labelSelector. Also, matchLabelKeys cannot be set when labelSelector isn't set.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -9516,7 +9801,7 @@ func schema_k8sio_api_core_v1_PodAffinityTerm(ref common.ReferenceCallback) comm }, }, SchemaProps: spec.SchemaProps{ - Description: "MismatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both mismatchLabelKeys and labelSelector. Also, mismatchLabelKeys cannot be set when labelSelector isn't set. This is a beta field and requires enabling MatchLabelKeysInPodAffinity feature gate (enabled by default).", + Description: "MismatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both mismatchLabelKeys and labelSelector. Also, mismatchLabelKeys cannot be set when labelSelector isn't set.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -9571,7 +9856,7 @@ func schema_k8sio_api_core_v1_PodAntiAffinity(ref common.ReferenceCallback) comm }, }, SchemaProps: spec.SchemaProps{ - Description: "The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.", + Description: "The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and subtracting \"weight\" from the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -9653,6 +9938,61 @@ func schema_k8sio_api_core_v1_PodAttachOptions(ref common.ReferenceCallback) com } } +func schema_k8sio_api_core_v1_PodCertificateProjection(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "PodCertificateProjection provides a private key and X.509 certificate in the pod filesystem.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "signerName": { + SchemaProps: spec.SchemaProps{ + Description: "Kubelet's generated CSRs will be addressed to this signer.", + Type: []string{"string"}, + Format: "", + }, + }, + "keyType": { + SchemaProps: spec.SchemaProps{ + Description: "The type of keypair Kubelet will generate for the pod.\n\nValid values are \"RSA3072\", \"RSA4096\", \"ECDSAP256\", \"ECDSAP384\", \"ECDSAP521\", and \"ED25519\".", + Type: []string{"string"}, + Format: "", + }, + }, + "maxExpirationSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "maxExpirationSeconds is the maximum lifetime permitted for the certificate.\n\nKubelet copies this value verbatim into the PodCertificateRequests it generates for this projection.\n\nIf omitted, kube-apiserver will set it to 86400(24 hours). kube-apiserver will reject values shorter than 3600 (1 hour). The maximum allowable value is 7862400 (91 days).\n\nThe signer implementation is then free to issue a certificate with any lifetime *shorter* than MaxExpirationSeconds, but no shorter than 3600 seconds (1 hour). This constraint is enforced by kube-apiserver. `kubernetes.io` signers will never issue certificates with a lifetime longer than 24 hours.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "credentialBundlePath": { + SchemaProps: spec.SchemaProps{ + Description: "Write the credential bundle at this path in the projected volume.\n\nThe credential bundle is a single file that contains multiple PEM blocks. The first PEM block is a PRIVATE KEY block, containing a PKCS#8 private key.\n\nThe remaining blocks are CERTIFICATE blocks, containing the issued certificate chain from the signer (leaf and any intermediates).\n\nUsing credentialBundlePath lets your Pod's application code make a single atomic read that retrieves a consistent key and certificate chain. If you project them to separate files, your application code will need to additionally check that the leaf certificate was issued to the key.", + Type: []string{"string"}, + Format: "", + }, + }, + "keyPath": { + SchemaProps: spec.SchemaProps{ + Description: "Write the key at this path in the projected volume.\n\nMost applications should use credentialBundlePath. When using keyPath and certificateChainPath, your application needs to check that the key and leaf certificate are consistent, because it is possible to read the files mid-rotation.", + Type: []string{"string"}, + Format: "", + }, + }, + "certificateChainPath": { + SchemaProps: spec.SchemaProps{ + Description: "Write the certificate chain at this path in the projected volume.\n\nMost applications should use credentialBundlePath. When using keyPath and certificateChainPath, your application needs to check that the key and leaf certificate are consistent, because it is possible to read the files mid-rotation.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + func schema_k8sio_api_core_v1_PodCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -9668,6 +10008,13 @@ func schema_k8sio_api_core_v1_PodCondition(ref common.ReferenceCallback) common. Format: "", }, }, + "observedGeneration": { + SchemaProps: spec.SchemaProps{ + Description: "If set, this represents the .metadata.generation that the pod condition was set based upon. This is an alpha field. Enable PodObservedGenerationTracking to be able to use this field.", + Type: []string{"integer"}, + Format: "int64", + }, + }, "status": { SchemaProps: spec.SchemaProps{ Description: "Status is the status of the condition. Can be True, False, Unknown. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions", @@ -9895,6 +10242,49 @@ func schema_k8sio_api_core_v1_PodExecOptions(ref common.ReferenceCallback) commo } } +func schema_k8sio_api_core_v1_PodExtendedResourceClaimStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "PodExtendedResourceClaimStatus is stored in the PodStatus for the extended resource requests backed by DRA. It stores the generated name for the corresponding special ResourceClaim created by the scheduler.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "requestMappings": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "RequestMappings identifies the mapping of to device request in the generated ResourceClaim.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.ContainerExtendedResourceRequest"), + }, + }, + }, + }, + }, + "resourceClaimName": { + SchemaProps: spec.SchemaProps{ + Description: "ResourceClaimName is the name of the ResourceClaim that was generated for the Pod in the namespace of the Pod.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"requestMappings", "resourceClaimName"}, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.ContainerExtendedResourceRequest"}, + } +} + func schema_k8sio_api_core_v1_PodIP(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -10471,7 +10861,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA }, }, SchemaProps: spec.SchemaProps{ - Description: "List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/", + Description: "List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -10612,7 +11002,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA }, "hostNetwork": { SchemaProps: spec.SchemaProps{ - Description: "Host networking requested for this pod. Use the host's network namespace. If this option is set, the ports that will be used must be specified. Default to false.", + Description: "Host networking requested for this pod. Use the host's network namespace. When using HostNetwork you should specify ports so the scheduler is aware. When `hostNetwork` is true, specified `hostPort` fields in port definitions must match `containerPort`, and unspecified `hostPort` fields in port definitions are defaulted to match `containerPort`. Default to false.", Type: []string{"boolean"}, Format: "", }, @@ -10847,7 +11237,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA }, "os": { SchemaProps: spec.SchemaProps{ - Description: "Specifies the OS of the containers in the pod. Some pod and container fields are restricted if this is set.\n\nIf the OS field is set to linux, the following fields must be unset: -securityContext.windowsOptions\n\nIf the OS field is set to windows, following fields must be unset: - spec.hostPID - spec.hostIPC - spec.hostUsers - spec.securityContext.appArmorProfile - spec.securityContext.seLinuxOptions - spec.securityContext.seccompProfile - spec.securityContext.fsGroup - spec.securityContext.fsGroupChangePolicy - spec.securityContext.sysctls - spec.shareProcessNamespace - spec.securityContext.runAsUser - spec.securityContext.runAsGroup - spec.securityContext.supplementalGroups - spec.securityContext.supplementalGroupsPolicy - spec.containers[*].securityContext.appArmorProfile - spec.containers[*].securityContext.seLinuxOptions - spec.containers[*].securityContext.seccompProfile - spec.containers[*].securityContext.capabilities - spec.containers[*].securityContext.readOnlyRootFilesystem - spec.containers[*].securityContext.privileged - spec.containers[*].securityContext.allowPrivilegeEscalation - spec.containers[*].securityContext.procMount - spec.containers[*].securityContext.runAsUser - spec.containers[*].securityContext.runAsGroup", + Description: "Specifies the OS of the containers in the pod. Some pod and container fields are restricted if this is set.\n\nIf the OS field is set to linux, the following fields must be unset: -securityContext.windowsOptions\n\nIf the OS field is set to windows, following fields must be unset: - spec.hostPID - spec.hostIPC - spec.hostUsers - spec.resources - spec.securityContext.appArmorProfile - spec.securityContext.seLinuxOptions - spec.securityContext.seccompProfile - spec.securityContext.fsGroup - spec.securityContext.fsGroupChangePolicy - spec.securityContext.sysctls - spec.shareProcessNamespace - spec.securityContext.runAsUser - spec.securityContext.runAsGroup - spec.securityContext.supplementalGroups - spec.securityContext.supplementalGroupsPolicy - spec.containers[*].securityContext.appArmorProfile - spec.containers[*].securityContext.seLinuxOptions - spec.containers[*].securityContext.seccompProfile - spec.containers[*].securityContext.capabilities - spec.containers[*].securityContext.readOnlyRootFilesystem - spec.containers[*].securityContext.privileged - spec.containers[*].securityContext.allowPrivilegeEscalation - spec.containers[*].securityContext.procMount - spec.containers[*].securityContext.runAsUser - spec.containers[*].securityContext.runAsGroup", Ref: ref("k8s.io/api/core/v1.PodOS"), }, }, @@ -10908,10 +11298,17 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA }, "resources": { SchemaProps: spec.SchemaProps{ - Description: "Resources is the total amount of CPU and Memory resources required by all containers in the pod. It supports specifying Requests and Limits for \"cpu\" and \"memory\" resource names only. ResourceClaims are not supported.\n\nThis field enables fine-grained control over resource allocation for the entire pod, allowing resource sharing among containers in a pod.\n\nThis is an alpha field and requires enabling the PodLevelResources feature gate.", + Description: "Resources is the total amount of CPU and Memory resources required by all containers in the pod. It supports specifying Requests and Limits for \"cpu\", \"memory\" and \"hugepages-\" resource names only. ResourceClaims are not supported.\n\nThis field enables fine-grained control over resource allocation for the entire pod, allowing resource sharing among containers in a pod.\n\nThis is an alpha field and requires enabling the PodLevelResources feature gate.", Ref: ref("k8s.io/api/core/v1.ResourceRequirements"), }, }, + "hostnameOverride": { + SchemaProps: spec.SchemaProps{ + Description: "HostnameOverride specifies an explicit override for the pod's hostname as perceived by the pod. This field only specifies the pod's hostname and does not affect its DNS records. When this field is set to a non-empty string: - It takes precedence over the values set in `hostname` and `subdomain`. - The Pod's hostname will be set to this value. - `setHostnameAsFQDN` must be nil or set to false. - `hostNetwork` must be set to false.\n\nThis field must be a valid DNS subdomain as defined in RFC 1123 and contain at most 64 characters. Requires the HostnameOverride feature gate to be enabled.", + Type: []string{"string"}, + Format: "", + }, + }, }, Required: []string{"containers"}, }, @@ -10928,6 +11325,13 @@ func schema_k8sio_api_core_v1_PodStatus(ref common.ReferenceCallback) common.Ope Description: "PodStatus represents information about the status of a pod. Status may trail the actual state of a system, especially if the node that hosts the pod cannot contact the control plane.", Type: []string{"object"}, Properties: map[string]spec.Schema{ + "observedGeneration": { + SchemaProps: spec.SchemaProps{ + Description: "If set, this represents the .metadata.generation that the pod status was set based upon. This is an alpha field. Enable PodObservedGenerationTracking to be able to use this field.", + Type: []string{"integer"}, + Format: "int64", + }, + }, "phase": { SchemaProps: spec.SchemaProps{ Description: "The phase of a Pod is a simple, high-level summary of where the Pod is in its lifecycle. The conditions array, the reason and message fields, and the individual container status arrays contain more detail about the pod's status. There are five possible phase values:\n\nPending: The pod has been accepted by the Kubernetes system, but one or more of the container images has not been created. This includes time before being scheduled as well as time spent downloading images over the network, which could take a while. Running: The pod has been bound to a node, and all of the containers have been created. At least one container is still running, or is in the process of starting or restarting. Succeeded: All containers in the pod have terminated in success, and will not be restarted. Failed: All containers in the pod have terminated, and at least one container has terminated in failure. The container either exited with non-zero status or was terminated by the system. Unknown: For some reason the state of the pod could not be obtained, typically due to an error in communicating with the host of the pod.\n\nMore info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-phase\n\nPossible enum values:\n - `\"Failed\"` means that all containers in the pod have terminated, and at least one container has terminated in a failure (exited with a non-zero exit code or was stopped by the system).\n - `\"Pending\"` means the pod has been accepted by the system, but one or more of the containers has not been started. This includes time before being bound to a node, as well as time spent pulling images onto the host.\n - `\"Running\"` means the pod has been bound to a node and all of the containers have been started. At least one container is still running or is in the process of being restarted.\n - `\"Succeeded\"` means that all containers in the pod have voluntarily terminated with a container exit code of 0, and the system is not going to restart any of these containers.\n - `\"Unknown\"` means that for some reason the state of the pod could not be obtained, typically due to an error in communicating with the host of the pod. Deprecated: It isn't being set since 2015 (74da3b14b0c0f658b3bb8d2def5094686d0e9095)", @@ -11113,7 +11517,7 @@ func schema_k8sio_api_core_v1_PodStatus(ref common.ReferenceCallback) common.Ope }, "resize": { SchemaProps: spec.SchemaProps{ - Description: "Status of resources resize desired for pod's containers. It is empty if no resources resize is pending. Any changes to container resources will automatically set this to \"Proposed\"", + Description: "Status of resources resize desired for pod's containers. It is empty if no resources resize is pending. Any changes to container resources will automatically set this to \"Proposed\" Deprecated: Resize status is moved to two pod conditions PodResizePending and PodResizeInProgress. PodResizePending will track states where the spec has been resized, but the Kubelet has not yet allocated the resources. PodResizeInProgress will track in-progress resizes, and should be present whenever allocated resources != acknowledged resources.", Type: []string{"string"}, Format: "", }, @@ -11142,11 +11546,17 @@ func schema_k8sio_api_core_v1_PodStatus(ref common.ReferenceCallback) common.Ope }, }, }, + "extendedResourceClaimStatus": { + SchemaProps: spec.SchemaProps{ + Description: "Status of extended resource claim backed by DRA.", + Ref: ref("k8s.io/api/core/v1.PodExtendedResourceClaimStatus"), + }, + }, }, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ContainerStatus", "k8s.io/api/core/v1.HostIP", "k8s.io/api/core/v1.PodCondition", "k8s.io/api/core/v1.PodIP", "k8s.io/api/core/v1.PodResourceClaimStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + "k8s.io/api/core/v1.ContainerStatus", "k8s.io/api/core/v1.HostIP", "k8s.io/api/core/v1.PodCondition", "k8s.io/api/core/v1.PodExtendedResourceClaimStatus", "k8s.io/api/core/v1.PodIP", "k8s.io/api/core/v1.PodResourceClaimStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, } } @@ -12074,6 +12484,7 @@ func schema_k8sio_api_core_v1_ReplicationControllerSpec(ref common.ReferenceCall "replicas": { SchemaProps: spec.SchemaProps{ Description: "Replicas is the number of desired replicas. This is a pointer to distinguish between explicit zero and unspecified. Defaults to 1. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#what-is-a-replicationcontroller", + Default: 1, Type: []string{"integer"}, Format: "int32", }, @@ -12081,6 +12492,7 @@ func schema_k8sio_api_core_v1_ReplicationControllerSpec(ref common.ReferenceCall "minReadySeconds": { SchemaProps: spec.SchemaProps{ Description: "Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)", + Default: 0, Type: []string{"integer"}, Format: "int32", }, @@ -12540,7 +12952,7 @@ func schema_k8sio_api_core_v1_ResourceRequirements(ref common.ReferenceCallback) }, }, SchemaProps: spec.SchemaProps{ - Description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container.\n\nThis is an alpha field and requires enabling the DynamicResourceAllocation feature gate.\n\nThis field is immutable. It can only be set for containers.", + Description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container.\n\nThis field depends on the DynamicResourceAllocation feature gate.\n\nThis field is immutable. It can only be set for containers.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -12873,11 +13285,11 @@ func schema_k8sio_api_core_v1_ScopedResourceSelectorRequirement(ref common.Refer Properties: map[string]spec.Schema{ "scopeName": { SchemaProps: spec.SchemaProps{ - Description: "The name of the scope that the selector applies to.\n\nPossible enum values:\n - `\"BestEffort\"` Match all pod objects that have best effort quality of service\n - `\"CrossNamespacePodAffinity\"` Match all pod objects that have cross-namespace pod (anti)affinity mentioned.\n - `\"NotBestEffort\"` Match all pod objects that do not have best effort quality of service\n - `\"NotTerminating\"` Match all pod objects where spec.activeDeadlineSeconds is nil\n - `\"PriorityClass\"` Match all pod objects that have priority class mentioned\n - `\"Terminating\"` Match all pod objects where spec.activeDeadlineSeconds >=0", + Description: "The name of the scope that the selector applies to.\n\nPossible enum values:\n - `\"BestEffort\"` Match all pod objects that have best effort quality of service\n - `\"CrossNamespacePodAffinity\"` Match all pod objects that have cross-namespace pod (anti)affinity mentioned.\n - `\"NotBestEffort\"` Match all pod objects that do not have best effort quality of service\n - `\"NotTerminating\"` Match all pod objects where spec.activeDeadlineSeconds is nil\n - `\"PriorityClass\"` Match all pod objects that have priority class mentioned\n - `\"Terminating\"` Match all pod objects where spec.activeDeadlineSeconds >=0\n - `\"VolumeAttributesClass\"` Match all pvc objects that have volume attributes class mentioned.", Default: "", Type: []string{"string"}, Format: "", - Enum: []interface{}{"BestEffort", "CrossNamespacePodAffinity", "NotBestEffort", "NotTerminating", "PriorityClass", "Terminating"}, + Enum: []interface{}{"BestEffort", "CrossNamespacePodAffinity", "NotBestEffort", "NotTerminating", "PriorityClass", "Terminating", "VolumeAttributesClass"}, }, }, "operator": { @@ -14025,7 +14437,7 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O }, "trafficDistribution": { SchemaProps: spec.SchemaProps{ - Description: "TrafficDistribution offers a way to express preferences for how traffic is distributed to Service endpoints. Implementations can use this field as a hint, but are not required to guarantee strict adherence. If the field is not set, the implementation will apply its default routing strategy. If set to \"PreferClose\", implementations should prioritize endpoints that are topologically close (e.g., same zone). This is a beta field and requires enabling ServiceTrafficDistribution feature.", + Description: "TrafficDistribution offers a way to express preferences for how traffic is distributed to Service endpoints. Implementations can use this field as a hint, but are not required to guarantee strict adherence. If the field is not set, the implementation will apply its default routing strategy. If set to \"PreferClose\", implementations should prioritize endpoints that are in the same zone.", Type: []string{"string"}, Format: "", }, @@ -14317,7 +14729,7 @@ func schema_k8sio_api_core_v1_Taint(ref common.ReferenceCallback) common.OpenAPI }, "timeAdded": { SchemaProps: spec.SchemaProps{ - Description: "TimeAdded represents the time at which the taint was added. It is only written for NoExecute taints.", + Description: "TimeAdded represents the time at which the taint was added.", Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, @@ -14508,7 +14920,7 @@ func schema_k8sio_api_core_v1_TopologySpreadConstraint(ref common.ReferenceCallb }, "nodeAffinityPolicy": { SchemaProps: spec.SchemaProps{ - Description: "NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. Options are: - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations. - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.\n\nIf this value is nil, the behavior is equivalent to the Honor policy. This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.\n\nPossible enum values:\n - `\"Honor\"` means use this scheduling directive when calculating pod topology spread skew.\n - `\"Ignore\"` means ignore this scheduling directive when calculating pod topology spread skew.", + Description: "NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. Options are: - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations. - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.\n\nIf this value is nil, the behavior is equivalent to the Honor policy.\n\nPossible enum values:\n - `\"Honor\"` means use this scheduling directive when calculating pod topology spread skew.\n - `\"Ignore\"` means ignore this scheduling directive when calculating pod topology spread skew.", Type: []string{"string"}, Format: "", Enum: []interface{}{"Honor", "Ignore"}, @@ -14516,7 +14928,7 @@ func schema_k8sio_api_core_v1_TopologySpreadConstraint(ref common.ReferenceCallb }, "nodeTaintsPolicy": { SchemaProps: spec.SchemaProps{ - Description: "NodeTaintsPolicy indicates how we will treat node taints when calculating pod topology spread skew. Options are: - Honor: nodes without taints, along with tainted nodes for which the incoming pod has a toleration, are included. - Ignore: node taints are ignored. All nodes are included.\n\nIf this value is nil, the behavior is equivalent to the Ignore policy. This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.\n\nPossible enum values:\n - `\"Honor\"` means use this scheduling directive when calculating pod topology spread skew.\n - `\"Ignore\"` means ignore this scheduling directive when calculating pod topology spread skew.", + Description: "NodeTaintsPolicy indicates how we will treat node taints when calculating pod topology spread skew. Options are: - Honor: nodes without taints, along with tainted nodes for which the incoming pod has a toleration, are included. - Ignore: node taints are ignored. All nodes are included.\n\nIf this value is nil, the behavior is equivalent to the Ignore policy.\n\nPossible enum values:\n - `\"Honor\"` means use this scheduling directive when calculating pod topology spread skew.\n - `\"Ignore\"` means ignore this scheduling directive when calculating pod topology spread skew.", Type: []string{"string"}, Format: "", Enum: []interface{}{"Honor", "Ignore"}, @@ -14696,13 +15108,13 @@ func schema_k8sio_api_core_v1_Volume(ref common.ReferenceCallback) common.OpenAP }, "iscsi": { SchemaProps: spec.SchemaProps{ - Description: "iscsi represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md", + Description: "iscsi represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes/#iscsi", Ref: ref("k8s.io/api/core/v1.ISCSIVolumeSource"), }, }, "glusterfs": { SchemaProps: spec.SchemaProps{ - Description: "glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. Deprecated: Glusterfs is deprecated and the in-tree glusterfs type is no longer supported. More info: https://examples.k8s.io/volumes/glusterfs/README.md", + Description: "glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. Deprecated: Glusterfs is deprecated and the in-tree glusterfs type is no longer supported.", Ref: ref("k8s.io/api/core/v1.GlusterfsVolumeSource"), }, }, @@ -14714,7 +15126,7 @@ func schema_k8sio_api_core_v1_Volume(ref common.ReferenceCallback) common.OpenAP }, "rbd": { SchemaProps: spec.SchemaProps{ - Description: "rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. Deprecated: RBD is deprecated and the in-tree rbd type is no longer supported. More info: https://examples.k8s.io/volumes/rbd/README.md", + Description: "rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. Deprecated: RBD is deprecated and the in-tree rbd type is no longer supported.", Ref: ref("k8s.io/api/core/v1.RBDVolumeSource"), }, }, @@ -14828,7 +15240,7 @@ func schema_k8sio_api_core_v1_Volume(ref common.ReferenceCallback) common.OpenAP }, "image": { SchemaProps: spec.SchemaProps{ - Description: "image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. The volume is resolved at pod startup depending on which PullPolicy value is provided:\n\n- Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.\n\nThe volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation. A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. The volume will be mounted read-only (ro) and non-executable files (noexec). Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath). The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.", + Description: "image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. The volume is resolved at pod startup depending on which PullPolicy value is provided:\n\n- Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.\n\nThe volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation. A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. The volume will be mounted read-only (ro) and non-executable files (noexec). Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath) before 1.33. The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.", Ref: ref("k8s.io/api/core/v1.ImageVolumeSource"), }, }, @@ -15039,11 +15451,17 @@ func schema_k8sio_api_core_v1_VolumeProjection(ref common.ReferenceCallback) com Ref: ref("k8s.io/api/core/v1.ClusterTrustBundleProjection"), }, }, + "podCertificate": { + SchemaProps: spec.SchemaProps{ + Description: "Projects an auto-rotating credential bundle (private key and certificate chain) that the pod can use either as a TLS client or server.\n\nKubelet generates a private key and uses it to send a PodCertificateRequest to the named signer. Once the signer approves the request and issues a certificate chain, Kubelet writes the key and certificate chain to the pod filesystem. The pod does not start until certificates have been issued for each podCertificate projected volume source in its spec.\n\nKubelet will begin trying to rotate the certificate at the time indicated by the signer using the PodCertificateRequest.Status.BeginRefreshAt timestamp.\n\nKubelet can write a single file, indicated by the credentialBundlePath field, or separate files, indicated by the keyPath and certificateChainPath fields.\n\nThe credential bundle is a single file in PEM format. The first PEM entry is the private key (in PKCS#8 format), and the remaining PEM entries are the certificate chain issued by the signer (typically, signers will return their certificate chain in leaf-to-root order).\n\nPrefer using the credential bundle format, since your application code can read it atomically. If you use keyPath and certificateChainPath, your application must make two separate file reads. If these coincide with a certificate rotation, it is possible that the private key and leaf certificate you read may not correspond to each other. Your application will need to check for this condition, and re-read until they are consistent.\n\nThe named signer controls chooses the format of the certificate it issues; consult the signer implementation's documentation to learn how to use the certificates it issues.", + Ref: ref("k8s.io/api/core/v1.PodCertificateProjection"), + }, + }, }, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ClusterTrustBundleProjection", "k8s.io/api/core/v1.ConfigMapProjection", "k8s.io/api/core/v1.DownwardAPIProjection", "k8s.io/api/core/v1.SecretProjection", "k8s.io/api/core/v1.ServiceAccountTokenProjection"}, + "k8s.io/api/core/v1.ClusterTrustBundleProjection", "k8s.io/api/core/v1.ConfigMapProjection", "k8s.io/api/core/v1.DownwardAPIProjection", "k8s.io/api/core/v1.PodCertificateProjection", "k8s.io/api/core/v1.SecretProjection", "k8s.io/api/core/v1.ServiceAccountTokenProjection"}, } } @@ -15141,13 +15559,13 @@ func schema_k8sio_api_core_v1_VolumeSource(ref common.ReferenceCallback) common. }, "iscsi": { SchemaProps: spec.SchemaProps{ - Description: "iscsi represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md", + Description: "iscsi represents an ISCSI Disk resource that is attached to a kubelet's host machine and then exposed to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes/#iscsi", Ref: ref("k8s.io/api/core/v1.ISCSIVolumeSource"), }, }, "glusterfs": { SchemaProps: spec.SchemaProps{ - Description: "glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. Deprecated: Glusterfs is deprecated and the in-tree glusterfs type is no longer supported. More info: https://examples.k8s.io/volumes/glusterfs/README.md", + Description: "glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. Deprecated: Glusterfs is deprecated and the in-tree glusterfs type is no longer supported.", Ref: ref("k8s.io/api/core/v1.GlusterfsVolumeSource"), }, }, @@ -15159,7 +15577,7 @@ func schema_k8sio_api_core_v1_VolumeSource(ref common.ReferenceCallback) common. }, "rbd": { SchemaProps: spec.SchemaProps{ - Description: "rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. Deprecated: RBD is deprecated and the in-tree rbd type is no longer supported. More info: https://examples.k8s.io/volumes/rbd/README.md", + Description: "rbd represents a Rados Block Device mount on the host that shares a pod's lifetime. Deprecated: RBD is deprecated and the in-tree rbd type is no longer supported.", Ref: ref("k8s.io/api/core/v1.RBDVolumeSource"), }, }, @@ -15273,7 +15691,7 @@ func schema_k8sio_api_core_v1_VolumeSource(ref common.ReferenceCallback) common. }, "image": { SchemaProps: spec.SchemaProps{ - Description: "image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. The volume is resolved at pod startup depending on which PullPolicy value is provided:\n\n- Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.\n\nThe volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation. A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. The volume will be mounted read-only (ro) and non-executable files (noexec). Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath). The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.", + Description: "image represents an OCI object (a container image or artifact) pulled and mounted on the kubelet's host machine. The volume is resolved at pod startup depending on which PullPolicy value is provided:\n\n- Always: the kubelet always attempts to pull the reference. Container creation will fail If the pull fails. - Never: the kubelet never pulls the reference and only uses a local image or artifact. Container creation will fail if the reference isn't present. - IfNotPresent: the kubelet pulls if the reference isn't already present on disk. Container creation will fail if the reference isn't present and the pull fails.\n\nThe volume gets re-resolved if the pod gets deleted and recreated, which means that new remote content will become available on pod recreation. A failure to resolve or pull the image during pod startup will block containers from starting and may add significant latency. Failures will be retried using normal volume backoff and will be reported on the pod reason and message. The types of objects that may be mounted by this volume are defined by the container runtime implementation on a host machine and at minimum must include all valid types supported by the container image field. The OCI object gets mounted in a single directory (spec.containers[*].volumeMounts.mountPath) by merging the manifest layers in the same way as for container images. The volume will be mounted read-only (ro) and non-executable files (noexec). Sub path mounts for containers are not supported (spec.containers[*].volumeMounts.subpath) before 1.33. The field spec.securityContext.fsGroupChangePolicy has no effect on this volume type.", Ref: ref("k8s.io/api/core/v1.ImageVolumeSource"), }, }, @@ -18682,16 +19100,46 @@ func schema_k8sio_apimachinery_pkg_version_Info(ref common.ReferenceCallback) co Properties: map[string]spec.Schema{ "major": { SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Description: "Major is the major version of the binary version", + Default: "", + Type: []string{"string"}, + Format: "", }, }, "minor": { SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Description: "Minor is the minor version of the binary version", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "emulationMajor": { + SchemaProps: spec.SchemaProps{ + Description: "EmulationMajor is the major version of the emulation version", + Type: []string{"string"}, + Format: "", + }, + }, + "emulationMinor": { + SchemaProps: spec.SchemaProps{ + Description: "EmulationMinor is the minor version of the emulation version", + Type: []string{"string"}, + Format: "", + }, + }, + "minCompatibilityMajor": { + SchemaProps: spec.SchemaProps{ + Description: "MinCompatibilityMajor is the major version of the minimum compatibility version", + Type: []string{"string"}, + Format: "", + }, + }, + "minCompatibilityMinor": { + SchemaProps: spec.SchemaProps{ + Description: "MinCompatibilityMinor is the minor version of the minimum compatibility version", + Type: []string{"string"}, + Format: "", }, }, "gitVersion": { diff --git a/vendor/kubeops.dev/operator-shard-manager/LICENSE b/vendor/kubeops.dev/operator-shard-manager/LICENSE new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/vendor/kubeops.dev/operator-shard-manager/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/kubeops.dev/operator-shard-manager/api/v1alpha1/crds.go b/vendor/kubeops.dev/operator-shard-manager/api/v1alpha1/crds.go new file mode 100644 index 000000000..0bb513612 --- /dev/null +++ b/vendor/kubeops.dev/operator-shard-manager/api/v1alpha1/crds.go @@ -0,0 +1,27 @@ +/* +Copyright AppsCode Inc. and Contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + "kubeops.dev/operator-shard-manager/crds" + + "kmodules.xyz/client-go/apiextensions" +) + +func (ShardConfiguration) CustomResourceDefinition() *apiextensions.CustomResourceDefinition { + return crds.MustCustomResourceDefinition(SchemeGroupVersion.WithResource(ResourceShardConfigurations)) +} diff --git a/vendor/kubeops.dev/operator-shard-manager/api/v1alpha1/doc.go b/vendor/kubeops.dev/operator-shard-manager/api/v1alpha1/doc.go new file mode 100644 index 000000000..ef7ac4659 --- /dev/null +++ b/vendor/kubeops.dev/operator-shard-manager/api/v1alpha1/doc.go @@ -0,0 +1,23 @@ +/* +Copyright AppsCode Inc. and Contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package v1 contains API Schema definitions for the identity v1 API group + +// +k8s:openapi-gen=true +// +k8s:deepcopy-gen=package +// +k8s:defaulter-gen=TypeMeta +// +groupName=operator.k8s.appscode.com +package v1alpha1 // import "kubeops.dev/operator-shard-manager/apis/apps/v1" diff --git a/vendor/kubeops.dev/operator-shard-manager/api/v1alpha1/groupversion_info.go b/vendor/kubeops.dev/operator-shard-manager/api/v1alpha1/groupversion_info.go new file mode 100644 index 000000000..a28db5278 --- /dev/null +++ b/vendor/kubeops.dev/operator-shard-manager/api/v1alpha1/groupversion_info.go @@ -0,0 +1,46 @@ +/* +Copyright AppsCode Inc. and Contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package v1alpha1 contains API Schema definitions for the operator v1alpha1 API group. +// +kubebuilder:object:generate=true +// +groupName=operator.k8s.appscode.com +package v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +var ( + // SchemeGroupVersion is group version used to register these objects. + SchemeGroupVersion = schema.GroupVersion{Group: "operator.k8s.appscode.com", Version: "v1alpha1"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme. + SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) + +// Kind takes an unqualified kind and returns a Group qualified GroupKind +func Kind(kind string) schema.GroupKind { + return SchemeGroupVersion.WithKind(kind).GroupKind() +} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} diff --git a/vendor/kubeops.dev/operator-shard-manager/api/v1alpha1/shardconfiguration_types.go b/vendor/kubeops.dev/operator-shard-manager/api/v1alpha1/shardconfiguration_types.go new file mode 100644 index 000000000..e24032926 --- /dev/null +++ b/vendor/kubeops.dev/operator-shard-manager/api/v1alpha1/shardconfiguration_types.go @@ -0,0 +1,99 @@ +/* +Copyright AppsCode Inc. and Contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + kmapi "kmodules.xyz/client-go/api/v1" +) + +const ( + ResourceKindShardConfiguration = "ShardConfiguration" + ResourceShardConfiguration = "shardconfiguration" + ResourceShardConfigurations = "shardconfigurations" +) + +// ShardConfigurationSpec defines the desired state of ShardConfiguration. +type ShardConfigurationSpec struct { + // +kubebuilder:validation:MinItems=1 + Controllers []kmapi.TypedObjectReference `json:"controllers,omitempty"` + // +kubebuilder:validation:MinItems=1 + Resources []ResourceInfo `json:"resources,omitempty"` +} + +type ResourceInfo struct { + kmapi.TypeReference `json:",inline"` + ShardKey *string `json:"shardKey,omitempty"` + UseCooperativeShardMigration bool `json:"useCooperativeShardMigration,omitempty"` +} + +type ControllerAllocation struct { + kmapi.TypedObjectReference `json:",inline"` + Pods []string `json:"pods,omitempty"` +} + +// ShardConfigurationStatus defines the observed state of ShardConfiguration. +type ShardConfigurationStatus struct { + // Specifies the current phase of the App + // +optional + Phase Phase `json:"phase,omitempty"` + + // +optional + // +listType=map + // +listMapKey=type + // +kubebuilder:validation:MaxItems=12 + Conditions []kmapi.Condition `json:"conditions,omitempty"` + + Controllers []ControllerAllocation `json:"controllers,omitempty"` +} + +// +kubebuilder:validation:Enum=Pending;Current;Failed +type Phase string + +const ( + PhasePending Phase = "Pending" + PhaseCurrent Phase = "Current" + PhaseFailed Phase = "Failed" +) + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:resource:scope=Cluster + +// ShardConfiguration is the Schema for the shardconfigurations API. +type ShardConfiguration struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec ShardConfigurationSpec `json:"spec,omitempty"` + Status ShardConfigurationStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:object:root=true + +// ShardConfigurationList contains a list of ShardConfiguration. +type ShardConfigurationList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []ShardConfiguration `json:"items"` +} + +func init() { + SchemeBuilder.Register(&ShardConfiguration{}, &ShardConfigurationList{}) +} diff --git a/vendor/kubeops.dev/operator-shard-manager/api/v1alpha1/shardconfiguration_util.go b/vendor/kubeops.dev/operator-shard-manager/api/v1alpha1/shardconfiguration_util.go new file mode 100644 index 000000000..19250bbd4 --- /dev/null +++ b/vendor/kubeops.dev/operator-shard-manager/api/v1alpha1/shardconfiguration_util.go @@ -0,0 +1,162 @@ +/* +Copyright AppsCode Inc. and Contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + "context" + "fmt" + "os" + "strconv" + + v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/types" + "k8s.io/klog/v2" + kmapi "kmodules.xyz/client-go/api/v1" + kapiutil "kmodules.xyz/client-go/client/apiutil" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +func ShouldEnqueueObjectForShard(kbClient client.Client, shardConfig string, labels map[string]string) bool { + if shardConfig == "" { + return true + } + if labels == nil { + klog.Warningf("shard-config provided, but labels is nil, skip enqueuing object") + return false + } + shardId := ExtractShardKeyFromLabels(labels, shardConfig) + if shardId == "" { + klog.Warningf("shard-config provided, but no shardId found in the labels, skip enqueuing object") + return false + } + requeue, err := ShouldReconcileByShard(kbClient, shardConfig, shardId) + if err != nil { + klog.Warningf("ShouldReconcileByShard failed with err: %v", err) + return false + } + return requeue +} + +func ExtractShardKeyFromLabels(labels map[string]string, shardConfigName string) string { + shardKey := fmt.Sprintf("shard.%s/%s", SchemeGroupVersion.Group, shardConfigName) + val, ok := labels[shardKey] + if !ok { + return "" + } + return val +} + +func ShouldReconcileByShard(kbClient client.Client, shardConfigName, shardId string) (bool, error) { + head, err := FindHeadOfLineage(kbClient) + if err != nil { + return false, err + } + + pods, err := GetPodListsFromShardConfig(kbClient, *head, shardConfigName) + if err != nil { + return false, err + } + return isShardIdAndHostnameMatched(shardId, pods), nil +} + +func FindHeadOfLineage(kbClient client.Client) (*kmapi.ObjectInfo, error) { + hostName, err := getPodHostname() + if err != nil { + return nil, err + } + ns, err := getPodNamespace() + if err != nil { + return nil, err + } + pod := &v1.Pod{} + err = kbClient.Get(context.TODO(), types.NamespacedName{ + Name: hostName, + Namespace: ns, + }, pod) + if err != nil { + return nil, err + } + pod.SetGroupVersionKind(schema.GroupVersionKind{ + Group: "", + Kind: "Pod", + }) + lineage, err := kapiutil.DetectLineage(context.TODO(), kbClient, pod) + if err != nil { + return nil, err + } + if len(lineage) == 0 { + return nil, fmt.Errorf("no owner found for pod %s/%s", pod.Namespace, pod.Name) + } + return &lineage[0], nil +} + +func GetPodListsFromShardConfig(kbClient client.Client, head kmapi.ObjectInfo, shardConfigName string) ([]string, error) { + shardConfig, err := fetchShardConfiguration(kbClient, shardConfigName) + if err != nil { + return nil, err + } + return getPodNamesFromShardConfig(head, shardConfig), nil +} + +func getPodHostname() (string, error) { + hostName := os.Getenv("HOSTNAME") + if hostName == "" { + return "", fmt.Errorf("HOSTNAME environment variable is empty") + } + return hostName, nil +} + +func getPodNamespace() (string, error) { + out, err := os.ReadFile("/var/run/secrets/kubernetes.io/serviceaccount/namespace") + if err != nil { + return "", fmt.Errorf("failed to read namespace file: %w", err) + } + return string(out), nil +} + +func fetchShardConfiguration(kbClient client.Client, shardConfigName string) (*ShardConfiguration, error) { + shardConfig := &ShardConfiguration{} + err := kbClient.Get(context.TODO(), types.NamespacedName{ + Name: shardConfigName, + }, shardConfig) + if err != nil { + return nil, err + } + return shardConfig, nil +} + +func getPodNamesFromShardConfig(objectInfo kmapi.ObjectInfo, shardConfig *ShardConfiguration) []string { + var pods []string + for _, ca := range shardConfig.Status.Controllers { + if ca.APIGroup == objectInfo.Resource.Group && ca.Kind == objectInfo.Resource.Kind && ca.Name == objectInfo.Ref.Name && ca.Namespace == objectInfo.Ref.Namespace { + pods = ca.Pods + break + } + } + return pods +} + +func isShardIdAndHostnameMatched(shardId string, pods []string) bool { + hostName := os.Getenv("HOSTNAME") + for i, pod := range pods { + if pod == hostName && strconv.Itoa(i) == shardId { + return true + } + } + return false +} diff --git a/vendor/kubeops.dev/operator-shard-manager/api/v1alpha1/zz_generated.deepcopy.go b/vendor/kubeops.dev/operator-shard-manager/api/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 000000000..cf052df0b --- /dev/null +++ b/vendor/kubeops.dev/operator-shard-manager/api/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,190 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +/* +Copyright AppsCode Inc. and Contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" + v1 "kmodules.xyz/client-go/api/v1" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ControllerAllocation) DeepCopyInto(out *ControllerAllocation) { + *out = *in + out.TypedObjectReference = in.TypedObjectReference + if in.Pods != nil { + in, out := &in.Pods, &out.Pods + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControllerAllocation. +func (in *ControllerAllocation) DeepCopy() *ControllerAllocation { + if in == nil { + return nil + } + out := new(ControllerAllocation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceInfo) DeepCopyInto(out *ResourceInfo) { + *out = *in + out.TypeReference = in.TypeReference + if in.ShardKey != nil { + in, out := &in.ShardKey, &out.ShardKey + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceInfo. +func (in *ResourceInfo) DeepCopy() *ResourceInfo { + if in == nil { + return nil + } + out := new(ResourceInfo) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ShardConfiguration) DeepCopyInto(out *ShardConfiguration) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ShardConfiguration. +func (in *ShardConfiguration) DeepCopy() *ShardConfiguration { + if in == nil { + return nil + } + out := new(ShardConfiguration) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ShardConfiguration) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ShardConfigurationList) DeepCopyInto(out *ShardConfigurationList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ShardConfiguration, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ShardConfigurationList. +func (in *ShardConfigurationList) DeepCopy() *ShardConfigurationList { + if in == nil { + return nil + } + out := new(ShardConfigurationList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ShardConfigurationList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ShardConfigurationSpec) DeepCopyInto(out *ShardConfigurationSpec) { + *out = *in + if in.Controllers != nil { + in, out := &in.Controllers, &out.Controllers + *out = make([]v1.TypedObjectReference, len(*in)) + copy(*out, *in) + } + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = make([]ResourceInfo, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ShardConfigurationSpec. +func (in *ShardConfigurationSpec) DeepCopy() *ShardConfigurationSpec { + if in == nil { + return nil + } + out := new(ShardConfigurationSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ShardConfigurationStatus) DeepCopyInto(out *ShardConfigurationStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Controllers != nil { + in, out := &in.Controllers, &out.Controllers + *out = make([]ControllerAllocation, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ShardConfigurationStatus. +func (in *ShardConfigurationStatus) DeepCopy() *ShardConfigurationStatus { + if in == nil { + return nil + } + out := new(ShardConfigurationStatus) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/kubeops.dev/operator-shard-manager/crds/lib.go b/vendor/kubeops.dev/operator-shard-manager/crds/lib.go new file mode 100644 index 000000000..2c158172c --- /dev/null +++ b/vendor/kubeops.dev/operator-shard-manager/crds/lib.go @@ -0,0 +1,60 @@ +/* +Copyright AppsCode Inc. and Contributors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package crds + +import ( + "embed" + "fmt" + + "k8s.io/apimachinery/pkg/runtime/schema" + "kmodules.xyz/client-go/apiextensions" + "sigs.k8s.io/yaml" +) + +//go:embed *.yaml +var fs embed.FS + +func load(filename string, o any) error { + data, err := fs.ReadFile(filename) + if err != nil { + return err + } + return yaml.Unmarshal(data, o) +} + +func CustomResourceDefinition(gvr schema.GroupVersionResource) (*apiextensions.CustomResourceDefinition, error) { + var out apiextensions.CustomResourceDefinition + + v1file := fmt.Sprintf("%s_%s.yaml", gvr.Group, gvr.Resource) + if err := load(v1file, &out.V1); err != nil { + return nil, err + } + + if out.V1 == nil { + return nil, fmt.Errorf("missing crd yamls for gvr: %s", gvr) + } + + return &out, nil +} + +func MustCustomResourceDefinition(gvr schema.GroupVersionResource) *apiextensions.CustomResourceDefinition { + out, err := CustomResourceDefinition(gvr) + if err != nil { + panic(err) + } + return out +} diff --git a/vendor/kubeops.dev/operator-shard-manager/crds/operator.k8s.appscode.com_shardconfigurations.yaml b/vendor/kubeops.dev/operator-shard-manager/crds/operator.k8s.appscode.com_shardconfigurations.yaml new file mode 100644 index 000000000..f1b17b29a --- /dev/null +++ b/vendor/kubeops.dev/operator-shard-manager/crds/operator.k8s.appscode.com_shardconfigurations.yaml @@ -0,0 +1,177 @@ + +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + name: shardconfigurations.operator.k8s.appscode.com +spec: + group: operator.k8s.appscode.com + names: + kind: ShardConfiguration + listKind: ShardConfigurationList + plural: shardconfigurations + singular: shardconfiguration + scope: Cluster + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: ShardConfiguration is the Schema for the shardconfigurations + API. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: ShardConfigurationSpec defines the desired state of ShardConfiguration. + properties: + controllers: + items: + description: TypedObjectReference represents a typed namespaced + object. + properties: + apiGroup: + type: string + kind: + type: string + name: + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + namespace: + description: |- + Namespace of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ + type: string + required: + - name + type: object + minItems: 1 + type: array + resources: + items: + properties: + apiGroup: + type: string + kind: + type: string + shardKey: + type: string + useCooperativeShardMigration: + type: boolean + type: object + minItems: 1 + type: array + type: object + status: + description: ShardConfigurationStatus defines the observed state of ShardConfiguration. + properties: + conditions: + items: + description: Condition defines an observation of a object operational + state. + properties: + lastTransitionTime: + description: |- + Last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when + the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + A human-readable message indicating details about the transition. + This field may be empty. + type: string + observedGeneration: + description: |- + If set, this represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.condition[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + type: integer + reason: + description: |- + The reason for the condition's last transition in CamelCase. + The specific API may choose whether this field is considered a guaranteed API. + This field may not be empty. + type: string + severity: + description: |- + Severity provides an explicit classification of Reason code, so the users or machines can immediately + understand the current situation and act accordingly. + The Severity field MUST be set only when Status=False. + type: string + status: + description: Status of the condition, one of True, False, Unknown. + type: string + type: + description: |- + Type of condition in CamelCase or in foo.example.com/CamelCase. + Many .condition.type values are consistent across resources like Available, but because arbitrary util + can be useful (see .node.status.util), the ability to deconflict is important. + type: string + required: + - lastTransitionTime + - status + - type + type: object + maxItems: 12 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + controllers: + items: + properties: + apiGroup: + type: string + kind: + type: string + name: + description: |- + Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + namespace: + description: |- + Namespace of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ + type: string + pods: + items: + type: string + type: array + required: + - name + type: object + type: array + phase: + description: Specifies the current phase of the App + enum: + - Pending + - Current + - Failed + type: string + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/vendor/kubestash.dev/apimachinery/crds/addons.kubestash.com_addons.yaml b/vendor/kubestash.dev/apimachinery/crds/addons.kubestash.com_addons.yaml index 48a12c182..d5509fd0e 100644 --- a/vendor/kubestash.dev/apimachinery/crds/addons.kubestash.com_addons.yaml +++ b/vendor/kubestash.dev/apimachinery/crds/addons.kubestash.com_addons.yaml @@ -716,6 +716,25 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + required: + - keyType + - signerName + type: object secret: properties: items: @@ -1721,6 +1740,25 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + required: + - keyType + - signerName + type: object secret: properties: items: diff --git a/vendor/kubestash.dev/apimachinery/crds/addons.kubestash.com_functions.yaml b/vendor/kubestash.dev/apimachinery/crds/addons.kubestash.com_functions.yaml index 2a62cedb4..4f4ff3f99 100644 --- a/vendor/kubestash.dev/apimachinery/crds/addons.kubestash.com_functions.yaml +++ b/vendor/kubestash.dev/apimachinery/crds/addons.kubestash.com_functions.yaml @@ -104,6 +104,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -294,6 +311,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: diff --git a/vendor/kubestash.dev/apimachinery/crds/core.kubestash.com_backupbatches.yaml b/vendor/kubestash.dev/apimachinery/crds/core.kubestash.com_backupbatches.yaml index 23f590857..c651c3510 100644 --- a/vendor/kubestash.dev/apimachinery/crds/core.kubestash.com_backupbatches.yaml +++ b/vendor/kubestash.dev/apimachinery/crds/core.kubestash.com_backupbatches.yaml @@ -132,6 +132,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -322,6 +339,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: @@ -1278,6 +1297,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -1948,6 +1984,25 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + required: + - keyType + - signerName + type: object secret: properties: items: @@ -2201,6 +2256,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -2391,6 +2463,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: @@ -3347,6 +3421,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -4017,6 +4108,25 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + required: + - keyType + - signerName + type: object secret: properties: items: @@ -4844,6 +4954,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -4938,6 +5065,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -5127,6 +5271,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: @@ -5364,6 +5510,29 @@ spec: type: object restartPolicy: type: string + restartPolicyRules: + items: + properties: + action: + type: string + exitCodes: + properties: + operator: + type: string + values: + items: + format: int32 + type: integer + type: array + x-kubernetes-list-type: set + required: + - operator + type: object + required: + - action + type: object + type: array + x-kubernetes-list-type: atomic securityContext: properties: allowPrivilegeEscalation: @@ -5695,6 +5864,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: @@ -6708,6 +6879,25 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + required: + - keyType + - signerName + type: object secret: properties: items: @@ -6958,6 +7148,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -7148,6 +7355,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: @@ -8023,6 +8232,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -8117,6 +8343,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -8306,6 +8549,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: @@ -8543,6 +8788,29 @@ spec: type: object restartPolicy: type: string + restartPolicyRules: + items: + properties: + action: + type: string + exitCodes: + properties: + operator: + type: string + values: + items: + format: int32 + type: integer + type: array + x-kubernetes-list-type: set + required: + - operator + type: object + required: + - action + type: object + type: array + x-kubernetes-list-type: atomic securityContext: properties: allowPrivilegeEscalation: @@ -8874,6 +9142,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: @@ -9887,6 +10157,25 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + required: + - keyType + - signerName + type: object secret: properties: items: @@ -10697,6 +10986,25 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + required: + - keyType + - signerName + type: object secret: properties: items: @@ -11863,6 +12171,25 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + required: + - keyType + - signerName + type: object secret: properties: items: @@ -12083,6 +12410,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: diff --git a/vendor/kubestash.dev/apimachinery/crds/core.kubestash.com_backupblueprints.yaml b/vendor/kubestash.dev/apimachinery/crds/core.kubestash.com_backupblueprints.yaml index b8e8480cc..c5235992f 100644 --- a/vendor/kubestash.dev/apimachinery/crds/core.kubestash.com_backupblueprints.yaml +++ b/vendor/kubestash.dev/apimachinery/crds/core.kubestash.com_backupblueprints.yaml @@ -106,6 +106,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -296,6 +313,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: @@ -1171,6 +1190,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -1265,6 +1301,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -1454,6 +1507,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: @@ -1691,6 +1746,29 @@ spec: type: object restartPolicy: type: string + restartPolicyRules: + items: + properties: + action: + type: string + exitCodes: + properties: + operator: + type: string + values: + items: + format: int32 + type: integer + type: array + x-kubernetes-list-type: set + required: + - operator + type: object + required: + - action + type: object + type: array + x-kubernetes-list-type: atomic securityContext: properties: allowPrivilegeEscalation: @@ -2022,6 +2100,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: @@ -3035,6 +3115,25 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + required: + - keyType + - signerName + type: object secret: properties: items: @@ -3845,6 +3944,25 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + required: + - keyType + - signerName + type: object secret: properties: items: @@ -5011,6 +5129,25 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + required: + - keyType + - signerName + type: object secret: properties: items: @@ -5231,6 +5368,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -5336,6 +5490,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -5526,6 +5697,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: @@ -6482,6 +6655,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -7152,6 +7342,25 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + required: + - keyType + - signerName + type: object secret: properties: items: @@ -7405,6 +7614,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -7595,6 +7821,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: @@ -8551,6 +8779,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -9221,6 +9466,25 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + required: + - keyType + - signerName + type: object secret: properties: items: @@ -10083,6 +10347,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -10177,6 +10458,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -10366,6 +10664,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: @@ -10603,6 +10903,29 @@ spec: type: object restartPolicy: type: string + restartPolicyRules: + items: + properties: + action: + type: string + exitCodes: + properties: + operator: + type: string + values: + items: + format: int32 + type: integer + type: array + x-kubernetes-list-type: set + required: + - operator + type: object + required: + - action + type: object + type: array + x-kubernetes-list-type: atomic securityContext: properties: allowPrivilegeEscalation: @@ -10934,6 +11257,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: @@ -11947,6 +12272,25 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + required: + - keyType + - signerName + type: object secret: properties: items: diff --git a/vendor/kubestash.dev/apimachinery/crds/core.kubestash.com_backupconfigurations.yaml b/vendor/kubestash.dev/apimachinery/crds/core.kubestash.com_backupconfigurations.yaml index d0c069b1d..1c6e8f1de 100644 --- a/vendor/kubestash.dev/apimachinery/crds/core.kubestash.com_backupconfigurations.yaml +++ b/vendor/kubestash.dev/apimachinery/crds/core.kubestash.com_backupconfigurations.yaml @@ -108,6 +108,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -298,6 +315,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: @@ -1173,6 +1192,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -1267,6 +1303,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -1456,6 +1509,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: @@ -1693,6 +1748,29 @@ spec: type: object restartPolicy: type: string + restartPolicyRules: + items: + properties: + action: + type: string + exitCodes: + properties: + operator: + type: string + values: + items: + format: int32 + type: integer + type: array + x-kubernetes-list-type: set + required: + - operator + type: object + required: + - action + type: object + type: array + x-kubernetes-list-type: atomic securityContext: properties: allowPrivilegeEscalation: @@ -2024,6 +2102,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: @@ -3037,6 +3117,25 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + required: + - keyType + - signerName + type: object secret: properties: items: @@ -3847,6 +3946,25 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + required: + - keyType + - signerName + type: object secret: properties: items: @@ -5013,6 +5131,25 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + required: + - keyType + - signerName + type: object secret: properties: items: @@ -5233,6 +5370,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -5338,6 +5492,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -5528,6 +5699,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: @@ -6484,6 +6657,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -7154,6 +7344,25 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + required: + - keyType + - signerName + type: object secret: properties: items: @@ -7407,6 +7616,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -7597,6 +7823,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: @@ -8553,6 +8781,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -9223,6 +9468,25 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + required: + - keyType + - signerName + type: object secret: properties: items: @@ -10085,6 +10349,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -10179,6 +10460,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -10368,6 +10666,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: @@ -10605,6 +10905,29 @@ spec: type: object restartPolicy: type: string + restartPolicyRules: + items: + properties: + action: + type: string + exitCodes: + properties: + operator: + type: string + values: + items: + format: int32 + type: integer + type: array + x-kubernetes-list-type: set + required: + - operator + type: object + required: + - action + type: object + type: array + x-kubernetes-list-type: atomic securityContext: properties: allowPrivilegeEscalation: @@ -10936,6 +11259,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: @@ -11949,6 +12274,25 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + required: + - keyType + - signerName + type: object secret: properties: items: diff --git a/vendor/kubestash.dev/apimachinery/crds/core.kubestash.com_backupverifier.yaml b/vendor/kubestash.dev/apimachinery/crds/core.kubestash.com_backupverifier.yaml index eb9aad281..1b83cb49b 100644 --- a/vendor/kubestash.dev/apimachinery/crds/core.kubestash.com_backupverifier.yaml +++ b/vendor/kubestash.dev/apimachinery/crds/core.kubestash.com_backupverifier.yaml @@ -77,6 +77,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -267,6 +284,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: @@ -1142,6 +1161,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -1236,6 +1272,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -1425,6 +1478,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: @@ -1662,6 +1717,29 @@ spec: type: object restartPolicy: type: string + restartPolicyRules: + items: + properties: + action: + type: string + exitCodes: + properties: + operator: + type: string + values: + items: + format: int32 + type: integer + type: array + x-kubernetes-list-type: set + required: + - operator + type: object + required: + - action + type: object + type: array + x-kubernetes-list-type: atomic securityContext: properties: allowPrivilegeEscalation: @@ -1993,6 +2071,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: @@ -3006,6 +3086,25 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + required: + - keyType + - signerName + type: object secret: properties: items: @@ -3816,6 +3915,25 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + required: + - keyType + - signerName + type: object secret: properties: items: @@ -4982,6 +5100,25 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + required: + - keyType + - signerName + type: object secret: properties: items: @@ -5202,6 +5339,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -5299,6 +5453,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -5489,6 +5660,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: @@ -7036,6 +7209,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -7130,6 +7320,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -7319,6 +7526,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: @@ -7556,6 +7765,29 @@ spec: type: object restartPolicy: type: string + restartPolicyRules: + items: + properties: + action: + type: string + exitCodes: + properties: + operator: + type: string + values: + items: + format: int32 + type: integer + type: array + x-kubernetes-list-type: set + required: + - operator + type: object + required: + - action + type: object + type: array + x-kubernetes-list-type: atomic securityContext: properties: allowPrivilegeEscalation: @@ -7887,6 +8119,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: @@ -8900,6 +9134,25 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + required: + - keyType + - signerName + type: object secret: properties: items: @@ -9762,6 +10015,25 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + required: + - keyType + - signerName + type: object secret: properties: items: diff --git a/vendor/kubestash.dev/apimachinery/crds/core.kubestash.com_hooktemplates.yaml b/vendor/kubestash.dev/apimachinery/crds/core.kubestash.com_hooktemplates.yaml index 57d416574..506682ede 100644 --- a/vendor/kubestash.dev/apimachinery/crds/core.kubestash.com_hooktemplates.yaml +++ b/vendor/kubestash.dev/apimachinery/crds/core.kubestash.com_hooktemplates.yaml @@ -171,6 +171,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -843,6 +860,25 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + required: + - keyType + - signerName + type: object secret: properties: items: diff --git a/vendor/kubestash.dev/apimachinery/crds/core.kubestash.com_restoresessions.yaml b/vendor/kubestash.dev/apimachinery/crds/core.kubestash.com_restoresessions.yaml index 4120c2fe9..b8bd8ed4d 100644 --- a/vendor/kubestash.dev/apimachinery/crds/core.kubestash.com_restoresessions.yaml +++ b/vendor/kubestash.dev/apimachinery/crds/core.kubestash.com_restoresessions.yaml @@ -81,6 +81,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -271,6 +288,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: @@ -1146,6 +1165,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -1240,6 +1276,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -1429,6 +1482,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: @@ -1666,6 +1721,29 @@ spec: type: object restartPolicy: type: string + restartPolicyRules: + items: + properties: + action: + type: string + exitCodes: + properties: + operator: + type: string + values: + items: + format: int32 + type: integer + type: array + x-kubernetes-list-type: set + required: + - operator + type: object + required: + - action + type: object + type: array + x-kubernetes-list-type: atomic securityContext: properties: allowPrivilegeEscalation: @@ -1997,6 +2075,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: @@ -3010,6 +3090,25 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + required: + - keyType + - signerName + type: object secret: properties: items: @@ -3820,6 +3919,25 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + required: + - keyType + - signerName + type: object secret: properties: items: @@ -4986,6 +5104,25 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + required: + - keyType + - signerName + type: object secret: properties: items: @@ -5206,6 +5343,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -5339,6 +5493,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -5529,6 +5700,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: @@ -6485,6 +6658,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -7155,6 +7345,25 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + required: + - keyType + - signerName + type: object secret: properties: items: @@ -7408,6 +7617,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -7598,6 +7824,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: @@ -8554,6 +8782,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -9224,6 +9469,25 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + required: + - keyType + - signerName + type: object secret: properties: items: diff --git a/vendor/kubestash.dev/apimachinery/crds/storage.kubestash.com_backupstorages.yaml b/vendor/kubestash.dev/apimachinery/crds/storage.kubestash.com_backupstorages.yaml index 70add056d..78853f5f8 100644 --- a/vendor/kubestash.dev/apimachinery/crds/storage.kubestash.com_backupstorages.yaml +++ b/vendor/kubestash.dev/apimachinery/crds/storage.kubestash.com_backupstorages.yaml @@ -93,6 +93,23 @@ spec: - fieldPath type: object x-kubernetes-map-type: atomic + fileKeyRef: + properties: + key: + type: string + optional: + default: false + type: boolean + path: + type: string + volumeName: + type: string + required: + - key + - path + - volumeName + type: object + x-kubernetes-map-type: atomic resourceFieldRef: properties: containerName: @@ -283,6 +300,8 @@ spec: - port type: object type: object + stopSignal: + type: string type: object livenessProbe: properties: @@ -1849,6 +1868,25 @@ spec: type: array x-kubernetes-list-type: atomic type: object + podCertificate: + properties: + certificateChainPath: + type: string + credentialBundlePath: + type: string + keyPath: + type: string + keyType: + type: string + maxExpirationSeconds: + format: int32 + type: integer + signerName: + type: string + required: + - keyType + - signerName + type: object secret: properties: items: diff --git a/vendor/modules.txt b/vendor/modules.txt index 076e9a630..bca3ad63e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -2,14 +2,14 @@ ## explicit; go 1.20 filippo.io/edwards25519 filippo.io/edwards25519/field -# github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 +# github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c ## explicit; go 1.16 github.com/Azure/go-ansiterm github.com/Azure/go-ansiterm/winterm # github.com/MakeNowJust/heredoc v1.0.0 ## explicit; go 1.12 github.com/MakeNowJust/heredoc -# github.com/Masterminds/semver/v3 v3.3.1 +# github.com/Masterminds/semver/v3 v3.4.0 ## explicit; go 1.21 github.com/Masterminds/semver/v3 # github.com/beorn7/perks v1.0.1 @@ -1664,7 +1664,7 @@ github.com/json-iterator/go # github.com/klauspost/cpuid/v2 v2.2.10 ## explicit; go 1.22 github.com/klauspost/cpuid/v2 -# github.com/kubernetes-csi/external-snapshotter/client/v8 v8.2.0 +# github.com/kubernetes-csi/external-snapshotter/client/v8 v8.4.0 ## explicit; go 1.22.0 github.com/kubernetes-csi/external-snapshotter/client/v8/apis/volumesnapshot/v1 # github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de @@ -1680,7 +1680,7 @@ github.com/mitchellh/mapstructure ## explicit; go 1.13 github.com/moby/spdystream github.com/moby/spdystream/spdy -# github.com/moby/term v0.5.0 +# github.com/moby/term v0.5.2 ## explicit; go 1.18 github.com/moby/term github.com/moby/term/windows @@ -1729,6 +1729,13 @@ github.com/opensearch-project/opensearch-go/v2/internal/version github.com/opensearch-project/opensearch-go/v2/opensearchapi github.com/opensearch-project/opensearch-go/v2/opensearchtransport github.com/opensearch-project/opensearch-go/v2/signer +# github.com/opensearch-project/opensearch-go/v3 v3.1.0 +## explicit; go 1.20 +github.com/opensearch-project/opensearch-go/v3 +github.com/opensearch-project/opensearch-go/v3/internal/version +github.com/opensearch-project/opensearch-go/v3/opensearchapi +github.com/opensearch-project/opensearch-go/v3/opensearchtransport +github.com/opensearch-project/opensearch-go/v3/signer # github.com/peterbourgon/diskv v2.0.1+incompatible ## explicit github.com/peterbourgon/diskv @@ -1918,7 +1925,7 @@ golang.org/x/text/secure/bidirule golang.org/x/text/transform golang.org/x/text/unicode/bidi golang.org/x/text/unicode/norm -# golang.org/x/time v0.13.0 +# golang.org/x/time v0.14.0 ## explicit; go 1.24.0 golang.org/x/time/rate # gomodules.xyz/clock v0.0.0-20200817085942-06523dba733f @@ -2579,12 +2586,12 @@ kmodules.xyz/offshoot-api/util # kmodules.xyz/prober v0.34.0 ## explicit; go 1.24.0 kmodules.xyz/prober/api/v1 -# kmodules.xyz/resource-metadata v0.40.2 -## explicit; go 1.24.0 +# kmodules.xyz/resource-metadata v0.41.0 +## explicit; go 1.25 kmodules.xyz/resource-metadata/apis/node kmodules.xyz/resource-metadata/apis/node/v1alpha1 kmodules.xyz/resource-metadata/crds -# kubedb.dev/apimachinery v0.60.0-rc.1 +# kubedb.dev/apimachinery v0.60.0 ## explicit; go 1.25.0 kubedb.dev/apimachinery/apis kubedb.dev/apimachinery/apis/archiver/v1alpha1 @@ -2630,15 +2637,19 @@ kubedb.dev/apimachinery/crds kubedb.dev/apimachinery/pkg/double_optin kubedb.dev/apimachinery/pkg/factory kubedb.dev/apimachinery/pkg/lib -# kubedb.dev/db-client-go v0.15.0-rc.1 +# kubedb.dev/db-client-go v0.15.0 ## explicit; go 1.25.5 kubedb.dev/db-client-go/elasticsearch kubedb.dev/db-client-go/redis -# kubeops.dev/csi-driver-cacerts v0.4.0 -## explicit; go 1.24.0 +# kubeops.dev/csi-driver-cacerts v0.5.0 +## explicit; go 1.25.0 kubeops.dev/csi-driver-cacerts/apis/cacerts kubeops.dev/csi-driver-cacerts/apis/cacerts/v1alpha1 kubeops.dev/csi-driver-cacerts/crds +# kubeops.dev/operator-shard-manager v0.0.5 +## explicit; go 1.25 +kubeops.dev/operator-shard-manager/api/v1alpha1 +kubeops.dev/operator-shard-manager/crds # kubeops.dev/petset v0.0.15 ## explicit; go 1.24.0 kubeops.dev/petset/apis/apps/v1 @@ -2651,14 +2662,14 @@ kubeops.dev/petset/crds kubeops.dev/sidekick/apis/apps kubeops.dev/sidekick/apis/apps/v1alpha1 kubeops.dev/sidekick/crds -# kubestash.dev/apimachinery v0.22.0 -## explicit; go 1.25 +# kubestash.dev/apimachinery v0.23.0 +## explicit; go 1.25.0 kubestash.dev/apimachinery/apis kubestash.dev/apimachinery/apis/core/v1alpha1 kubestash.dev/apimachinery/apis/storage/v1alpha1 kubestash.dev/apimachinery/crds -# open-cluster-management.io/api v1.0.0 -## explicit; go 1.23.6 +# open-cluster-management.io/api v1.1.1-0.20251222023835-510285203ee6 +## explicit; go 1.25.0 open-cluster-management.io/api/work/v1 # sigs.k8s.io/controller-runtime v0.22.4 => github.com/kmodules/controller-runtime v0.22.5-0.20251227114913-f011264689cd ## explicit; go 1.24.0 diff --git a/vendor/open-cluster-management.io/api/work/v1/0000_00_work.open-cluster-management.io_manifestworks.crd.yaml b/vendor/open-cluster-management.io/api/work/v1/0000_00_work.open-cluster-management.io_manifestworks.crd.yaml index a21191426..fbe9005f2 100644 --- a/vendor/open-cluster-management.io/api/work/v1/0000_00_work.open-cluster-management.io_manifestworks.crd.yaml +++ b/vendor/open-cluster-management.io/api/work/v1/0000_00_work.open-cluster-management.io_manifestworks.crd.yaml @@ -45,7 +45,7 @@ spec: properties: deleteOption: description: |- - DeleteOption represents deletion strategy when the manifestwork is deleted. + deleteOption represents deletion strategy when the manifestwork is deleted. Foreground deletion strategy is applied to all the resource in this manifestwork if it is not set. properties: propagationPolicy: @@ -156,7 +156,7 @@ spec: type: object type: object manifestConfigs: - description: ManifestConfigs represents the configurations of manifests + description: manifestConfigs represents the configurations of manifests defined in workload field. items: description: ManifestConfigOption represents the configurations @@ -371,11 +371,11 @@ spec: type: object type: array workload: - description: Workload represents the manifest workload to be deployed + description: workload represents the manifest workload to be deployed on a managed cluster. properties: manifests: - description: Manifests represents a list of kuberenetes resources + description: manifests represents a list of kubernetes resources to be deployed on a managed cluster. items: description: Manifest represents a resource to be deployed on diff --git a/vendor/open-cluster-management.io/api/work/v1/doc.go b/vendor/open-cluster-management.io/api/work/v1/doc.go index 2e1779f4c..7c611d3a8 100644 --- a/vendor/open-cluster-management.io/api/work/v1/doc.go +++ b/vendor/open-cluster-management.io/api/work/v1/doc.go @@ -1,7 +1,7 @@ +// Copyright Contributors to the Open Cluster Management project // Package v1 contains API Schema definitions for the work v1 API group -// +k8s:deepcopy-gen=package,register -// +k8s:openapi-gen=true +// +k8s:deepcopy-gen=package,register // +kubebuilder:validation:Optional // +groupName=work.open-cluster-management.io package v1 diff --git a/vendor/open-cluster-management.io/api/work/v1/register.go b/vendor/open-cluster-management.io/api/work/v1/register.go deleted file mode 100644 index a65001402..000000000 --- a/vendor/open-cluster-management.io/api/work/v1/register.go +++ /dev/null @@ -1,40 +0,0 @@ -package v1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -var ( - GroupName = "work.open-cluster-management.io" - GroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} - schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - // Install is a function which adds this version to a scheme - Install = schemeBuilder.AddToScheme - - // SchemeGroupVersion generated code relies on this name - // Deprecated - SchemeGroupVersion = GroupVersion - // AddToScheme exists solely to keep the old generators creating valid code - // DEPRECATED - AddToScheme = schemeBuilder.AddToScheme -) - -// Resource generated code relies on this being here, but it logically belongs to the group -// DEPRECATED -func Resource(resource string) schema.GroupResource { - return schema.GroupResource{Group: GroupName, Resource: resource} -} - -// Adds the list of known types to api.Scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(GroupVersion, - &ManifestWork{}, - &ManifestWorkList{}, - &AppliedManifestWork{}, - &AppliedManifestWorkList{}, - ) - metav1.AddToGroupVersion(scheme, GroupVersion) - return nil -} diff --git a/vendor/open-cluster-management.io/api/work/v1/types.go b/vendor/open-cluster-management.io/api/work/v1/types.go index 2e74ef905..321203f5f 100644 --- a/vendor/open-cluster-management.io/api/work/v1/types.go +++ b/vendor/open-cluster-management.io/api/work/v1/types.go @@ -1,3 +1,4 @@ +// Copyright Contributors to the Open Cluster Management project package v1 import ( @@ -34,15 +35,15 @@ const ( // ManifestWorkSpec represents a desired configuration of manifests to be deployed on the managed cluster. type ManifestWorkSpec struct { - // Workload represents the manifest workload to be deployed on a managed cluster. + // workload represents the manifest workload to be deployed on a managed cluster. Workload ManifestsTemplate `json:"workload,omitempty"` - // DeleteOption represents deletion strategy when the manifestwork is deleted. + // deleteOption represents deletion strategy when the manifestwork is deleted. // Foreground deletion strategy is applied to all the resource in this manifestwork if it is not set. // +optional DeleteOption *DeleteOption `json:"deleteOption,omitempty"` - // ManifestConfigs represents the configurations of manifests defined in workload field. + // manifestConfigs represents the configurations of manifests defined in workload field. // +optional ManifestConfigs []ManifestConfigOption `json:"manifestConfigs,omitempty"` @@ -64,7 +65,7 @@ type Manifest struct { // ManifestsTemplate represents the manifest workload to be deployed on a managed cluster. type ManifestsTemplate struct { - // Manifests represents a list of kuberenetes resources to be deployed on a managed cluster. + // manifests represents a list of kubernetes resources to be deployed on a managed cluster. // +optional Manifests []Manifest `json:"manifests,omitempty"` } @@ -503,6 +504,25 @@ const ( // WorkDegraded represents that the current state of work does not match // the desired state for a certain period. WorkDegraded string = "Degraded" + // WorkComplete represents that the work has completed and should no longer + // be updated. + WorkComplete string = "Complete" + // WorkDeleting represents that the work is being deleted by the agent currently. + // This condition is added only when the work's deletion timestamp is not nil. + WorkDeleting = "Deleting" +) + +// Work condition reasons +const ( + // WorkManifestsComplete represents that all completable manifests in the work + // have the Complete condition + WorkManifestsComplete string = "ManifestsComplete" + // WorkProgressingReasonApplying indicates resources are being applied + WorkProgressingReasonApplying string = "Applying" + // WorkProgressingReasonCompleted indicates all resources are applied and available + WorkProgressingReasonCompleted string = "Completed" + // WorkProgressingReasonFailed indicates the work failed to apply + WorkProgressingReasonFailed string = "Failed" ) // ManifestCondition represents the conditions of the resources deployed on a @@ -596,7 +616,10 @@ const ( ManifestComplete string = "Complete" ) -// Condition reasons +// Manifest condition reasons +// +// All reasons set by condition rule evaluation are expected to be prefixed with "ConditionRule" +// in order to determine which conditions were set by rules. const ( // ConditionRuleTrue is set when a rule is evaluated without error ConditionRuleEvaluated string = "ConditionRuleEvaluated" diff --git a/vendor/open-cluster-management.io/api/work/v1/zz_generated.deepcopy.go b/vendor/open-cluster-management.io/api/work/v1/zz_generated.deepcopy.go index 052d27393..79bdc43ad 100644 --- a/vendor/open-cluster-management.io/api/work/v1/zz_generated.deepcopy.go +++ b/vendor/open-cluster-management.io/api/work/v1/zz_generated.deepcopy.go @@ -1,6 +1,7 @@ //go:build !ignore_autogenerated // +build !ignore_autogenerated +// Copyright Contributors to the Open Cluster Management project // Code generated by deepcopy-gen. DO NOT EDIT. package v1 diff --git a/vendor/open-cluster-management.io/api/work/v1/zz_generated.register.go b/vendor/open-cluster-management.io/api/work/v1/zz_generated.register.go new file mode 100644 index 000000000..8c61d7603 --- /dev/null +++ b/vendor/open-cluster-management.io/api/work/v1/zz_generated.register.go @@ -0,0 +1,57 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// Copyright Contributors to the Open Cluster Management project +// Code generated by register-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + schema "k8s.io/apimachinery/pkg/runtime/schema" +) + +// GroupName specifies the group name used to register the objects. +const GroupName = "work.open-cluster-management.io" + +// GroupVersion specifies the group and the version used to register the objects. +var GroupVersion = metav1.GroupVersion{Group: GroupName, Version: "v1"} + +// SchemeGroupVersion is group version used to register these objects +// Deprecated: use GroupVersion instead. +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. + SchemeBuilder runtime.SchemeBuilder + localSchemeBuilder = &SchemeBuilder + // Deprecated: use Install instead + AddToScheme = localSchemeBuilder.AddToScheme + Install = localSchemeBuilder.AddToScheme +) + +func init() { + // We only register manually written functions here. The registration of the + // generated functions takes place in the generated files. The separation + // makes the code compile even when the generated files are missing. + localSchemeBuilder.Register(addKnownTypes) +} + +// Adds the list of known types to Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &AppliedManifestWork{}, + &AppliedManifestWorkList{}, + &ManifestWork{}, + &ManifestWorkList{}, + ) + // AddToGroupVersion allows the serialization of client types like ListOptions. + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/vendor/open-cluster-management.io/api/work/v1/zz_generated.swagger_doc_generated.go b/vendor/open-cluster-management.io/api/work/v1/zz_generated.swagger_doc_generated.go deleted file mode 100644 index 5c5454e31..000000000 --- a/vendor/open-cluster-management.io/api/work/v1/zz_generated.swagger_doc_generated.go +++ /dev/null @@ -1,322 +0,0 @@ -package v1 - -// This file contains a collection of methods that can be used from go-restful to -// generate Swagger API documentation for its models. Please read this PR for more -// information on the implementation: https://github.com/emicklei/go-restful/pull/215 -// -// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if -// they are on one line! For multiple line or blocks that you want to ignore use ---. -// Any context after a --- is ignored. -// -// Those methods can be generated by using hack/update-swagger-docs.sh - -// AUTO-GENERATED FUNCTIONS START HERE -var map_AppliedManifestResourceMeta = map[string]string{ - "": "AppliedManifestResourceMeta represents the group, version, resource, name and namespace of a resource. Since these resources have been created, they must have valid group, version, resource, namespace, and name.", - "version": "Version is the version of the Kubernetes resource.", - "uid": "UID is set on successful deletion of the Kubernetes resource by controller. The resource might be still visible on the managed cluster after this field is set. It is not directly settable by a client.", -} - -func (AppliedManifestResourceMeta) SwaggerDoc() map[string]string { - return map_AppliedManifestResourceMeta -} - -var map_AppliedManifestWork = map[string]string{ - "": "AppliedManifestWork represents an applied manifestwork on managed cluster that is placed on a managed cluster. An AppliedManifestWork links to a manifestwork on a hub recording resources deployed in the managed cluster. When the agent is removed from managed cluster, cluster-admin on managed cluster can delete appliedmanifestwork to remove resources deployed by the agent. The name of the appliedmanifestwork must be in the format of {hash of hub's first kube-apiserver url}-{manifestwork name}", - "spec": "Spec represents the desired configuration of AppliedManifestWork.", - "status": "Status represents the current status of AppliedManifestWork.", -} - -func (AppliedManifestWork) SwaggerDoc() map[string]string { - return map_AppliedManifestWork -} - -var map_AppliedManifestWorkList = map[string]string{ - "": "AppliedManifestWorkList is a collection of appliedmanifestworks.", - "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "items": "Items is a list of appliedmanifestworks.", -} - -func (AppliedManifestWorkList) SwaggerDoc() map[string]string { - return map_AppliedManifestWorkList -} - -var map_AppliedManifestWorkSpec = map[string]string{ - "": "AppliedManifestWorkSpec represents the desired configuration of AppliedManifestWork", - "hubHash": "HubHash represents the hash of the first hub kube apiserver to identify which hub this AppliedManifestWork links to.", - "agentID": "AgentID represents the ID of the work agent who is to handle this AppliedManifestWork.", - "manifestWorkName": "ManifestWorkName represents the name of the related manifestwork on the hub.", -} - -func (AppliedManifestWorkSpec) SwaggerDoc() map[string]string { - return map_AppliedManifestWorkSpec -} - -var map_AppliedManifestWorkStatus = map[string]string{ - "": "AppliedManifestWorkStatus represents the current status of AppliedManifestWork", - "appliedResources": "AppliedResources represents a list of resources defined within the manifestwork that are applied. Only resources with valid GroupVersionResource, namespace, and name are suitable. An item in this slice is deleted when there is no mapped manifest in manifestwork.Spec or by finalizer. The resource relating to the item will also be removed from managed cluster. The deleted resource may still be present until the finalizers for that resource are finished. However, the resource will not be undeleted, so it can be removed from this list and eventual consistency is preserved.", - "evictionStartTime": "EvictionStartTime represents the current appliedmanifestwork will be evicted after a grace period. An appliedmanifestwork will be evicted from the managed cluster in the following two scenarios:\n - the manifestwork of the current appliedmanifestwork is missing on the hub, or\n - the appliedmanifestwork hub hash does not match the current hub hash of the work agent.", -} - -func (AppliedManifestWorkStatus) SwaggerDoc() map[string]string { - return map_AppliedManifestWorkStatus -} - -var map_ConditionRule = map[string]string{ - "condition": "Condition is the type of condition that is set based on this rule. Any condition is supported, but certain special conditions can be used to to control higher level behaviors of the manifestwork. If the condition is Complete, the manifest will no longer be updated once completed.", - "type": "Type defines how a manifest should be evaluated for a condition. It can be CEL, or WellKnownConditions. If the type is CEL, user should specify the celExpressions field If the type is WellKnownConditions, certain common types in k8s.io/api will be considered completed as defined by hardcoded rules.", - "celExpressions": "CelExpressions defines the CEL expressions to be evaluated for the condition. Final result is the logical AND of all expressions.", - "message": "Message is set on the condition created for this rule", - "messageExpression": "MessageExpression uses a CEL expression to generate a message for the condition Will override message if both are set and messageExpression returns a non-empty string. Variables: - object: The current instance of the manifest - result: Boolean result of the CEL expressions", -} - -func (ConditionRule) SwaggerDoc() map[string]string { - return map_ConditionRule -} - -var map_DeleteOption = map[string]string{ - "propagationPolicy": "propagationPolicy can be Foreground, Orphan or SelectivelyOrphan SelectivelyOrphan should be rarely used. It is provided for cases where particular resources is transfering ownership from one ManifestWork to another or another management unit. Setting this value will allow a flow like 1. create manifestwork/2 to manage foo 2. update manifestwork/1 to selectively orphan foo 3. remove foo from manifestwork/1 without impacting continuity because manifestwork/2 adopts it.", - "selectivelyOrphans": "selectivelyOrphan represents a list of resources following orphan deletion stratecy", - "ttlSecondsAfterFinished": "TTLSecondsAfterFinished limits the lifetime of a ManifestWork that has been marked Complete by one or more conditionRules set for its manifests. If this field is set, and the manifestwork has completed, then it is elligible to be automatically deleted. If this field is unset, the manifestwork won't be automatically deleted even afer completion. If this field is set to zero, the manfiestwork becomes elligible to be deleted immediately after completion.", -} - -func (DeleteOption) SwaggerDoc() map[string]string { - return map_DeleteOption -} - -var map_FeedbackRule = map[string]string{ - "type": "Type defines the option of how status can be returned. It can be jsonPaths or wellKnownStatus. If the type is JSONPaths, user should specify the jsonPaths field If the type is WellKnownStatus, certain common fields of status defined by a rule only for types in in k8s.io/api and open-cluster-management/api will be reported, If these status fields do not exist, no values will be reported.", - "jsonPaths": "JsonPaths defines the json path under status field to be synced.", -} - -func (FeedbackRule) SwaggerDoc() map[string]string { - return map_FeedbackRule -} - -var map_FeedbackValue = map[string]string{ - "name": "Name represents the alias name for this field. It is the same as what is specified in StatuFeedbackRule in the spec.", - "fieldValue": "Value is the value of the status field. The value of the status field can only be integer, string or boolean.", -} - -func (FeedbackValue) SwaggerDoc() map[string]string { - return map_FeedbackValue -} - -var map_FieldValue = map[string]string{ - "": "FieldValue is the value of the status field. The value of the status field can only be integer, string or boolean.", - "type": "Type represents the type of the value, it can be integer, string or boolean.", - "integer": "Integer is the integer value when type is integer.", - "string": "String is the string value when type is string.", - "boolean": "Boolean is bool value when type is boolean.", - "jsonRaw": "JsonRaw is a json string when type is a list or object", -} - -func (FieldValue) SwaggerDoc() map[string]string { - return map_FieldValue -} - -var map_IgnoreField = map[string]string{ - "condition": "Condition defines the condition that the fields should be ignored when apply the resource. Fields in JSONPaths are all ignored when condition is met, otherwise no fields is ignored in the apply operation.", - "jsonPaths": "JSONPaths defines the list of json path in the resource to be ignored", -} - -func (IgnoreField) SwaggerDoc() map[string]string { - return map_IgnoreField -} - -var map_JsonPath = map[string]string{ - "name": "Name represents the alias name for this field", - "version": "Version is the version of the Kubernetes resource. If it is not specified, the resource with the semantically latest version is used to resolve the path.", - "path": "Path represents the json path of the field under status. The path must point to a field with single value in the type of integer, bool or string. If the path points to a non-existing field, no value will be returned. If the path points to a structure, map or slice, no value will be returned and the status conddition of StatusFeedBackSynced will be set as false. Ref to https://kubernetes.io/docs/reference/kubectl/jsonpath/ on how to write a jsonPath.", -} - -func (JsonPath) SwaggerDoc() map[string]string { - return map_JsonPath -} - -var map_Manifest = map[string]string{ - "": "Manifest represents a resource to be deployed on managed cluster.", -} - -func (Manifest) SwaggerDoc() map[string]string { - return map_Manifest -} - -var map_ManifestCondition = map[string]string{ - "": "ManifestCondition represents the conditions of the resources deployed on a managed cluster.", - "resourceMeta": "ResourceMeta represents the group, version, kind, name and namespace of a resoure.", - "statusFeedback": "StatusFeedback represents the values of the feild synced back defined in statusFeedbacks", - "conditions": "Conditions represents the conditions of this resource on a managed cluster.", -} - -func (ManifestCondition) SwaggerDoc() map[string]string { - return map_ManifestCondition -} - -var map_ManifestConfigOption = map[string]string{ - "": "ManifestConfigOption represents the configurations of a manifest defined in workload field.", - "resourceIdentifier": "ResourceIdentifier represents the group, resource, name and namespace of a resoure. iff this refers to a resource not created by this manifest work, the related rules will not be executed.", - "feedbackRules": "FeedbackRules defines what resource status field should be returned. If it is not set or empty, no feedback rules will be honored.", - "updateStrategy": "UpdateStrategy defines the strategy to update this manifest. UpdateStrategy is Update if it is not set.", - "conditionRules": "ConditionRules defines how to set manifestwork conditions for a specific manifest.", -} - -func (ManifestConfigOption) SwaggerDoc() map[string]string { - return map_ManifestConfigOption -} - -var map_ManifestResourceMeta = map[string]string{ - "": "ManifestResourceMeta represents the group, version, kind, as well as the group, version, resource, name and namespace of a resoure.", - "ordinal": "Ordinal represents the index of the manifest on spec.", - "group": "Group is the API Group of the Kubernetes resource.", - "version": "Version is the version of the Kubernetes resource.", - "kind": "Kind is the kind of the Kubernetes resource.", - "resource": "Resource is the resource name of the Kubernetes resource.", - "name": "Name is the name of the Kubernetes resource.", - "namespace": "Name is the namespace of the Kubernetes resource.", -} - -func (ManifestResourceMeta) SwaggerDoc() map[string]string { - return map_ManifestResourceMeta -} - -var map_ManifestResourceStatus = map[string]string{ - "": "ManifestResourceStatus represents the status of each resource in manifest work deployed on managed cluster", - "manifests": "Manifests represents the condition of manifests deployed on managed cluster. Valid condition types are: 1. Progressing represents the resource is being applied on managed cluster. 2. Applied represents the resource is applied successfully on managed cluster. 3. Available represents the resource exists on the managed cluster. 4. Degraded represents the current state of resource does not match the desired state for a certain period.", -} - -func (ManifestResourceStatus) SwaggerDoc() map[string]string { - return map_ManifestResourceStatus -} - -var map_ManifestWork = map[string]string{ - "": "ManifestWork represents a manifests workload that hub wants to deploy on the managed cluster. A manifest workload is defined as a set of Kubernetes resources. ManifestWork must be created in the cluster namespace on the hub, so that agent on the corresponding managed cluster can access this resource and deploy on the managed cluster.", - "spec": "Spec represents a desired configuration of work to be deployed on the managed cluster.", - "status": "Status represents the current status of work.", -} - -func (ManifestWork) SwaggerDoc() map[string]string { - return map_ManifestWork -} - -var map_ManifestWorkExecutor = map[string]string{ - "": "ManifestWorkExecutor is the executor that applies the resources to the managed cluster. i.e. the work agent.", - "subject": "Subject is the subject identity which the work agent uses to talk to the local cluster when applying the resources.", -} - -func (ManifestWorkExecutor) SwaggerDoc() map[string]string { - return map_ManifestWorkExecutor -} - -var map_ManifestWorkExecutorSubject = map[string]string{ - "": "ManifestWorkExecutorSubject is the subject identity used by the work agent to apply the resources. The work agent should check whether the applying resources are out-of-scope of the permission held by the executor identity.", - "type": "Type is the type of the subject identity. Supported types are: \"ServiceAccount\".", - "serviceAccount": "ServiceAccount is for identifying which service account to use by the work agent. Only required if the type is \"ServiceAccount\".", -} - -func (ManifestWorkExecutorSubject) SwaggerDoc() map[string]string { - return map_ManifestWorkExecutorSubject -} - -var map_ManifestWorkList = map[string]string{ - "": "ManifestWorkList is a collection of manifestworks.", - "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds", - "items": "Items is a list of manifestworks.", -} - -func (ManifestWorkList) SwaggerDoc() map[string]string { - return map_ManifestWorkList -} - -var map_ManifestWorkSpec = map[string]string{ - "": "ManifestWorkSpec represents a desired configuration of manifests to be deployed on the managed cluster.", - "workload": "Workload represents the manifest workload to be deployed on a managed cluster.", - "deleteOption": "DeleteOption represents deletion strategy when the manifestwork is deleted. Foreground deletion strategy is applied to all the resource in this manifestwork if it is not set.", - "manifestConfigs": "ManifestConfigs represents the configurations of manifests defined in workload field.", - "executor": "Executor is the configuration that makes the work agent to perform some pre-request processing/checking. e.g. the executor identity tells the work agent to check the executor has sufficient permission to write the workloads to the local managed cluster. Note that nil executor is still supported for backward-compatibility which indicates that the work agent will not perform any additional actions before applying resources.", -} - -func (ManifestWorkSpec) SwaggerDoc() map[string]string { - return map_ManifestWorkSpec -} - -var map_ManifestWorkStatus = map[string]string{ - "": "ManifestWorkStatus represents the current status of managed cluster ManifestWork.", - "conditions": "Conditions contains the different condition statuses for this work. Valid condition types are: 1. Applied represents workload in ManifestWork is applied successfully on managed cluster. 2. Progressing represents workload in ManifestWork is being applied on managed cluster. 3. Available represents workload in ManifestWork exists on the managed cluster. 4. Degraded represents the current state of workload does not match the desired state for a certain period.", - "resourceStatus": "ResourceStatus represents the status of each resource in manifestwork deployed on a managed cluster. The Klusterlet agent on managed cluster syncs the condition from the managed cluster to the hub.", -} - -func (ManifestWorkStatus) SwaggerDoc() map[string]string { - return map_ManifestWorkStatus -} - -var map_ManifestWorkSubjectServiceAccount = map[string]string{ - "": "ManifestWorkSubjectServiceAccount references service account in the managed clusters.", - "namespace": "Namespace is the namespace of the service account.", - "name": "Name is the name of the service account.", -} - -func (ManifestWorkSubjectServiceAccount) SwaggerDoc() map[string]string { - return map_ManifestWorkSubjectServiceAccount -} - -var map_ManifestsTemplate = map[string]string{ - "": "ManifestsTemplate represents the manifest workload to be deployed on a managed cluster.", - "manifests": "Manifests represents a list of kuberenetes resources to be deployed on a managed cluster.", -} - -func (ManifestsTemplate) SwaggerDoc() map[string]string { - return map_ManifestsTemplate -} - -var map_ResourceIdentifier = map[string]string{ - "": "ResourceIdentifier identifies a single resource included in this manifestwork", - "group": "Group is the API Group of the Kubernetes resource, empty string indicates it is in core group.", - "resource": "Resource is the resource name of the Kubernetes resource.", - "name": "Name is the name of the Kubernetes resource.", - "namespace": "Name is the namespace of the Kubernetes resource, empty string indicates it is a cluster scoped resource.", -} - -func (ResourceIdentifier) SwaggerDoc() map[string]string { - return map_ResourceIdentifier -} - -var map_SelectivelyOrphan = map[string]string{ - "": "SelectivelyOrphan represents a list of resources following orphan deletion stratecy", - "orphaningRules": "orphaningRules defines a slice of orphaningrule. Each orphaningrule identifies a single resource included in this manifestwork", -} - -func (SelectivelyOrphan) SwaggerDoc() map[string]string { - return map_SelectivelyOrphan -} - -var map_ServerSideApplyConfig = map[string]string{ - "force": "Force represents to force apply the manifest.", - "fieldManager": "FieldManager is the manager to apply the resource. It is work-agent by default, but can be other name with work-agent as the prefix.", - "ignoreFields": "IgnoreFields defines a list of json paths in the resource that will not be updated on the spoke.", -} - -func (ServerSideApplyConfig) SwaggerDoc() map[string]string { - return map_ServerSideApplyConfig -} - -var map_StatusFeedbackResult = map[string]string{ - "": "StatusFeedbackResult represents the values of the feild synced back defined in statusFeedbacks", - "values": "Values represents the synced value of the interested field.", -} - -func (StatusFeedbackResult) SwaggerDoc() map[string]string { - return map_StatusFeedbackResult -} - -var map_UpdateStrategy = map[string]string{ - "": "UpdateStrategy defines the strategy to update this manifest", - "type": "type defines the strategy to update this manifest, default value is Update. Update type means to update resource by an update call. CreateOnly type means do not update resource based on current manifest. ServerSideApply type means to update resource using server side apply with work-controller as the field manager. If there is conflict, the related Applied condition of manifest will be in the status of False with the reason of ApplyConflict. ReadOnly type means the agent will only check the existence of the resource based on its metadata, statusFeedBackRules can still be used to get feedbackResults.", - "serverSideApply": "serverSideApply defines the configuration for server side apply. It is honored only when the type of the updateStrategy is ServerSideApply", -} - -func (UpdateStrategy) SwaggerDoc() map[string]string { - return map_UpdateStrategy -} - -// AUTO-GENERATED FUNCTIONS END HERE