github.com/opensearch-project/opensearch-go/v2@v2.3.0/opensearchapi/api._.go (about) 1 // SPDX-License-Identifier: Apache-2.0 2 // 3 // The OpenSearch Contributors require contributions made to 4 // this file be licensed under the Apache-2.0 license or a 5 // compatible open source license. 6 // 7 // Modifications Copyright OpenSearch Contributors. See 8 // GitHub history for details. 9 10 // Licensed to Elasticsearch B.V. under one or more contributor 11 // license agreements. See the NOTICE file distributed with 12 // this work for additional information regarding copyright 13 // ownership. Elasticsearch B.V. licenses this file to you under 14 // the Apache License, Version 2.0 (the "License"); you may 15 // not use this file except in compliance with the License. 16 // You may obtain a copy of the License at 17 // 18 // http://www.apache.org/licenses/LICENSE-2.0 19 // 20 // Unless required by applicable law or agreed to in writing, 21 // software distributed under the License is distributed on an 22 // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 23 // KIND, either express or implied. See the License for the 24 // specific language governing permissions and limitations 25 // under the License. 26 27 package opensearchapi 28 29 // API contains the OpenSearch APIs 30 type API struct { 31 Cat *Cat 32 Cluster *Cluster 33 Indices *Indices 34 Ingest *Ingest 35 Nodes *Nodes 36 Remote *Remote 37 Snapshot *Snapshot 38 Tasks *Tasks 39 PointInTime *PointInTime 40 41 Bulk Bulk 42 ClearScroll ClearScroll 43 Count Count 44 Create Create 45 DanglingIndicesDeleteDanglingIndex DanglingIndicesDeleteDanglingIndex 46 DanglingIndicesImportDanglingIndex DanglingIndicesImportDanglingIndex 47 DanglingIndicesListDanglingIndices DanglingIndicesListDanglingIndices 48 DeleteByQuery DeleteByQuery 49 DeleteByQueryRethrottle DeleteByQueryRethrottle 50 Delete Delete 51 DeleteScript DeleteScript 52 Exists Exists 53 ExistsSource ExistsSource 54 Explain Explain 55 FieldCaps FieldCaps 56 Get Get 57 GetScriptContext GetScriptContext 58 GetScriptLanguages GetScriptLanguages 59 GetScript GetScript 60 GetSource GetSource 61 Index Index 62 Info Info 63 Mget Mget 64 Msearch Msearch 65 MsearchTemplate MsearchTemplate 66 Mtermvectors Mtermvectors 67 Ping Ping 68 PutScript PutScript 69 RankEval RankEval 70 Reindex Reindex 71 ReindexRethrottle ReindexRethrottle 72 RenderSearchTemplate RenderSearchTemplate 73 ScriptsPainlessExecute ScriptsPainlessExecute 74 Scroll Scroll 75 Search Search 76 SearchShards SearchShards 77 SearchTemplate SearchTemplate 78 TermsEnum TermsEnum 79 Termvectors Termvectors 80 UpdateByQuery UpdateByQuery 81 UpdateByQueryRethrottle UpdateByQueryRethrottle 82 Update Update 83 } 84 85 // Cat contains the Cat APIs 86 type Cat struct { 87 Aliases CatAliases 88 Allocation CatAllocation 89 ClusterManager CatClusterManager 90 Count CatCount 91 Fielddata CatFielddata 92 Health CatHealth 93 Help CatHelp 94 Indices CatIndices 95 Nodeattrs CatNodeattrs 96 Nodes CatNodes 97 PendingTasks CatPendingTasks 98 Plugins CatPlugins 99 Recovery CatRecovery 100 Repositories CatRepositories 101 Segments CatSegments 102 Shards CatShards 103 Snapshots CatSnapshots 104 Tasks CatTasks 105 Templates CatTemplates 106 ThreadPool CatThreadPool 107 108 // Deprecated: To promote inclusive language, please use ClusterManager instead. 109 Master CatMaster 110 } 111 112 // Cluster contains the Cluster APIs 113 type Cluster struct { 114 AllocationExplain ClusterAllocationExplain 115 DeleteComponentTemplate ClusterDeleteComponentTemplate 116 DeleteVotingConfigExclusions ClusterDeleteVotingConfigExclusions 117 ExistsComponentTemplate ClusterExistsComponentTemplate 118 GetComponentTemplate ClusterGetComponentTemplate 119 GetSettings ClusterGetSettings 120 Health ClusterHealth 121 PendingTasks ClusterPendingTasks 122 PostVotingConfigExclusions ClusterPostVotingConfigExclusions 123 PutComponentTemplate ClusterPutComponentTemplate 124 PutSettings ClusterPutSettings 125 RemoteInfo ClusterRemoteInfo 126 Reroute ClusterReroute 127 State ClusterState 128 Stats ClusterStats 129 } 130 131 // Indices contains the Indices APIs 132 type Indices struct { 133 AddBlock IndicesAddBlock 134 Analyze IndicesAnalyze 135 ClearCache IndicesClearCache 136 Clone IndicesClone 137 Close IndicesClose 138 Create IndicesCreate 139 CreateDataStream IndicesCreateDataStream 140 DeleteAlias IndicesDeleteAlias 141 DeleteIndexTemplate IndicesDeleteIndexTemplate 142 Delete IndicesDelete 143 DeleteTemplate IndicesDeleteTemplate 144 DeleteDataStream IndicesDeleteDataStream 145 DiskUsage IndicesDiskUsage 146 ExistsAlias IndicesExistsAlias 147 ExistsIndexTemplate IndicesExistsIndexTemplate 148 Exists IndicesExists 149 ExistsTemplate IndicesExistsTemplate 150 FieldUsageStats IndicesFieldUsageStats 151 Flush IndicesFlush 152 Forcemerge IndicesForcemerge 153 GetAlias IndicesGetAlias 154 GetFieldMapping IndicesGetFieldMapping 155 GetIndexTemplate IndicesGetIndexTemplate 156 GetMapping IndicesGetMapping 157 Get IndicesGet 158 GetSettings IndicesGetSettings 159 GetTemplate IndicesGetTemplate 160 GetDataStream IndicesGetDataStream 161 GetDataStreamStats IndicesGetDataStreamStats 162 GetUpgrade IndicesGetUpgrade 163 Open IndicesOpen 164 PutAlias IndicesPutAlias 165 PutIndexTemplate IndicesPutIndexTemplate 166 PutMapping IndicesPutMapping 167 PutSettings IndicesPutSettings 168 PutTemplate IndicesPutTemplate 169 Recovery IndicesRecovery 170 Refresh IndicesRefresh 171 ResolveIndex IndicesResolveIndex 172 Rollover IndicesRollover 173 Segments IndicesSegments 174 ShardStores IndicesShardStores 175 Shrink IndicesShrink 176 SimulateIndexTemplate IndicesSimulateIndexTemplate 177 SimulateTemplate IndicesSimulateTemplate 178 Split IndicesSplit 179 Stats IndicesStats 180 UpdateAliases IndicesUpdateAliases 181 Upgrade IndicesUpgrade 182 ValidateQuery IndicesValidateQuery 183 } 184 185 // Ingest contains the Ingest APIs 186 type Ingest struct { 187 DeletePipeline IngestDeletePipeline 188 GetPipeline IngestGetPipeline 189 ProcessorGrok IngestProcessorGrok 190 PutPipeline IngestPutPipeline 191 Simulate IngestSimulate 192 } 193 194 // Nodes contains the Nodes APIs 195 type Nodes struct { 196 HotThreads NodesHotThreads 197 Info NodesInfo 198 ReloadSecureSettings NodesReloadSecureSettings 199 Stats NodesStats 200 Usage NodesUsage 201 } 202 203 // Remote contains the Remote APIs 204 type Remote struct { 205 } 206 207 // Snapshot contains the Snapshot APIs 208 type Snapshot struct { 209 CleanupRepository SnapshotCleanupRepository 210 Clone SnapshotClone 211 CreateRepository SnapshotCreateRepository 212 Create SnapshotCreate 213 DeleteRepository SnapshotDeleteRepository 214 Delete SnapshotDelete 215 GetRepository SnapshotGetRepository 216 Get SnapshotGet 217 Restore SnapshotRestore 218 Status SnapshotStatus 219 VerifyRepository SnapshotVerifyRepository 220 } 221 222 // Tasks contains the Tasks APIs 223 type Tasks struct { 224 Cancel TasksCancel 225 Get TasksGet 226 List TasksList 227 } 228 229 // PointInTime contains the Point In Time APIs 230 type PointInTime struct { 231 Create PointInTimeCreate 232 Delete PointInTimeDelete 233 Get PointInTimeGet 234 } 235 236 // New creates new API 237 func New(t Transport) *API { 238 return &API{ 239 Bulk: newBulkFunc(t), 240 ClearScroll: newClearScrollFunc(t), 241 Count: newCountFunc(t), 242 Create: newCreateFunc(t), 243 DanglingIndicesDeleteDanglingIndex: newDanglingIndicesDeleteDanglingIndexFunc(t), 244 DanglingIndicesImportDanglingIndex: newDanglingIndicesImportDanglingIndexFunc(t), 245 DanglingIndicesListDanglingIndices: newDanglingIndicesListDanglingIndicesFunc(t), 246 DeleteByQuery: newDeleteByQueryFunc(t), 247 DeleteByQueryRethrottle: newDeleteByQueryRethrottleFunc(t), 248 Delete: newDeleteFunc(t), 249 DeleteScript: newDeleteScriptFunc(t), 250 Exists: newExistsFunc(t), 251 ExistsSource: newExistsSourceFunc(t), 252 Explain: newExplainFunc(t), 253 FieldCaps: newFieldCapsFunc(t), 254 Get: newGetFunc(t), 255 GetScriptContext: newGetScriptContextFunc(t), 256 GetScriptLanguages: newGetScriptLanguagesFunc(t), 257 GetScript: newGetScriptFunc(t), 258 GetSource: newGetSourceFunc(t), 259 Index: newIndexFunc(t), 260 Info: newInfoFunc(t), 261 Mget: newMgetFunc(t), 262 Msearch: newMsearchFunc(t), 263 MsearchTemplate: newMsearchTemplateFunc(t), 264 Mtermvectors: newMtermvectorsFunc(t), 265 Ping: newPingFunc(t), 266 PutScript: newPutScriptFunc(t), 267 RankEval: newRankEvalFunc(t), 268 Reindex: newReindexFunc(t), 269 ReindexRethrottle: newReindexRethrottleFunc(t), 270 RenderSearchTemplate: newRenderSearchTemplateFunc(t), 271 ScriptsPainlessExecute: newScriptsPainlessExecuteFunc(t), 272 Scroll: newScrollFunc(t), 273 Search: newSearchFunc(t), 274 SearchShards: newSearchShardsFunc(t), 275 SearchTemplate: newSearchTemplateFunc(t), 276 TermsEnum: newTermsEnumFunc(t), 277 Termvectors: newTermvectorsFunc(t), 278 UpdateByQuery: newUpdateByQueryFunc(t), 279 UpdateByQueryRethrottle: newUpdateByQueryRethrottleFunc(t), 280 Update: newUpdateFunc(t), 281 Cat: &Cat{ 282 Aliases: newCatAliasesFunc(t), 283 Allocation: newCatAllocationFunc(t), 284 ClusterManager: newCatClusterManagerFunc(t), 285 Count: newCatCountFunc(t), 286 Fielddata: newCatFielddataFunc(t), 287 Health: newCatHealthFunc(t), 288 Help: newCatHelpFunc(t), 289 Indices: newCatIndicesFunc(t), 290 Master: newCatMasterFunc(t), 291 Nodeattrs: newCatNodeattrsFunc(t), 292 Nodes: newCatNodesFunc(t), 293 PendingTasks: newCatPendingTasksFunc(t), 294 Plugins: newCatPluginsFunc(t), 295 Recovery: newCatRecoveryFunc(t), 296 Repositories: newCatRepositoriesFunc(t), 297 Segments: newCatSegmentsFunc(t), 298 Shards: newCatShardsFunc(t), 299 Snapshots: newCatSnapshotsFunc(t), 300 Tasks: newCatTasksFunc(t), 301 Templates: newCatTemplatesFunc(t), 302 ThreadPool: newCatThreadPoolFunc(t), 303 }, 304 Cluster: &Cluster{ 305 AllocationExplain: newClusterAllocationExplainFunc(t), 306 DeleteComponentTemplate: newClusterDeleteComponentTemplateFunc(t), 307 DeleteVotingConfigExclusions: newClusterDeleteVotingConfigExclusionsFunc(t), 308 ExistsComponentTemplate: newClusterExistsComponentTemplateFunc(t), 309 GetComponentTemplate: newClusterGetComponentTemplateFunc(t), 310 GetSettings: newClusterGetSettingsFunc(t), 311 Health: newClusterHealthFunc(t), 312 PendingTasks: newClusterPendingTasksFunc(t), 313 PostVotingConfigExclusions: newClusterPostVotingConfigExclusionsFunc(t), 314 PutComponentTemplate: newClusterPutComponentTemplateFunc(t), 315 PutSettings: newClusterPutSettingsFunc(t), 316 RemoteInfo: newClusterRemoteInfoFunc(t), 317 Reroute: newClusterRerouteFunc(t), 318 State: newClusterStateFunc(t), 319 Stats: newClusterStatsFunc(t), 320 }, 321 Indices: &Indices{ 322 AddBlock: newIndicesAddBlockFunc(t), 323 Analyze: newIndicesAnalyzeFunc(t), 324 ClearCache: newIndicesClearCacheFunc(t), 325 Clone: newIndicesCloneFunc(t), 326 Close: newIndicesCloseFunc(t), 327 Create: newIndicesCreateFunc(t), 328 CreateDataStream: newIndicesCreateDataStreamFunc(t), 329 DeleteAlias: newIndicesDeleteAliasFunc(t), 330 DeleteIndexTemplate: newIndicesDeleteIndexTemplateFunc(t), 331 Delete: newIndicesDeleteFunc(t), 332 DeleteTemplate: newIndicesDeleteTemplateFunc(t), 333 DeleteDataStream: newIndicesDeleteDataStreamFunc(t), 334 DiskUsage: newIndicesDiskUsageFunc(t), 335 ExistsAlias: newIndicesExistsAliasFunc(t), 336 ExistsIndexTemplate: newIndicesExistsIndexTemplateFunc(t), 337 Exists: newIndicesExistsFunc(t), 338 ExistsTemplate: newIndicesExistsTemplateFunc(t), 339 FieldUsageStats: newIndicesFieldUsageStatsFunc(t), 340 Flush: newIndicesFlushFunc(t), 341 Forcemerge: newIndicesForcemergeFunc(t), 342 GetAlias: newIndicesGetAliasFunc(t), 343 GetFieldMapping: newIndicesGetFieldMappingFunc(t), 344 GetIndexTemplate: newIndicesGetIndexTemplateFunc(t), 345 GetMapping: newIndicesGetMappingFunc(t), 346 Get: newIndicesGetFunc(t), 347 GetSettings: newIndicesGetSettingsFunc(t), 348 GetTemplate: newIndicesGetTemplateFunc(t), 349 GetDataStream: newIndicesGetDataStreamFunc(t), 350 GetDataStreamStats: newIndicesGetDataStreamStatsFunc(t), 351 GetUpgrade: newIndicesGetUpgradeFunc(t), 352 Open: newIndicesOpenFunc(t), 353 PutAlias: newIndicesPutAliasFunc(t), 354 PutIndexTemplate: newIndicesPutIndexTemplateFunc(t), 355 PutMapping: newIndicesPutMappingFunc(t), 356 PutSettings: newIndicesPutSettingsFunc(t), 357 PutTemplate: newIndicesPutTemplateFunc(t), 358 Recovery: newIndicesRecoveryFunc(t), 359 Refresh: newIndicesRefreshFunc(t), 360 ResolveIndex: newIndicesResolveIndexFunc(t), 361 Rollover: newIndicesRolloverFunc(t), 362 Segments: newIndicesSegmentsFunc(t), 363 ShardStores: newIndicesShardStoresFunc(t), 364 Shrink: newIndicesShrinkFunc(t), 365 SimulateIndexTemplate: newIndicesSimulateIndexTemplateFunc(t), 366 SimulateTemplate: newIndicesSimulateTemplateFunc(t), 367 Split: newIndicesSplitFunc(t), 368 Stats: newIndicesStatsFunc(t), 369 UpdateAliases: newIndicesUpdateAliasesFunc(t), 370 Upgrade: newIndicesUpgradeFunc(t), 371 ValidateQuery: newIndicesValidateQueryFunc(t), 372 }, 373 Ingest: &Ingest{ 374 DeletePipeline: newIngestDeletePipelineFunc(t), 375 GetPipeline: newIngestGetPipelineFunc(t), 376 ProcessorGrok: newIngestProcessorGrokFunc(t), 377 PutPipeline: newIngestPutPipelineFunc(t), 378 Simulate: newIngestSimulateFunc(t), 379 }, 380 Nodes: &Nodes{ 381 HotThreads: newNodesHotThreadsFunc(t), 382 Info: newNodesInfoFunc(t), 383 ReloadSecureSettings: newNodesReloadSecureSettingsFunc(t), 384 Stats: newNodesStatsFunc(t), 385 Usage: newNodesUsageFunc(t), 386 }, 387 Remote: &Remote{}, 388 Snapshot: &Snapshot{ 389 CleanupRepository: newSnapshotCleanupRepositoryFunc(t), 390 Clone: newSnapshotCloneFunc(t), 391 CreateRepository: newSnapshotCreateRepositoryFunc(t), 392 Create: newSnapshotCreateFunc(t), 393 DeleteRepository: newSnapshotDeleteRepositoryFunc(t), 394 Delete: newSnapshotDeleteFunc(t), 395 GetRepository: newSnapshotGetRepositoryFunc(t), 396 Get: newSnapshotGetFunc(t), 397 Restore: newSnapshotRestoreFunc(t), 398 Status: newSnapshotStatusFunc(t), 399 VerifyRepository: newSnapshotVerifyRepositoryFunc(t), 400 }, 401 Tasks: &Tasks{ 402 Cancel: newTasksCancelFunc(t), 403 Get: newTasksGetFunc(t), 404 List: newTasksListFunc(t), 405 }, 406 PointInTime: &PointInTime{ 407 Create: newPointInTimeCreateFunc(t), 408 Delete: newPointInTimeDeleteFunc(t), 409 Get: newPointInTimeGetFunc(t), 410 }, 411 } 412 }