Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for inclusive naming #156

Merged
merged 4 commits into from
Oct 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ lint: ## Run lint on the package
}


backport: ## Backport one or more commits from master into version branches
backport: ## Backport one or more commits from main into version branches
ifeq ($(origin commits), undefined)
@echo "Missing commit(s), exiting..."
@exit 2
Expand Down
2 changes: 1 addition & 1 deletion internal/build/cmd/tools/commands/spec/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func TestBuild_zipfileUrl(t *testing.T) {
"build_id": "1.0.0-ab7cd914",
"projects": {
"opensearch": {
"branch": "master",
"branch": "main",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Xtansia Do we know if the branch change has happened? I was unable to find the artifact listed here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@harshavamsi This is just test data, not actually used other than to validate some logic that pulls out the archive url.

"commit_hash": "d3be79018b5b70a118ea5a897a539428b728df5a",
"Packages": {
"rest-resources-zip-8.0.0-SNAPSHOT.zip": {
Expand Down
85 changes: 44 additions & 41 deletions opensearchapi/api._.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,26 +84,29 @@ type API struct {

// Cat contains the Cat APIs
type Cat struct {
Aliases CatAliases
Allocation CatAllocation
Count CatCount
Fielddata CatFielddata
Health CatHealth
Help CatHelp
Indices CatIndices
Master CatMaster
Nodeattrs CatNodeattrs
Nodes CatNodes
PendingTasks CatPendingTasks
Plugins CatPlugins
Recovery CatRecovery
Repositories CatRepositories
Segments CatSegments
Shards CatShards
Snapshots CatSnapshots
Tasks CatTasks
Templates CatTemplates
ThreadPool CatThreadPool
Aliases CatAliases
Allocation CatAllocation
ClusterManager CatClusterManager
Count CatCount
Fielddata CatFielddata
Health CatHealth
Help CatHelp
Indices CatIndices
Nodeattrs CatNodeattrs
Nodes CatNodes
PendingTasks CatPendingTasks
Plugins CatPlugins
Recovery CatRecovery
Repositories CatRepositories
Segments CatSegments
Shards CatShards
Snapshots CatSnapshots
Tasks CatTasks
Templates CatTemplates
ThreadPool CatThreadPool

// Deprecated: To promote inclusive language, please use ClusterManager instead.
Master CatMaster
}

// Cluster contains the Cluster APIs
Expand Down Expand Up @@ -220,7 +223,6 @@ type Tasks struct {
}

// New creates new API
//
func New(t Transport) *API {
return &API{
Bulk: newBulkFunc(t),
Expand Down Expand Up @@ -266,26 +268,27 @@ func New(t Transport) *API {
UpdateByQueryRethrottle: newUpdateByQueryRethrottleFunc(t),
Update: newUpdateFunc(t),
Cat: &Cat{
Aliases: newCatAliasesFunc(t),
Allocation: newCatAllocationFunc(t),
Count: newCatCountFunc(t),
Fielddata: newCatFielddataFunc(t),
Health: newCatHealthFunc(t),
Help: newCatHelpFunc(t),
Indices: newCatIndicesFunc(t),
Master: newCatMasterFunc(t),
Nodeattrs: newCatNodeattrsFunc(t),
Nodes: newCatNodesFunc(t),
PendingTasks: newCatPendingTasksFunc(t),
Plugins: newCatPluginsFunc(t),
Recovery: newCatRecoveryFunc(t),
Repositories: newCatRepositoriesFunc(t),
Segments: newCatSegmentsFunc(t),
Shards: newCatShardsFunc(t),
Snapshots: newCatSnapshotsFunc(t),
Tasks: newCatTasksFunc(t),
Templates: newCatTemplatesFunc(t),
ThreadPool: newCatThreadPoolFunc(t),
Aliases: newCatAliasesFunc(t),
Allocation: newCatAllocationFunc(t),
ClusterManager: newCatClusterManagerFunc(t),
Count: newCatCountFunc(t),
Fielddata: newCatFielddataFunc(t),
Health: newCatHealthFunc(t),
Help: newCatHelpFunc(t),
Indices: newCatIndicesFunc(t),
Master: newCatMasterFunc(t),
Nodeattrs: newCatNodeattrsFunc(t),
Nodes: newCatNodesFunc(t),
PendingTasks: newCatPendingTasksFunc(t),
Plugins: newCatPluginsFunc(t),
Recovery: newCatRecoveryFunc(t),
Repositories: newCatRepositoriesFunc(t),
Segments: newCatSegmentsFunc(t),
Shards: newCatShardsFunc(t),
Snapshots: newCatSnapshotsFunc(t),
Tasks: newCatTasksFunc(t),
Templates: newCatTemplatesFunc(t),
ThreadPool: newCatThreadPoolFunc(t),
},
Cluster: &Cluster{
AllocationExplain: newClusterAllocationExplainFunc(t),
Expand Down
2 changes: 1 addition & 1 deletion opensearchapi/api.cat.aliases.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ func (f CatAliases) WithHelp(v bool) func(*CatAliasesRequest) {
}
}

// WithLocal - return local information, do not retrieve the state from master node (default: false).
// WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false).
//
func (f CatAliases) WithLocal(v bool) func(*CatAliasesRequest) {
return func(r *CatAliasesRequest) {
Expand Down
35 changes: 25 additions & 10 deletions opensearchapi/api.cat.allocation.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,15 @@ type CatAllocation func(o ...func(*CatAllocationRequest)) (*Response, error)
type CatAllocationRequest struct {
NodeID []string

Bytes string
Format string
H []string
Help *bool
Local *bool
MasterTimeout time.Duration
S []string
V *bool
Bytes string
Format string
H []string
Help *bool
Local *bool
MasterTimeout time.Duration
ClusterManagerTimeout time.Duration
S []string
V *bool

Pretty bool
Human bool
Expand Down Expand Up @@ -123,6 +124,10 @@ func (r CatAllocationRequest) Do(ctx context.Context, transport Transport) (*Res
params["master_timeout"] = formatDuration(r.MasterTimeout)
}

if r.ClusterManagerTimeout != 0 {
params["cluster_manager_timeout"] = formatDuration(r.ClusterManagerTimeout)
}

if len(r.S) > 0 {
params["s"] = strings.Join(r.S, ",")
}
Expand Down Expand Up @@ -238,22 +243,32 @@ func (f CatAllocation) WithHelp(v bool) func(*CatAllocationRequest) {
}
}

// WithLocal - return local information, do not retrieve the state from master node (default: false).
// WithLocal - return local information, do not retrieve the state from cluster-manager node (default: false).
//
func (f CatAllocation) WithLocal(v bool) func(*CatAllocationRequest) {
return func(r *CatAllocationRequest) {
r.Local = &v
}
}

// WithMasterTimeout - explicit operation timeout for connection to master node.
// WithMasterTimeout - explicit operation timeout for connection to cluster-manager node.
//
// Deprecated: To promote inclusive language, use WithClusterManagerTimeout instead.
//
func (f CatAllocation) WithMasterTimeout(v time.Duration) func(*CatAllocationRequest) {
return func(r *CatAllocationRequest) {
r.MasterTimeout = v
}
}

// WithClusterManagerTimeout - explicit operation timeout for connection to cluster-manager node.
//
func (f CatAllocation) WithClusterManagerTimeout(v time.Duration) func(*CatAllocationRequest) {
return func(r *CatAllocationRequest) {
r.ClusterManagerTimeout = v
}
}

// WithS - comma-separated list of column names or column aliases to sort by.
//
func (f CatAllocation) WithS(v ...string) func(*CatAllocationRequest) {
Expand Down
Loading