Add sync interval to host sets (#1680)

This adds a parameter to host sets allowing the sync interval to be
user-specified on a per-host-set basis. A value of -1 disables syncing;
a value of null uses the current default.
This commit is contained in:
Jeff Mitchell authored and GitHub committed 2021-11-11 11:28:08 -05:00
1 parent dba7c6b531
commit 30e9f944a2
27 files changed
+752 -231

No files matched your search

+15 -14
View File
@@ -14,20 +14,21 @@ import (
)
type HostSet struct {
Id string `json:"id,omitempty"`
HostCatalogId string `json:"host_catalog_id,omitempty"`
Scope *scopes.ScopeInfo `json:"scope,omitempty"`
Plugin *plugins.PluginInfo `json:"plugin,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
CreatedTime time.Time `json:"created_time,omitempty"`
UpdatedTime time.Time `json:"updated_time,omitempty"`
Version uint32 `json:"version,omitempty"`
Type string `json:"type,omitempty"`
HostIds []string `json:"host_ids,omitempty"`
PreferredEndpoints []string `json:"preferred_endpoints,omitempty"`
Attributes map[string]interface{} `json:"attributes,omitempty"`
AuthorizedActions []string `json:"authorized_actions,omitempty"`
Id string `json:"id,omitempty"`
HostCatalogId string `json:"host_catalog_id,omitempty"`
Scope *scopes.ScopeInfo `json:"scope,omitempty"`
Plugin *plugins.PluginInfo `json:"plugin,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
CreatedTime time.Time `json:"created_time,omitempty"`
UpdatedTime time.Time `json:"updated_time,omitempty"`
Version uint32 `json:"version,omitempty"`
Type string `json:"type,omitempty"`
HostIds []string `json:"host_ids,omitempty"`
PreferredEndpoints []string `json:"preferred_endpoints,omitempty"`
SyncIntervalSeconds int32 `json:"sync_interval_seconds,omitempty"`
Attributes map[string]interface{} `json:"attributes,omitempty"`
AuthorizedActions []string `json:"authorized_actions,omitempty"`
response *api.Response
}
+12
View File
@@ -121,3 +121,15 @@ func DefaultPreferredEndpoints() Option {
o.postMap["preferred_endpoints"] = nil
}
}
func WithSyncIntervalSeconds(inSyncIntervalSeconds int32) Option {
return func(o *options) {
o.postMap["sync_interval_seconds"] = inSyncIntervalSeconds
}
}
func DefaultSyncIntervalSeconds() Option {
return func(o *options) {
o.postMap["sync_interval_seconds"] = nil
}
}